idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
39,700 | public void execute ( ) throws MojoExecutionException , MojoFailureException { try { final List < String > command = createCommand ( ) ; checkWorkingDirectory ( ) ; final int status = execute ( command ) ; if ( failOnAnsibleError && status != 0 ) { throw new MojoFailureException ( "Non-zero exit status returned" ) ; } ... | Constructs a command from the configured parameters and executes it logging output at debug |
39,701 | protected void addOptions ( final List < String > command ) { command . addAll ( createOption ( "-c" , connection ) ) ; command . addAll ( createOption ( "-f" , forks ) ) ; command . addAll ( createOption ( "-i" , inventory ) ) ; command . addAll ( createOption ( "-l" , limit ) ) ; command . addAll ( createOption ( "-M... | Adds the configured options to the list of command strings |
39,702 | protected List < String > createOption ( final String option , final List < String > values ) { if ( values == null ) { return new ArrayList < String > ( ) ; } final List < String > list = new ArrayList < String > ( ) ; for ( String value : values ) { list . add ( option ) ; list . add ( value ) ; } return list ; } | Creates a list for the given option an empty list if the option s values is null |
39,703 | protected String findClasspathFile ( final String path ) throws IOException { if ( path == null ) { return null ; } final File file = new File ( path ) ; if ( file . exists ( ) ) { return file . getAbsolutePath ( ) ; } return createTmpFile ( path ) . getAbsolutePath ( ) ; } | Checks whether the given file is an absolute path or a classpath file |
39,704 | private File createTmpFile ( final String path ) throws IOException { getLog ( ) . debug ( "Creating temporary file for: " + path ) ; final File output = new File ( System . getProperty ( "java.io.tmpdir" ) , "ansible-maven-plugin." + System . nanoTime ( ) ) ; final FileOutputStream outputStream = new FileOutputStream ... | Copies a classpath resource to the tmp directory to allow it to be run by ansible |
39,705 | private void copy ( final InputStream inputStream , final FileOutputStream outputStream ) throws IOException { final byte [ ] buffer = new byte [ 1024 * 4 ] ; int n ; try { while ( - 1 != ( n = inputStream . read ( buffer ) ) ) { outputStream . write ( buffer , 0 , n ) ; } } finally { inputStream . close ( ) ; outputSt... | Copies the input stream to the output stream using a 4K buffer |
39,706 | private void parseNames ( Document doc , String expression ) throws XPathExpressionException , IOException , SAXException { XPath xPath = XPathFactory . newInstance ( ) . newXPath ( ) ; NodeList nodeList = ( NodeList ) xPath . compile ( expression ) . evaluate ( doc , XPathConstants . NODESET ) ; for ( int i = 0 ; i < ... | Checks for application names in the document . Will add locations without names to a Set |
39,707 | public static < T , C extends Cell < T , ? > > VirtualFlow < T , C > createHorizontal ( ObservableList < T > items , Function < ? super T , ? extends C > cellFactory ) { return createHorizontal ( items , cellFactory , Gravity . FRONT ) ; } | Creates a viewport that lays out content horizontally from left to right |
39,708 | public static < T , C extends Cell < T , ? > > VirtualFlow < T , C > createHorizontal ( ObservableList < T > items , Function < ? super T , ? extends C > cellFactory , Gravity gravity ) { return new VirtualFlow < > ( items , cellFactory , new HorizontalHelper ( ) , gravity ) ; } | Creates a viewport that lays out content horizontally |
39,709 | public static < T , C extends Cell < T , ? > > VirtualFlow < T , C > createVertical ( ObservableList < T > items , Function < ? super T , ? extends C > cellFactory , Gravity gravity ) { return new VirtualFlow < > ( items , cellFactory , new VerticalHelper ( ) , gravity ) ; } | Creates a viewport that lays out content vertically from top to bottom |
39,710 | public C getCell ( int itemIndex ) { Lists . checkIndex ( itemIndex , items . size ( ) ) ; return cellPositioner . getSizedCell ( itemIndex ) ; } | If the item is out of view instantiates a new cell for the item . The returned cell will be properly sized but not properly positioned relative to the cells in the viewport unless it is itself in the viewport . |
39,711 | public VirtualFlowHit < C > hit ( double x , double y ) { double bOff = orientation . getX ( x , y ) ; double lOff = orientation . getY ( x , y ) ; bOff += breadthOffset0 . getValue ( ) ; if ( items . isEmpty ( ) ) { return orientation . hitAfterCells ( bOff , lOff ) ; } layout ( ) ; int firstVisible = getFirstVisibleI... | Hits this virtual flow at the given coordinates . |
39,712 | C getSizedCell ( int itemIndex ) { C cell = cellManager . getCell ( itemIndex ) ; double breadth = sizeTracker . breadthFor ( itemIndex ) ; double length = sizeTracker . lengthFor ( itemIndex ) ; orientation . resize ( cell , breadth , length ) ; return cell ; } | Returns properly sized but not properly positioned cell for the given index . |
39,713 | public void cropTo ( int fromItem , int toItem ) { fromItem = Math . max ( fromItem , 0 ) ; toItem = Math . min ( toItem , cells . size ( ) ) ; cells . forget ( 0 , fromItem ) ; cells . forget ( toItem , cells . size ( ) ) ; } | Updates the list of cells to display |
39,714 | int fillBackwardFrom0 ( int itemIndex , double upTo ) { double min = orientation . minY ( positioner . getVisibleCell ( itemIndex ) ) ; int i = itemIndex ; while ( min > upTo && i > 0 ) { -- i ; C c = positioner . placeEndFromStart ( i , min ) ; min = orientation . minY ( c ) ; } return i ; } | does not re - place the anchor cell |
39,715 | private void fillViewportFrom ( int itemIndex ) { int ground = fillTowardsGroundFrom0 ( itemIndex ) ; double gapBefore = distanceFromGround ( ground ) ; if ( gapBefore > 0 ) { shiftCellsTowardsGround ( ground , itemIndex , gapBefore ) ; } int sky = fillTowardsSkyFrom0 ( itemIndex ) ; double gapAfter = distanceFromSky (... | Starting from the anchor cell s node fills the viewport from the anchor to the ground and then from the anchor to the sky . |
39,716 | private List < String > getCommand ( Element trNode ) { List < String > result = new ArrayList < String > ( ) ; Elements trChildNodes = trNode . getElementsByTag ( "TD" ) ; for ( Element trChild : trChildNodes ) { result . add ( getTableDataValue ( trChild ) ) ; } if ( result . size ( ) != 1 && result . size ( ) != 3 )... | processing table row |
39,717 | private String getTableDataValue ( Element tdNode ) { StringBuffer buf = new StringBuffer ( ) ; List < Node > childNodes = tdNode . childNodes ( ) ; for ( Node tdChild : childNodes ) { if ( tdChild instanceof TextNode ) { buf . append ( ( ( TextNode ) tdChild ) . text ( ) ) ; } else if ( tdChild instanceof Element ) { ... | processing table data |
39,718 | protected Artifact findFrameworkArtifact ( boolean minVersionWins ) { Artifact result = null ; Set < ? > artifacts = project . getArtifacts ( ) ; for ( Iterator < ? > iter = artifacts . iterator ( ) ; iter . hasNext ( ) ; ) { Artifact artifact = ( Artifact ) iter . next ( ) ; if ( "zip" . equals ( artifact . getType ( ... | used by initialize dist and war mojos |
39,719 | protected File filterWebXml ( File webXml , File outputDirectory , String applicationName , String playWarId ) throws IOException { if ( ! outputDirectory . exists ( ) ) { if ( ! outputDirectory . mkdirs ( ) ) { throw new IOException ( String . format ( "Cannot create \"%s\" directory" , outputDirectory . getCanonicalP... | used by war and war - support mojos |
39,720 | private static void executeInPlayContext ( Runner runner , RunNotifier notifier ) throws TestSetFailedException { try { Invoker . invokeInThread ( new TestInvocation ( runner , notifier ) ) ; } catch ( Throwable e ) { throw new TestSetFailedException ( e ) ; } } | Play! Framework specific methods |
39,721 | protected void kill ( String pid ) throws IOException , InterruptedException { String os = System . getProperty ( "os.name" ) ; String command = ( os . startsWith ( "Windows" ) ) ? "taskkill /F /PID " + pid : "kill " + pid ; Runtime . getRuntime ( ) . exec ( command ) . waitFor ( ) ; } | copied from Play! Framework s play . utils . Utils Java class |
39,722 | public OAuthFuture < Credential > authorize10a ( final String userId , final OAuthCallback < Credential > callback , Handler handler ) { Preconditions . checkNotNull ( userId ) ; final Future2Task < Credential > task = new Future2Task < Credential > ( handler , callback ) { public void doWork ( ) throws Exception { try... | Authorizes the Android application to access user s protected data using the authorization flow in OAuth 1 . 0a . |
39,723 | public OAuthFuture < Credential > authorizeExplicitly ( final String userId , final OAuthCallback < Credential > callback , Handler handler ) { Preconditions . checkNotNull ( userId ) ; final Future2Task < Credential > task = new Future2Task < Credential > ( handler , callback ) { public void doWork ( ) throws Exceptio... | Authorizes the Android application to access user s protected data using the Explicit Authorization Code flow in OAuth 2 . 0 . |
39,724 | public OAuthFuture < Credential > authorizeImplicitly ( final String userId , final OAuthCallback < Credential > callback , Handler handler ) { Preconditions . checkNotNull ( userId ) ; final Future2Task < Credential > task = new Future2Task < Credential > ( handler , callback ) { public void doWork ( ) throws TokenRes... | Authorizes the Android application to access user s protected data using the Implicit Authorization flow in OAuth 2 . 0 . |
39,725 | public OAuthHmacCredential load10aCredential ( String userId ) throws IOException { if ( getCredentialStore ( ) == null ) { return null ; } OAuthHmacCredential credential = new10aCredential ( userId ) ; if ( ! getCredentialStore ( ) . load ( userId , credential ) ) { return null ; } return credential ; } | Loads the OAuth 1 . 0a credential of the given user ID from the credential store . |
39,726 | private OAuthHmacCredential new10aCredential ( String userId ) { ClientParametersAuthentication clientAuthentication = ( ClientParametersAuthentication ) getClientAuthentication ( ) ; OAuthHmacCredential . Builder builder = new OAuthHmacCredential . Builder ( getMethod ( ) , clientAuthentication . getClientId ( ) , cli... | Returns a new OAuth 1 . 0a credential instance based on the given user ID . |
39,727 | private Credential newCredential ( String userId ) { Credential . Builder builder = new Credential . Builder ( getMethod ( ) ) . setTransport ( getTransport ( ) ) . setJsonFactory ( getJsonFactory ( ) ) . setTokenServerEncodedUrl ( getTokenServerEncodedUrl ( ) ) . setClientAuthentication ( getClientAuthentication ( ) )... | Returns a new OAuth 2 . 0 credential instance based on the given user ID . |
39,728 | public void stop ( ) { if ( container != null ) { container . stop ( ) ; container = null ; } if ( jerseyHandler != null && jerseyHandler . getDelegate ( ) != null ) { ServiceLocatorFactory . getInstance ( ) . destroy ( jerseyHandler . getDelegate ( ) . getServiceLocator ( ) ) ; jerseyHandler = null ; } if ( server != ... | Shutdown jersey server and release resources |
39,729 | public void start ( ) { if ( started ) { return ; } ApplicationHandler handler = getApplicationHandler ( ) ; if ( handler == null ) { throw new IllegalStateException ( "ApplicationHandler cannot be null" ) ; } handler . onStartup ( this ) ; started = true ; } | Starts the container |
39,730 | protected void initBridge ( ServiceLocator locator , Injector injector ) { GuiceBridge . getGuiceBridge ( ) . initializeGuiceBridge ( locator ) ; GuiceIntoHK2Bridge guiceBridge = locator . getService ( GuiceIntoHK2Bridge . class ) ; guiceBridge . bridgeGuiceInjector ( injector ) ; injectMultibindings ( locator , inject... | Initialize the hk2 bridge |
39,731 | protected void injectMultibindings ( ServiceLocator locator , Injector injector ) { injectMultiBindings ( locator , injector , new Key < Set < ContainerRequestFilter > > ( ) { } , ContainerRequestFilter . class ) ; injectMultiBindings ( locator , injector , new Key < Set < ContainerResponseFilter > > ( ) { } , Containe... | This is a workaround for the hk2 bridge limitations |
39,732 | public List < String > getPackages ( ) { List < String > list = new ArrayList < > ( ) ; Consumer < JsonArray > reader = array -> { if ( ( array != null && ! array . isEmpty ( ) ) ) { for ( int i = 0 ; i < array . size ( ) ; i ++ ) { list . add ( array . getString ( i ) ) ; } } } ; JsonArray resources = config . getJson... | Returns a list of packages to be scanned for resources and components |
39,733 | public Map < String , Object > getProperties ( ) { JsonObject json = null ; JsonObject tmp ; tmp = config . getJsonObject ( CONFIG_PROPERTIES ) ; if ( tmp != null ) { json = tmp ; } tmp = config . getJsonObject ( CONFIG_RESOURCE_CONFIG ) ; if ( tmp != null ) { if ( json == null ) { json = tmp ; } else { json . mergeIn ... | Optional additional properties to be applied to Jersey resource configuration |
39,734 | public JksOptions getKeyStoreOptions ( ) { JsonObject json = config . getJsonObject ( CONFIG_JKS_OPTIONS ) ; return json == null ? null : new JksOptions ( json ) ; } | Vert . x http server key store options |
39,735 | public URI getBaseUri ( ) { String basePath = config . getString ( CONFIG_BASE_PATH , "/" ) ; if ( ! basePath . endsWith ( "/" ) ) { basePath += "/" ; } return URI . create ( basePath ) ; } | Returns the base URI used by Jersey |
39,736 | public void checkAuthStatus ( SimpleLoginAuthenticatedHandler handler ) { if ( androidContext != null ) { SharedPreferences sharedPreferences = androidContext . getSharedPreferences ( Constants . FIREBASE_ANDROID_SHARED_PREFERENCE , Context . MODE_PRIVATE ) ; String jsonTokenData = sharedPreferences . getString ( "json... | Check the authentication status . If there is a previously signed in user it will reauthenticate that user . |
39,737 | public void loginAnonymously ( final SimpleLoginAuthenticatedHandler completionHandler ) { HashMap < String , String > data = new HashMap < String , String > ( ) ; makeRequest ( Constants . FIREBASE_AUTH_ANONYMOUS_PATH , data , new RequestHandler ( ) { public void handle ( FirebaseSimpleLoginError error , JSONObject da... | Login anonymously . |
39,738 | static PrintDrawable initIcon ( Context context , AttributeSet attrs , boolean inEditMode ) { PrintDrawable . Builder iconBuilder = new PrintDrawable . Builder ( context ) ; if ( attrs != null ) { TypedArray a = context . obtainStyledAttributes ( attrs , R . styleable . PrintView ) ; if ( a . hasValue ( R . styleable .... | Initialization of icon for print views . |
39,739 | public static void initDefault ( AssetManager assets , String defaultFontPath ) { Typeface defaultFont = TypefaceManager . load ( assets , defaultFontPath ) ; initDefault ( defaultFont ) ; } | Define the default iconic font . |
39,740 | static Typeface load ( AssetManager assets , String path ) { synchronized ( sTypefaces ) { Typeface typeface ; if ( sTypefaces . containsKey ( path ) ) { typeface = sTypefaces . get ( path ) ; } else { typeface = Typeface . createFromAsset ( assets , path ) ; sTypefaces . put ( path , typeface ) ; } return typeface ; }... | Load a typeface from the specified font data . |
39,741 | private void buildSoapuiGuiEnvironment ( ) throws DependencyResolutionException , IOException { getLog ( ) . info ( "Building a SoapUI Gui environment" ) ; String version = ProjectInfo . getVersion ( ) ; File soapuiLibDirectory = getBuiltSoapuiGuiLibDirectory ( ) ; resolveAndCopyDependencies ( new DefaultArtifact ( "co... | if the soapui . home property if already set we should restore the initial value after the call of this mojo |
39,742 | protected boolean runRunner ( ) throws Exception { WsdlProject project = ( WsdlProject ) ProjectFactoryRegistry . getProjectFactory ( "wsdl" ) . createNew ( getProjectFile ( ) , getProjectPassword ( ) ) ; String pFile = getProjectFile ( ) ; project . getSettings ( ) . setString ( ProjectSettings . SHADOW_PASSWORD , nul... | we should provide a PR to let us inject implementation of the MockAsWar |
39,743 | public String getAbsoluteOutputFolder ( ModelItem modelItem ) { String folder = PropertyExpander . expandProperties ( modelItem , getOutputFolder ( ) ) ; if ( StringUtils . isNullOrEmpty ( folder ) ) { folder = PathUtils . getExpandedResourceRoot ( modelItem ) ; } else if ( PathUtils . isRelativePath ( folder ) ) { fol... | then not used by this method |
39,744 | public static JUnitSecurityReportCollector newReportCollector ( ) { String className = System . getProperty ( "soapui.junit.reportCollector" , null ) ; if ( StringUtils . isNotBlank ( className ) ) { try { return ( JUnitSecurityReportCollector ) Class . forName ( className ) . getConstructor ( ) . newInstance ( ) ; } c... | currently do not use it as SmartBear JUnitSecurityReportCollector have no constuctor with int argument |
39,745 | public void onViewCreated ( View view , Bundle savedInstanceState ) { super . onViewCreated ( view , savedInstanceState ) ; ensureContent ( ) ; } | Attach to view once the view hierarchy has been created . |
39,746 | public void onDestroyView ( ) { mContentShown = false ; mIsContentEmpty = false ; mProgressContainer = mContentContainer = mContentView = mEmptyView = null ; super . onDestroyView ( ) ; } | Detach from view . |
39,747 | public void setContentView ( int layoutResId ) { LayoutInflater layoutInflater = LayoutInflater . from ( getActivity ( ) ) ; View contentView = layoutInflater . inflate ( layoutResId , null ) ; setContentView ( contentView ) ; } | Set the content content from a layout resource . |
39,748 | public void setContentView ( View view ) { ensureContent ( ) ; if ( view == null ) { throw new IllegalArgumentException ( "Content view can't be null" ) ; } if ( mContentContainer instanceof ViewGroup ) { ViewGroup contentContainer = ( ViewGroup ) mContentContainer ; if ( mContentView == null ) { contentContainer . add... | Set the content view to an explicit view . If the content view was installed earlier the content will be replaced with a new view . |
39,749 | private void setContentShown ( boolean shown , boolean animate ) { ensureContent ( ) ; if ( mContentShown == shown ) { return ; } mContentShown = shown ; if ( shown ) { if ( animate ) { mProgressContainer . startAnimation ( AnimationUtils . loadAnimation ( getActivity ( ) , android . R . anim . fade_out ) ) ; mContentC... | Control whether the content is being displayed . You can make it not displayed if you are waiting for the initial data to show in it . During this time an indeterminant progress indicator will be shown instead . |
39,750 | private void ensureContent ( ) { if ( mContentContainer != null && mProgressContainer != null ) { return ; } View root = getView ( ) ; if ( root == null ) { throw new IllegalStateException ( "Content view not yet created" ) ; } mProgressContainer = root . findViewById ( R . id . progress_container ) ; if ( mProgressCon... | Initialization views . |
39,751 | public void onViewCreated ( View view , Bundle savedInstanceState ) { super . onViewCreated ( view , savedInstanceState ) ; ensureList ( ) ; } | Attach to grid view once the view hierarchy has been created . |
39,752 | public void onDestroyView ( ) { mHandler . removeCallbacks ( mRequestFocus ) ; mGridView = null ; mGridShown = false ; mEmptyView = mProgressContainer = mGridContainer = null ; mStandardEmptyView = null ; super . onDestroyView ( ) ; } | Detach from grid view . |
39,753 | private void setGridShown ( boolean shown , boolean animate ) { ensureList ( ) ; if ( mProgressContainer == null ) { throw new IllegalStateException ( "Can't be used with a custom content view" ) ; } if ( mGridShown == shown ) { return ; } mGridShown = shown ; if ( shown ) { if ( animate ) { mProgressContainer . startA... | Control whether the grid is being displayed . You can make it not displayed if you are waiting for the initial data to show in it . During this time an indeterminant progress indicator will be shown instead . |
39,754 | private void setListShown ( boolean shown , boolean animate ) { ensureList ( ) ; if ( mProgressContainer == null ) { throw new IllegalStateException ( "Can't be used with a custom content view" ) ; } if ( mListShown == shown ) { return ; } mListShown = shown ; if ( shown ) { if ( animate ) { mProgressContainer . startA... | Control whether the list is being displayed . You can make it not displayed if you are waiting for the initial data to show in it . During this time an indeterminant progress indicator will be shown instead . |
39,755 | public static < T > T getExtra ( Bundle extras , String name , boolean nullable ) { T value = null ; if ( extras != null && extras . containsKey ( name ) ) { value = ( T ) extras . get ( name ) ; } if ( ! nullable && value == null ) { throw new TransfuseInjectionException ( "Unable to access Extra " + name ) ; } return... | Returns the extras in the given bundle by name . If no extra is found and the extra is considered not nullable this method will throw a TransfuseInjectionException . If no extra is found and the extra is considered nullable this method will of course return null . |
39,756 | public static void notNull ( final Object object , final String objectName ) { if ( object == null ) { throw new IllegalArgumentException ( "expecting non-null value for " + maskNullArgument ( objectName ) ) ; } } | Throw a null pointer exception if object is null |
39,757 | public static void sameSize ( final Collection < ? > collection1 , final Collection < ? > collection2 , final String collection1Name , final String collection2Name ) { notNull ( collection1 , collection1Name ) ; notNull ( collection2 , collection2Name ) ; if ( collection1 . size ( ) != collection2 . size ( ) ) { throw ... | Checks that the collections have the same number of elements otherwise throws an exception |
39,758 | public static void atSize ( final Collection < ? > collection , final int size , final String collectionName ) { notNull ( collection , collectionName ) ; notNegative ( size , "size" ) ; if ( collection . size ( ) != size ) { throw new IllegalArgumentException ( "expecting " + maskNullArgument ( collectionName ) + " to... | Checks that a collection is of a given size |
39,759 | public static void notEmpty ( final Collection < ? > collection , final String collectionName ) { notNull ( collection , collectionName ) ; if ( collection . isEmpty ( ) ) { throw new IllegalArgumentException ( "expecting " + maskNullArgument ( collectionName ) + " to contain 1 or more elements" ) ; } } | Check that a collection is not empty |
39,760 | public static void notEmpty ( final Object [ ] array , final String arrayName ) { notNull ( array , arrayName ) ; if ( array . length == 0 ) { throw new IllegalArgumentException ( "expecting " + maskNullArgument ( arrayName ) + " to contain 1 or more elements" ) ; } } | Check that an array is not empty |
39,761 | public static void sameLength ( final Object [ ] array1 , final Object [ ] array2 , final String array1Name , final String array2Name ) { notNull ( array1 , array1Name ) ; notNull ( array2 , array2Name ) ; if ( array1 . length != array2 . length ) { throw new IllegalArgumentException ( "expecting " + maskNullArgument (... | Checks that the arrays have the same number of elements otherwise throws and exception |
39,762 | public static void atLength ( final Object [ ] array , final int length , final String arrayName ) { notNull ( array , arrayName ) ; notNegative ( length , "length" ) ; if ( array . length != length ) { throw new IllegalArgumentException ( "expecting " + maskNullArgument ( arrayName ) + " to be of length " + length + "... | Checks that an array is of a given length |
39,763 | public static void inBounds ( final Integer input , final Integer min , final Integer max , final String inputName ) { notNull ( input , inputName ) ; if ( ( min != null ) && ( input < min ) ) { throw new IndexOutOfBoundsException ( "a value of " + input . toString ( ) + " was unexpected for " + maskNullArgument ( inpu... | Checks that the input value is within the bounds of a maximum or minimum value |
39,764 | public static void notNegative ( final Integer input , final String inputName ) { notNull ( input , inputName ) ; if ( input < 0 ) { throw new IllegalArgumentException ( "a value of " + input . toString ( ) + " was unexpected for " + maskNullArgument ( inputName ) + ", it is expected to be positive" ) ; } } | Checks that the input value is non - negative |
39,765 | public static void notZero ( final Integer input , final String inputName ) { notNull ( input , inputName ) ; if ( input == 0 ) { throw new IllegalArgumentException ( "a zero value for was unexpected for " + maskNullArgument ( inputName ) + ", it is expected to be non zero" ) ; } } | Checks that the input value is non - zero |
39,766 | public static void notBlank ( final String input , final String inputName ) { notNull ( input , inputName ) ; if ( StringUtils . isBlank ( input ) ) { throw new IllegalArgumentException ( "Expecting " + maskNullArgument ( inputName ) + " to be a non blank value." ) ; } } | Checks that an input string is non blank |
39,767 | public static void instanceOf ( final Object input , Class < ? > classType , final String inputName ) { notNull ( input , "input" ) ; notNull ( classType , "classType" ) ; if ( ! classType . isInstance ( input ) ) { throw new IllegalArgumentException ( "Expecting " + maskNullArgument ( inputName ) + " to an instance of... | Check that an input of a given class |
39,768 | public ImmutableList < ASTParameter > getParameters ( Method method ) { return getParameters ( method . getParameterTypes ( ) , method . getGenericParameterTypes ( ) , method . getParameterAnnotations ( ) ) ; } | Builds the parameters for a given method |
39,769 | public ASTMethod getMethod ( Method method ) { ImmutableList < ASTParameter > astParameters = getParameters ( method ) ; ASTAccessModifier modifier = ASTAccessModifier . getModifier ( method . getModifiers ( ) ) ; ImmutableSet < ASTType > throwsTypes = getTypes ( method . getExceptionTypes ( ) ) ; return new ASTClassMe... | Builds an AST Method fromm the given input method . |
39,770 | public ASTField getField ( Field field ) { ASTAccessModifier modifier = ASTAccessModifier . getModifier ( field . getModifiers ( ) ) ; return new ASTClassField ( field , getType ( field . getType ( ) , field . getGenericType ( ) ) , modifier , getAnnotations ( field ) ) ; } | Builds an AST Field from the given field |
39,771 | public ASTConstructor getConstructor ( Constructor constructor , boolean isEnum , boolean isInnerClass ) { ASTAccessModifier modifier = ASTAccessModifier . getModifier ( constructor . getModifiers ( ) ) ; Annotation [ ] [ ] parameterAnnotations = constructor . getParameterAnnotations ( ) ; if ( constructor . getDeclari... | Build an AST Constructor from the given constructor |
39,772 | private ImmutableSet < ASTAnnotation > getAnnotations ( Annotation [ ] annotations ) { ImmutableSet . Builder < ASTAnnotation > astAnnotationBuilder = ImmutableSet . builder ( ) ; for ( Annotation annotation : annotations ) { astAnnotationBuilder . add ( getAnnotation ( annotation ) ) ; } return astAnnotationBuilder . ... | Build the AST Annotations from the given input annotation array . |
39,773 | public void execute ( ) { ExecutorService executorService = MoreExecutors . sameThreadExecutor ( ) ; for ( Transaction < V , R > transaction : transactions ) { if ( ! transaction . isComplete ( ) ) { executorService . execute ( transaction ) ; } } try { executorService . shutdown ( ) ; executorService . awaitTerminatio... | Executes the submitted work and if all transactions complete executes the aggregate on the aggregateWorker . |
39,774 | public boolean isComplete ( ) { for ( Transaction < V , R > transaction : transactions ) { if ( ! transaction . isComplete ( ) ) { return false ; } } return true ; } | Returns the completion status of the set of transactions . Will only return complete = true if all the transactions have completed successfully . |
39,775 | public static < T > Class < T > get ( Class < ? > type ) { return ( Class < T > ) REPOSITORY . get ( type ) ; } | Provides the corresponding generated Android Component class for the input Transfuse Component class . |
39,776 | public static < T > T getField ( Class < T > returnType , Class < ? > targetClass , Object target , String field ) { try { Field declaredField = targetClass . getDeclaredField ( field ) ; return AccessController . doPrivileged ( new GetFieldPrivilegedAction < T > ( declaredField , target ) ) ; } catch ( NoSuchFieldExce... | Returns the value of a field . |
39,777 | public static void setField ( Class < ? > targetClass , Object target , String field , Object value ) { try { Field classField = targetClass . getDeclaredField ( field ) ; AccessController . doPrivileged ( new SetFieldPrivilegedAction ( classField , target , value ) ) ; } catch ( NoSuchFieldException e ) { throw new Tr... | Updates field with the given value . |
39,778 | public static < T > T callMethod ( Class < T > retClass , Class < ? > targetClass , Object target , String method , Class [ ] argClasses , Object [ ] args ) { try { Method classMethod = targetClass . getDeclaredMethod ( method , argClasses ) ; return AccessController . doPrivileged ( new SetMethodPrivilegedAction < T >... | Calls a method with the provided arguments as parameters . |
39,779 | public synchronized ASTType getType ( final TypeElement typeElement ) { return new LazyASTType ( buildPackageClass ( typeElement ) , typeElement ) { public ASTType lazyLoad ( ) { if ( ! typeCache . containsKey ( typeElement ) ) { typeCache . put ( typeElement , buildType ( typeElement ) ) ; } return typeCache . get ( t... | Build a ASTType from the provided TypeElement . |
39,780 | public ASTField getField ( VariableElement variableElement ) { ASTAccessModifier modifier = buildAccessModifier ( variableElement ) ; return new ASTElementField ( variableElement , astTypeBuilderVisitor , modifier , getAnnotations ( variableElement ) ) ; } | Build a ASTElementField from the given VariableElement |
39,781 | public ASTMethod getMethod ( ExecutableElement executableElement ) { ImmutableList < ASTParameter > parameters = getParameters ( executableElement . getParameters ( ) ) ; ASTAccessModifier modifier = buildAccessModifier ( executableElement ) ; ImmutableSet < ASTType > throwsTypes = buildASTElementTypes ( executableElem... | Build an ASTMethod from the provided ExecutableElement |
39,782 | private ImmutableList < ASTParameter > getParameters ( List < ? extends VariableElement > variableElements ) { ImmutableList . Builder < ASTParameter > astParameterBuilder = ImmutableList . builder ( ) ; for ( VariableElement variables : variableElements ) { astParameterBuilder . add ( getParameter ( variables ) ) ; } ... | Build a list of ASTParameters corresponding tot he input VariableElement list elements |
39,783 | public ASTConstructor getConstructor ( ExecutableElement executableElement ) { ImmutableList < ASTParameter > parameters = getParameters ( executableElement . getParameters ( ) ) ; ASTAccessModifier modifier = buildAccessModifier ( executableElement ) ; ImmutableSet < ASTType > throwsTypes = buildASTElementTypes ( exec... | Build an ASTConstructor from the input ExecutableElement |
39,784 | public ConstructorInjectionPoint buildInjectionPoint ( ASTType containingType , ASTConstructor astConstructor , AnalysisContext context ) { ConstructorInjectionPoint constructorInjectionPoint = new ConstructorInjectionPoint ( containingType , astConstructor ) ; constructorInjectionPoint . addThrows ( astConstructor . g... | Build a Constructor InjectionPoint from the given ASTConstructor |
39,785 | public MethodInjectionPoint buildInjectionPoint ( ASTType rootContainingType , ASTType containingType , ASTMethod astMethod , AnalysisContext context ) { MethodInjectionPoint methodInjectionPoint = new MethodInjectionPoint ( rootContainingType , containingType , astMethod ) ; methodInjectionPoint . addThrows ( astMetho... | Build a Method Injection Point from the given ASTMethod |
39,786 | public FieldInjectionPoint buildInjectionPoint ( ASTType rootContainingType , ASTType containingType , ASTField astField , AnalysisContext context ) { return new FieldInjectionPoint ( rootContainingType , containingType , astField , buildInjectionNode ( astField . getAnnotations ( ) , astField , astField . getASTType (... | Build a Field InjectionPoint from the given ASTField |
39,787 | public InjectionNode buildInjectionNode ( ASTType astType , AnalysisContext context ) { return buildInjectionNode ( Collections . EMPTY_LIST , astType , astType , context ) ; } | Build a InjectionPoint directly from the given ASTType |
39,788 | public < T > void register ( Class < T > event , EventObserver < T > observer ) { if ( event == null ) { throw new IllegalArgumentException ( "Null Event type passed to register" ) ; } if ( observer == null ) { throw new IllegalArgumentException ( "Null observer passed to register" ) ; } nullSafeGet ( event ) . add ( o... | Register the given observer to be triggered if the given event type is triggered . |
39,789 | public void trigger ( Object event ) { Set < Class > eventTypes = getAllInheritedClasses ( event . getClass ( ) ) ; for ( Class eventType : eventTypes ) { if ( observers . containsKey ( eventType ) ) { for ( EventObserver eventObserver : observers . get ( eventType ) ) { executionQueue . get ( ) . add ( new EventExecut... | Triggers an event through the EventManager . This will call the registered EventObservers with the provided event . |
39,790 | public void unregister ( EventObserver < ? > observer ) { for ( Map . Entry < Class , Set < EventObserver > > entry : observers . entrySet ( ) ) { entry . getValue ( ) . remove ( observer ) ; } } | Unregisters an EventObserver by equality . |
39,791 | public void start ( IntentFactoryStrategy parameters ) { Intent intent = buildIntent ( parameters ) ; parameters . start ( context , intent ) ; } | Start the appropriate target Context specified by the input Strategy . |
39,792 | public Intent buildIntent ( IntentFactoryStrategy parameters ) { android . content . Intent intent = intentMockFactory . buildIntent ( context , parameters . getTargetContext ( ) ) ; intent . setFlags ( parameters . getFlags ( ) ) ; for ( String category : parameters . getCategories ( ) ) { intent . addCategory ( categ... | Build an Intent specified by the given input Strategy . |
39,793 | public PendingIntent buildPendingIntent ( int requestCode , int flags , IntentFactoryStrategy parameters ) { return PendingIntent . getActivity ( context , requestCode , buildIntent ( parameters ) , flags ) ; } | Build a PendingIntent specified by the given input Strategy . |
39,794 | public boolean inherits ( ASTType astType , ASTType inheritable ) { if ( astType == null ) { return false ; } if ( inheritable == null || inheritable . equals ( OBJECT_TYPE ) ) { return true ; } if ( astType . equals ( inheritable ) ) { return true ; } for ( ASTType typeInterfaces : astType . getInterfaces ( ) ) { if (... | Determines if the given ASTType inherits or extends from the given inheritable ASTType |
39,795 | public final void loadRepository ( ClassLoader classLoader , String repositoryPackage , String repositoryName ) { try { Class repositoryClass = classLoader . loadClass ( repositoryPackage + "." + repositoryName ) ; Repository < T > instance = ( Repository < T > ) repositoryClass . newInstance ( ) ; generatedMap . putAl... | Update the repository class from the given classloader . If the given repository class cannot be instantiated then this method will throw a TransfuseRuntimeException . |
39,796 | private void createConfigurationsForModuleType ( ImmutableList . Builder < ModuleConfiguration > configurations , ASTType module , ASTType scanTarget , Set < MethodSignature > scanned , Map < String , Set < MethodSignature > > packagePrivateScanned ) { configureModuleAnnotations ( configurations , module , scanTarget ,... | Recursive method that finds module methods and annotations on all parents of moduleAncestor and moduleAncestor but creates configuration based on the module . This allows any class in the module hierarchy to contribute annotations or providers that can be overridden by subclasses . |
39,797 | public Object invoke ( Object [ ] arguments ) { try { return new MethodInterceptorIterator ( arguments ) . proceed ( ) ; } catch ( Throwable e ) { throw new TransfuseInjectionException ( "Error while invoking Method Interceptor" , e ) ; } } | Invoke the method interception chain . |
39,798 | protected void setup ( SuggestOracle suggestions ) { if ( itemBoxKeyDownHandler != null ) { itemBoxKeyDownHandler . removeHandler ( ) ; } list . setStyleName ( AddinsCssName . MULTIVALUESUGGESTBOX_LIST ) ; this . suggestions = suggestions ; final ListItem item = new ListItem ( ) ; item . setStyleName ( AddinsCssName . ... | Generate and build the List Items to be set on Auto Complete box . |
39,799 | protected boolean addItem ( final Suggestion suggestion ) { SelectionEvent . fire ( MaterialAutoComplete . this , suggestion ) ; if ( getLimit ( ) > 0 ) { if ( suggestionMap . size ( ) >= getLimit ( ) ) { return false ; } } if ( suggestionMap . containsKey ( suggestion ) ) { return false ; } final ListItem displayItem ... | Adding the item value using Material Chips added on auto complete box |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.