idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
5,400 | public static String getNonce ( long issueTime ) { long currentTime = new Date ( ) . getTime ( ) ; return TimeUnit . MILLISECONDS . toSeconds ( currentTime - issueTime ) + ":" + Long . toString ( System . nanoTime ( ) ) ; } | Returns a nonce value . The nonce value MUST be unique across all requests with the same MAC key identifier . |
5,401 | public static Object invoke ( final Object obj , final String methodName , final Object param ) throws UtilException { return invokeOneArgMethod ( obj , methodName , param , param . getClass ( ) ) ; } | Invoke an arbitrary one argument method on an arbitrary object and let the method work out the parameter s type . The user of this method had better be sure that the param isn t null . If there s a chance it is null then the invoke method with a paramType argument must be used . |
5,402 | public static Object invoke ( final Object obj , final String methodName , final Object param , final Class < ? > parameterType ) throws UtilException { return invokeOneArgMethod ( obj , methodName , param , parameterType ) ; } | Invoke an arbitrary one argument method on an arbitrary object but also include the parameter s type . |
5,403 | public static Object invokeStaticMethod ( final Class < ? > objClass , final String methodName , final Object param ) throws UtilException { return invokeOneArgStaticMethod ( objClass , methodName , param , param . getClass ( ) ) ; } | Invoke an arbitrary one argument method on an arbitrary class and let the method work out the parameter s type . The user of this method had better be sure that the param isn t null . If there s a chance it is null then the invoke method with a paramType argument must be used . |
5,404 | public int runCommandLine ( ) throws IOException , InterruptedException { logRunnerConfiguration ( ) ; ProcessBuilder processBuilder = new ProcessBuilder ( getCommandLineArguments ( ) ) ; processBuilder . directory ( workingDirectory ) ; processBuilder . environment ( ) . putAll ( environmentVars ) ; Process commandLin... | Execute the configured program |
5,405 | private File getDefaultOutputDirectory ( ) { String childOutputDirectory = getConfiguration ( ) ; if ( ! getPlatform ( ) . equals ( "Win32" ) ) { childOutputDirectory = new File ( getPlatform ( ) , childOutputDirectory ) . getPath ( ) ; } return new File ( getBaseDirectory ( ) , childOutputDirectory ) ; } | Retrieve the default output directory for the Visual C ++ project . |
5,406 | private File getBaseDirectory ( ) { File referenceFile = ( solutionFile != null ? solutionFile : getInputFile ( ) ) ; return referenceFile . getParentFile ( ) . getAbsoluteFile ( ) ; } | Retrieve the base directory for the Visual C ++ project . If this project is part of a Visual Studio solution the base directory is the solution directory ; for standalone projects the base directory is the project directory . |
5,407 | public String toSqlString ( Criteria criteria , CriteriaQuery criteriaQuery ) throws HibernateException { String [ ] columns ; try { columns = criteriaQuery . getColumnsUsingProjection ( criteria , propertyName ) ; } catch ( QueryException e ) { columns = new String [ 0 ] ; } return columns . length > 0 ? "FALSE" : "TR... | Render the SQL fragment that corresponds to this criterion . |
5,408 | public String getIdProperty ( TableRef tableRef ) { TableMapping tableMapping = mappedClasses . get ( tableRef ) ; if ( tableMapping == null ) { return null ; } ColumnMetaData identifierColumn = tableMapping . getIdentifierColumn ( ) ; return tableMapping . getColumnMapping ( identifierColumn ) . getPropertyName ( ) ; ... | Returns the name of the Identifier property |
5,409 | public String getGeometryProperty ( TableRef tableRef ) { TableMapping tableMapping = mappedClasses . get ( tableRef ) ; if ( tableMapping == null ) { return null ; } for ( ColumnMetaData columnMetaData : tableMapping . getMappedColumns ( ) ) { if ( columnMetaData . isGeometry ( ) ) { ColumnMapping cm = tableMapping . ... | Returns the name of the primary geometry property . |
5,410 | public void run ( String cmd , CommandFilter f ) { CommandWords commandWord = null ; if ( cmd . contains ( " " ) ) { try { commandWord = CommandWords . valueOf ( cmd . substring ( 1 , cmd . indexOf ( " " ) ) ) ; } catch ( IllegalArgumentException e ) { commandWord = CommandWords . INVALID_COMMAND_WORD ; } } else { comm... | Works out what type of command has been put into the method . |
5,411 | private void addProjectProperties ( ) throws MojoExecutionException { Properties projectProps = mavenProject . getProperties ( ) ; projectProps . setProperty ( PROPERTY_NAME_COMPANY , versionInfo . getCompanyName ( ) ) ; projectProps . setProperty ( PROPERTY_NAME_COPYRIGHT , versionInfo . getCopyright ( ) ) ; projectPr... | Add properties to the project that are replaced . |
5,412 | private File writeVersionInfoTemplateToTempFile ( ) throws MojoExecutionException { try { final File versionInfoSrc = File . createTempFile ( "msbuild-maven-plugin_" + MOJO_NAME , null ) ; InputStream is = getClass ( ) . getResourceAsStream ( DEFAULT_VERSION_INFO_TEMPLATE ) ; FileOutputStream dest = new FileOutputStrea... | Write the default . rc template file to a temporary file and return it |
5,413 | private void applyParser ( ) { this . snapshot . clear ( ) ; Map < String , String > originals = new HashMap < String , String > ( this . resolvers . size ( ) ) ; for ( Entry < String , VariableValue > resolver : this . resolvers . entrySet ( ) ) { originals . put ( resolver . getKey ( ) , resolver . getValue ( ) . get... | Re apply parser on all entries in map |
5,414 | protected PropertyValueBindingBuilder bindProperty ( final String name ) { checkNotNull ( name , "Property name cannot be null." ) ; return new PropertyValueBindingBuilder ( ) { public void toValue ( final String value ) { checkNotNull ( value , "Null value not admitted for property '%s's" , name ) ; bindConstant ( ) .... | Binds to a property with the given name . |
5,415 | public Tree < T > addLeaf ( T child ) { Tree < T > leaf = new Tree < T > ( child ) ; leaf . parent = this ; children . add ( leaf ) ; return leaf ; } | Add a new leaf to this tree |
5,416 | public void removeSubtree ( Tree < T > subtree ) { if ( children . remove ( subtree ) ) { subtree . parent = null ; } } | Remove given subtree |
5,417 | public Tree < T > addSubtree ( Tree < T > subtree ) { Tree < T > copy = addLeaf ( subtree . data ) ; copy . children = new ArrayList < Tree < T > > ( subtree . children ) ; return copy ; } | Add a subtree provided tree is not modified . |
5,418 | public static void checkIsSetLocal ( final DelegateExecution execution , final String variableName ) { Preconditions . checkArgument ( variableName != null , VARIABLE_NAME_MUST_BE_NOT_NULL ) ; final Object variableLocal = execution . getVariableLocal ( variableName ) ; Preconditions . checkState ( variableLocal != null... | Checks if a local variable with specified name is set . |
5,419 | public static void checkIsSetGlobal ( final DelegateExecution execution , final String variableName ) { Preconditions . checkArgument ( variableName != null , VARIABLE_SKIP_GUARDS ) ; final Object variable = execution . getVariable ( variableName ) ; Preconditions . checkState ( variable != null , String . format ( "Co... | Checks if a global variable with specified name is set . |
5,420 | private List < File > getRelativeIncludeDirectories ( VCProject vcProject ) throws MojoExecutionException { final List < File > relativeIncludeDirectories = new ArrayList < File > ( ) ; for ( File includeDir : vcProject . getIncludeDirectories ( ) ) { if ( includeDir . isAbsolute ( ) ) { relativeIncludeDirectories . ad... | Adjust the list of include paths to be relative to the projectFile directory |
5,421 | @ AfterStory ( uponGivenStory = false ) public void cleanUp ( ) { LOG . debug ( "Cleaning up after story run." ) ; Mocks . reset ( ) ; support . undeploy ( ) ; support . resetClock ( ) ; ProcessEngineAssertions . reset ( ) ; } | Clean up all resources . |
5,422 | @ Then ( "the step $activityId is reached" ) @ When ( "the step $activityId is reached" ) public void stepIsReached ( final String activityId ) { assertThat ( support . getProcessInstance ( ) ) . isWaitingAt ( activityId ) ; LOG . debug ( "Step {} reached." , activityId ) ; } | Process step reached . |
5,423 | public static boolean isValid ( String packaging ) { return MSBUILD_SOLUTION . equals ( packaging ) || EXE . equals ( packaging ) || DLL . equals ( packaging ) || LIB . equals ( packaging ) ; } | Test whether a packaging is a valid MSBuild packaging |
5,424 | public static final String validPackaging ( ) { return new StringBuilder ( ) . append ( MSBUILD_SOLUTION ) . append ( ", " ) . append ( EXE ) . append ( ", " ) . append ( DLL ) . append ( ", " ) . append ( LIB ) . toString ( ) ; } | Return a string listing the valid packaging types |
5,425 | public void setString ( String str ) throws IOException { Reader r = new StringReader ( str ) ; int c ; reset ( ) ; while ( ( ( c = r . read ( ) ) != 0 ) && ( c != - 1 ) ) { write ( c ) ; } } | Sets the buffer contents . |
5,426 | public String getString ( ) throws IOException { ByteArrayInputStream in = new ByteArrayInputStream ( buf ) ; int c ; StringWriter w = new StringWriter ( ) ; while ( ( ( c = in . read ( ) ) != 0 ) && ( c != - 1 ) ) { w . write ( ( char ) c ) ; } return w . getBuffer ( ) . toString ( ) ; } | Gets the buffer contents . |
5,427 | public void identifyPrimaryConfiguration ( ) throws MojoExecutionException { Set < String > configurationNames = new HashSet < String > ( ) ; for ( BuildConfiguration configuration : configurations ) { if ( configurationNames . contains ( configuration . getName ( ) ) ) { throw new MojoExecutionException ( "Duplicate c... | Check the configurations and mark one as primary . |
5,428 | public final String getCopyright ( ) { if ( copyright == null ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( COPYRIGHT_PREAMBLE ) . append ( " " ) . append ( Calendar . getInstance ( ) . get ( Calendar . YEAR ) ) . append ( " " ) . append ( companyName ) ; copyright = sb . toString ( ) ; } return copyrigh... | Get the configured copyright string |
5,429 | public void createNewPlayers ( ) { for ( int i = 0 ; i < size ( ) ; i ++ ) { players [ i ] = new SServerPlayer ( teamName , getNewControllerPlayer ( i ) , playerPort , hostname ) ; } } | Create 11 SServerPlayer s . |
5,430 | public void connectAll ( ) { for ( int i = 0 ; i < size ( ) ; i ++ ) { if ( i == 0 ) { players [ i ] . connect ( true ) ; } else if ( i >= 1 ) { try { players [ i ] . connect ( false ) ; } catch ( Exception ex ) { players [ i ] . handleError ( ex . getMessage ( ) ) ; } } pause ( 500 ) ; } if ( hasCoach ) { try { coach ... | Connect all the players to the server . ActionsPlayer with index 0 is always the goalie . Connects a coach if there is one . |
5,431 | public void connect ( int index ) { try { if ( index == 0 ) { players [ index ] . connect ( true ) ; } else { players [ index ] . connect ( false ) ; } } catch ( Exception ex ) { players [ index ] . handleError ( ex . getMessage ( ) ) ; } pause ( 500 ) ; } | Connect the selected player to the server . The player with index 0 is always the goalie . |
5,432 | private String findProperty ( String prop ) { String result = System . getProperty ( prop ) ; if ( result == null ) { result = mavenProject . getProperties ( ) . getProperty ( prop ) ; } return result ; } | Look for a value for the specified property in System properties then project properties . |
5,433 | protected void validateProjectFile ( ) throws MojoExecutionException { if ( projectFile != null && projectFile . exists ( ) && projectFile . isFile ( ) ) { getLog ( ) . debug ( "Project file validated at " + projectFile ) ; boolean solutionFile = projectFile . getName ( ) . toLowerCase ( ) . endsWith ( "." + SOLUTION_E... | Check that we have a valid project or solution file . |
5,434 | protected List < File > getProjectSources ( VCProject vcProject , boolean includeHeaders , List < String > excludes ) throws MojoExecutionException { final DirectoryScanner directoryScanner = new DirectoryScanner ( ) ; List < String > sourceFilePatterns = new ArrayList < String > ( ) ; String relProjectDir = calculateP... | Generate a list of source files in the project directory and sub - directories |
5,435 | protected List < VCProject > getParsedProjects ( BuildPlatform platform , BuildConfiguration configuration ) throws MojoExecutionException { Map < String , String > envVariables = new HashMap < String , String > ( ) ; if ( isCxxTestEnabled ( null , true ) ) { envVariables . put ( CxxTestConfiguration . HOME_ENVVAR , cx... | Return project configurations for the specified platform and configuration . |
5,436 | protected List < VCProject > getParsedProjects ( BuildPlatform platform , BuildConfiguration configuration , String filterRegex ) throws MojoExecutionException { Pattern filterPattern = null ; List < VCProject > filteredList = new ArrayList < VCProject > ( ) ; if ( filterRegex != null ) { filterPattern = Pattern . comp... | Return project configurations for the specified platform and configuration filtered by name using the specified Pattern . |
5,437 | protected List < File > getOutputDirectories ( BuildPlatform p , BuildConfiguration c ) throws MojoExecutionException { List < File > result = new ArrayList < File > ( ) ; File configured = c . getOutputDirectory ( ) ; if ( configured != null ) { result . add ( configured ) ; } else { List < VCProject > projects = getP... | Determine the directories that msbuild will write output files to for a given platform and configuration . If an outputDirectory is configured in the POM this will take precedence and be the only result . |
5,438 | protected boolean isCppCheckEnabled ( boolean quiet ) { if ( cppCheck . getSkip ( ) ) { if ( ! quiet ) { getLog ( ) . info ( CppCheckConfiguration . SKIP_MESSAGE + ", 'skip' set to true in the " + CppCheckConfiguration . TOOL_NAME + " configuration" ) ; } return false ; } if ( cppCheck . getCppCheckPath ( ) == null ) {... | Determine whether CppCheck is enabled by the configuration |
5,439 | protected boolean isVeraEnabled ( boolean quiet ) { if ( vera . getSkip ( ) ) { if ( ! quiet ) { getLog ( ) . info ( VeraConfiguration . SKIP_MESSAGE + ", 'skip' set to true in the " + VeraConfiguration . TOOL_NAME + " configuration" ) ; } return false ; } if ( vera . getVeraHome ( ) == null ) { if ( ! quiet ) { getLog... | Determine whether Vera ++ is enabled by the configuration |
5,440 | public void send ( String message ) throws IOException { buf . setString ( message ) ; DatagramPacket packet = new DatagramPacket ( buf . getByteArray ( ) , buf . length ( ) , host , port ) ; socket . send ( packet ) ; } | Sends a message to SServer . |
5,441 | public String toStateString ( ) { StringBuffer buff = new StringBuffer ( ) ; buff . append ( "Host: " ) ; buff . append ( this . hostname ) ; buff . append ( ':' ) ; buff . append ( this . port ) ; buff . append ( "\n" ) ; return buff . toString ( ) ; } | Returns a string containing the connection details . |
5,442 | public static void register ( final String scheme , Class < ? extends URLStreamHandler > handlerType ) { if ( ! registeredSchemes . add ( scheme ) ) { throw new IllegalStateException ( "a scheme has already been registered for " + scheme ) ; } registerPackage ( "org.skife.url.generated" ) ; Enhancer e = new Enhancer ( ... | Used to register a handler for a scheme . The actual handler used will in fact be a runtime generated subclass of handlerType in order to abide by the naming rules for URL scheme handlers . |
5,443 | public void addPlayerInitCommand ( String teamName , boolean isGoalie ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(init " ) ; buf . append ( teamName ) ; buf . append ( " (version " ) ; if ( isGoalie ) { buf . append ( serverVersion ) ; buf . append ( ") (goalie))" ) ; } else { buf . append ( server... | This is used to initialise a player . |
5,444 | public void addTrainerInitCommand ( ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(init (version " ) ; buf . append ( serverVersion ) ; buf . append ( "))" ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | This is used to initialise a trainer . |
5,445 | public void addCoachInitCommand ( String teamName ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(init " ) ; buf . append ( teamName ) ; buf . append ( " (version " ) ; buf . append ( serverVersion ) ; buf . append ( "))" ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | This is used to initialise the online coach . |
5,446 | public void addReconnectCommand ( String teamName , int num ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(reconnect " ) ; buf . append ( teamName ) ; buf . append ( ' ' ) ; buf . append ( num ) ; buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | This is used to reconnect the player to the server . |
5,447 | public void addCatchCommand ( int direction ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(catch " ) ; buf . append ( direction ) ; buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | Goalie special command . Tries to catch the ball in a given direction relative to its body direction . If the catch is successful the ball will be in the goalies hand untill kicked away . |
5,448 | public void addDashCommand ( int power ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(dash " ) ; buf . append ( power ) ; buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | This command accelerates the player in the direction of its body . |
5,449 | public void addKickCommand ( int power , int direction ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(kick " ) ; buf . append ( power ) ; buf . append ( ' ' ) ; buf . append ( direction ) ; buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | This command accelerates the ball with the given power in the given direction . |
5,450 | public void addTurnCommand ( int angle ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(turn " ) ; buf . append ( angle ) ; buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | This command will turn the players body in degrees relative to their current direction . |
5,451 | public void addChangePlayModeCommand ( PlayMode playMode ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(change_mode " ) ; buf . append ( playMode ) ; buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | Trainer only command . Changes the play mode of the server . |
5,452 | public void addMoveBallCommand ( double x , double y ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(move " ) ; buf . append ( "ball" ) ; buf . append ( ' ' ) ; buf . append ( x ) ; buf . append ( ' ' ) ; buf . append ( y ) ; buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; ... | Trainer only command . Moves the ball to the given coordinates . |
5,453 | public void addCheckBallCommand ( ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(check_ball)" ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | Trainer only command . Checks the current status of the ball . |
5,454 | public void addStartCommand ( ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(start)" ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | Trainer only command . Starts the server . |
5,455 | public void addRecoverCommand ( ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(recover)" ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | Trainer only command . Recovers the players stamina recovery effort and hear capacity to the values at the beginning of the game . |
5,456 | public void addEarCommand ( boolean earOn ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(ear " ) ; if ( earOn ) { buf . append ( "on" ) ; } else { buf . append ( "off" ) ; } buf . append ( ')' ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | Trainer only command . It turns on or off the sending of auditory information to the trainer . |
5,457 | public void addChangePlayerTypeCommand ( String teamName , int unum , int playerType ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(change_player_type " ) ; buf . append ( teamName ) ; buf . append ( ' ' ) ; buf . append ( unum ) ; buf . append ( ' ' ) ; buf . append ( playerType ) ; buf . append ( ')... | Trainer only command . This command changes the specified players heterogeneous type . |
5,458 | public void addTeamNamesCommand ( ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(team_names)" ) ; fifo . add ( fifo . size ( ) , buf . toString ( ) ) ; } | Trainer command that can be used by online coach . This command provides information about the names of both teams and which side they are playing on . |
5,459 | public void addTeamGraphicCommand ( XPMImage xpm ) { for ( int x = 0 ; x < xpm . getArrayWidth ( ) ; x ++ ) { for ( int y = 0 ; y < xpm . getArrayHeight ( ) ; y ++ ) { StringBuilder buf = new StringBuilder ( ) ; String tile = xpm . getTile ( x , y ) ; buf . append ( "(team_graphic (" ) ; buf . append ( x ) ; buf . appe... | Coach only command . The online coach can send teams - graphics as 256 x 64 XPM to the server . Each team graphic - command sends a 8x8 tile . X and Y are the coordinates of this tile so they range from 0 to 31 and 0 to 7 respectively . Each XPM line is a line from the 8x8 XPM tile . |
5,460 | public String next ( ) { if ( fifo . isEmpty ( ) ) { throw new RuntimeException ( "Fifo is empty" ) ; } String cmd = ( String ) fifo . get ( 0 ) ; fifo . remove ( 0 ) ; return cmd ; } | Gets the next command from the stack . |
5,461 | protected boolean isSonarEnabled ( boolean quiet ) throws MojoExecutionException { if ( sonar . skip ( ) ) { if ( ! quiet ) { getLog ( ) . info ( SonarConfiguration . SONAR_SKIP_MESSAGE + ", 'skip' set to true in the " + SonarConfiguration . SONAR_NAME + " configuration." ) ; } return false ; } validateProjectFile ( ) ... | Determine whether Sonar configuration generation is enabled by the configuration |
5,462 | public List < T > parse ( ) throws IllegalAccessException , InstantiationException , InvocationTargetException , NoSuchMethodException { List < T > list = new ArrayList < > ( ) ; Map < Method , TableCellMapping > cellMappingByMethod = ImporterUtils . getMappedMethods ( clazz , group ) ; final Constructor < T > construc... | Parser file to list of T objects |
5,463 | private String toJavaName ( String name ) { StringBuilder stb = new StringBuilder ( ) ; char [ ] namechars = name . toCharArray ( ) ; if ( ! Character . isJavaIdentifierStart ( namechars [ 0 ] ) ) { stb . append ( "__" ) ; } else { stb . append ( namechars [ 0 ] ) ; } for ( int i = 1 ; i < namechars . length ; i ++ ) {... | Turns the name into a valid simplified Java Identifier . |
5,464 | protected final void validateForMSBuild ( ) throws MojoExecutionException { if ( ! MSBuildPackaging . isValid ( mavenProject . getPackaging ( ) ) ) { throw new MojoExecutionException ( "Please set packaging to one of " + MSBuildPackaging . validPackaging ( ) ) ; } findMSBuild ( ) ; validateProjectFile ( ) ; platforms =... | Check the Mojo configuration provides sufficient data to construct an MSBuild command line . |
5,465 | protected final void findMSBuild ( ) throws MojoExecutionException { if ( msbuildPath == null ) { String msbuildEnv = System . getenv ( ENV_MSBUILD_PATH ) ; if ( msbuildEnv != null ) { msbuildPath = new File ( msbuildEnv ) ; } } if ( msbuildPath != null && msbuildPath . exists ( ) && msbuildPath . isFile ( ) ) { getLog... | Attempts to locate MSBuild . First looks at the mojo configuration property if not found there try the system environment . |
5,466 | protected void runMSBuild ( List < String > targets , Map < String , String > environment ) throws MojoExecutionException , MojoFailureException { try { MSBuildExecutor msbuild = new MSBuildExecutor ( getLog ( ) , msbuildPath , msbuildMaxCpuCount , projectFile ) ; msbuild . setPlatforms ( platforms ) ; msbuild . setTar... | Run MSBuild for each platform and configuration pair . |
5,467 | public String getTile ( int x , int y ) { if ( ( x > getArrayWidth ( ) ) || ( y > getArrayHeight ( ) ) || ( x < 0 ) || ( y < 0 ) ) { throw new IllegalArgumentException ( ) ; } return image [ x ] [ y ] ; } | Gets a tile of the XPM Image . |
5,468 | public String toListString ( ) { StringBuffer buf = new StringBuffer ( ) ; buf . append ( controller . getClass ( ) . getName ( ) ) ; return buf . toString ( ) ; } | Create a list string . |
5,469 | private void throwMultiEventException ( Event < ? > eventThatThrewException ) { while ( throwable instanceof MultiEventException && throwable . getCause ( ) != null ) { eventThatThrewException = ( ( MultiEventException ) throwable ) . getEvent ( ) ; throwable = throwable . getCause ( ) ; } throw new MultiEventException... | Unwraps cause of throwable if the throwable is itself a MultiEventException . This eliminates much excessive noise that is purely implementation detail of MultiEvents from the stack trace . |
5,470 | List < Node > get ( final Pattern ... patterns ) { return AbsoluteGetQuery . INSTANCE . execute ( this , includeRootPatternFirst ( patterns ) ) ; } | Get all children matching the specified query . |
5,471 | public String resolve ( Map < String , String > configuration ) { StringBuilder buffer = new StringBuilder ( ) ; append ( buffer , configuration , null ) ; return buffer . toString ( ) ; } | Begin resolving process with this appender against the provided configuration . |
5,472 | public static void validateToolPath ( File toolPath , String toolName , Log logger ) throws FileNotFoundException { logger . debug ( "Validating path for " + toolName ) ; if ( toolPath == null ) { logger . error ( "Missing " + toolName + " path" ) ; throw new FileNotFoundException ( ) ; } if ( ! toolPath . exists ( ) |... | Validates the path to a command - line tool . |
5,473 | public static List < BuildPlatform > validatePlatforms ( List < BuildPlatform > platforms ) throws MojoExecutionException { if ( platforms == null ) { platforms = new ArrayList < BuildPlatform > ( ) ; platforms . add ( new BuildPlatform ( ) ) ; } else { Set < String > platformNames = new HashSet < String > ( ) ; for ( ... | Check that we have a valid set of platforms . If no platforms are configured we create 1 default platform . |
5,474 | public static < D > RuleContext < D > collect ( ResultCollector < ? , D > resultCollector ) { return new ResultCollectorContext ( ) . collect ( resultCollector ) ; } | Adds the first result collector to the validator . |
5,475 | public static < D > RuleContext < D > collect ( ResultCollector < ? , D > ... resultCollectors ) { return new ResultCollectorContext ( ) . collect ( resultCollectors ) ; } | Adds the first result collectors to the validator . |
5,476 | private void initComponents ( ) { getRootPane ( ) . putClientProperty ( "apple.awt.draggableWindowBackground" , Boolean . FALSE ) ; toolTip = new JToolTip ( ) ; toolTip . addMouseListener ( new TransparencyAdapter ( ) ) ; owner . addComponentListener ( locationAdapter ) ; owner . addAncestorListener ( locationAdapter )... | Initializes the components of the tooltip window . |
5,477 | public void setText ( String text ) { if ( ! ValueUtils . areEqual ( text , toolTip . getTipText ( ) ) ) { boolean wasVisible = isVisible ( ) ; if ( wasVisible ) { setVisible ( false ) ; } toolTip . setTipText ( text ) ; if ( wasVisible ) { setVisible ( true ) ; } } } | Sets the text to be displayed as a tooltip . |
5,478 | private void followOwner ( ) { if ( owner . isVisible ( ) && owner . isShowing ( ) ) { try { Point screenLocation = owner . getLocationOnScreen ( ) ; Point relativeSlaveLocation = anchorLink . getRelativeSlaveLocation ( owner . getSize ( ) , TransparentToolTipDialog . this . getSize ( ) ) ; setLocation ( screenLocation... | Updates the location of the window based on the location of the owner component . |
5,479 | public void addDataProvider ( K key , DataProvider < DPO > dataProvider ) { dataProviders . put ( key , dataProvider ) ; } | Adds the specified data provider with the specified key . |
5,480 | private void updateDecoration ( ) { if ( lastResult != null ) { if ( lastResult ) { setIcon ( validIcon ) ; setToolTipText ( validText ) ; } else { setIcon ( invalidIcon ) ; setToolTipText ( invalidText ) ; } } } | Updates the icon and tooltip text according to the last result processed by this result handler . |
5,481 | private static KeyStroke [ ] toKeyStrokes ( int ... keyCodes ) { KeyStroke [ ] keyStrokes = null ; if ( keyCodes != null ) { keyStrokes = new KeyStroke [ keyCodes . length ] ; for ( int i = 0 ; i < keyCodes . length ; i ++ ) { keyStrokes [ i ] = KeyStroke . getKeyStroke ( keyCodes [ i ] , 0 ) ; } } return keyStrokes ; ... | Converts the specified array of key codes in an array of key strokes . |
5,482 | private void initValidation ( ) { SimpleProperty < Result > resultCollector1 = new SimpleProperty < Result > ( ) ; createValidator ( textField1 , new StickerFeedback ( textField1 ) , resultCollector1 ) ; SimpleProperty < Result > resultCollector2 = new SimpleProperty < Result > ( ) ; createValidator ( textField2 , new ... | Initializes the input validation and conditional logic . |
5,483 | public Object add ( String key , Object value ) { if ( ! this . containsKey ( key ) ) { this . put ( key , value ) ; return null ; } return this . get ( key ) ; } | This method safely add new options . If the key already exists it does not overwrite the current value . You can use put for overwritten the value . |
5,484 | protected void appendElements ( RendersnakeHtmlCanvas html , List < SubtitleItem . Inner > elements ) throws IOException { for ( SubtitleItem . Inner element : elements ) { String kanji = element . getKanji ( ) ; if ( kanji != null ) { html . spanKanji ( kanji ) ; } else { html . write ( element . getText ( ) ) ; } } } | Appends furigana over the whole word |
5,485 | private void updateValue ( ) { if ( list != null ) { int oldCount = this . count ; this . count = list . getSelectedIndices ( ) . length ; maybeNotifyListeners ( oldCount , count ) ; } } | Updates the value of this property based on the list s selection model and notify the listeners . |
5,486 | public String parse ( String query ) throws Exception { if ( StringUtils . isEmpty ( query ) ) { return "" ; } Map < String , Object > jsonFacetMap = new LinkedHashMap < > ( ) ; String [ ] split = query . split ( FACET_SEPARATOR ) ; for ( String facet : split ) { if ( facet . contains ( NESTED_FACET_SEPARATOR ) ) { par... | This method accepts a simple facet declaration format and converts it into a rich JSON query . |
5,487 | protected void doNotifyListenersOfAddedValues ( Set < R > newItems ) { List < SetValueChangeListener < R > > listenersCopy = new ArrayList < SetValueChangeListener < R > > ( listeners ) ; Set < R > unmodifiable = Collections . unmodifiableSet ( newItems ) ; for ( SetValueChangeListener < R > listener : listenersCopy ) ... | Notifies the change listeners that items have been added . |
5,488 | protected void doNotifyListenersOfRemovedValues ( Set < R > oldItems ) { List < SetValueChangeListener < R > > listenersCopy = new ArrayList < SetValueChangeListener < R > > ( listeners ) ; Set < R > unmodifiable = Collections . unmodifiableSet ( oldItems ) ; for ( SetValueChangeListener < R > listener : listenersCopy ... | Notifies the change listeners that items have been removed . |
5,489 | public static < MO > SingleMasterBinding < MO , MO > read ( ReadableProperty < MO > master ) { return new SingleMasterBinding < MO , MO > ( master , null ) ; } | Specifies the master property that is part of the binding . |
5,490 | public static < T > boolean areEqual ( T value1 , T value2 , Comparator < T > comparator ) { return ( ( value1 == null ) && ( value2 == null ) ) || ( ( value1 != null ) && ( value2 != null ) && ( comparator . compare ( value1 , value2 ) == 0 ) ) ; } | Compares the two given values by taking null values into account and the specified comparator . |
5,491 | public void setIllegalCharacters ( final String illegalCharacters ) { this . illegalCharacters = illegalCharacters ; delegatePattern = new NegateBooleanRule < String > ( new StringRegexRule ( "[" + Pattern . quote ( illegalCharacters ) + "]" ) ) ; final int illegalCharacterCount = illegalCharacters . length ( ) ; final... | Sets the list of illegal characters in a string . |
5,492 | private Component createTabContent ( CompositeReadableProperty < Boolean > tabResultsProperty ) { JPanel panel = new JPanel ( ) ; panel . setLayout ( new MigLayout ( "fill, wrap 2" , "[][grow, fill]" ) ) ; for ( int i = 0 ; i < 2 ; i ++ ) { panel . add ( new JLabel ( "Field " + ( i + 1 ) + ":" ) ) ; JTextField field = ... | Creates some content to put in a tab in the tabbed pane . |
5,493 | private ReadableProperty < Boolean > installFieldValidation ( JTextField field ) { SimpleBooleanProperty fieldResult = new SimpleBooleanProperty ( ) ; on ( new JTextFieldDocumentChangedTrigger ( field ) ) . read ( new JTextFieldTextProvider ( field ) ) . check ( new StringNotEmptyRule ( ) ) . handleWith ( new IconBoole... | Sets up a validator for the specified field . |
5,494 | public String getTokenName ( final int pTokenId ) { final List < String > searchClasses = Arrays . asList ( "com.puppycrawl.tools.checkstyle.utils.TokenUtil" , "com.puppycrawl.tools.checkstyle.utils.TokenUtils" , TokenTypes . class . getName ( ) , "com.puppycrawl.tools.checkstyle.Utils" ) ; Method getTokenName = null ;... | Returns the name of a token for a given ID . |
5,495 | private static int checkResult ( int result ) { if ( exceptionsEnabled && result != nvgraphStatus . NVGRAPH_STATUS_SUCCESS ) { throw new CudaException ( nvgraphStatus . stringFor ( result ) ) ; } return result ; } | If the given result is not nvgraphStatus . NVGRAPH_STATUS_SUCCESS and exceptions have been enabled this method will throw a CudaException with an error message that corresponds to the given result code . Otherwise the given result is simply returned . |
5,496 | public static int nvgraphSetGraphStructure ( nvgraphHandle handle , nvgraphGraphDescr descrG , Object topologyData , int TType ) { return checkResult ( nvgraphSetGraphStructureNative ( handle , descrG , topologyData , TType ) ) ; } | Set size topology data in the graph descriptor |
5,497 | public static int nvgraphGetGraphStructure ( nvgraphHandle handle , nvgraphGraphDescr descrG , Object topologyData , int [ ] TType ) { return checkResult ( nvgraphGetGraphStructureNative ( handle , descrG , topologyData , TType ) ) ; } | Query size and topology information from the graph descriptor |
5,498 | public static int nvgraphConvertTopology ( nvgraphHandle handle , int srcTType , Object srcTopology , Pointer srcEdgeData , Pointer dataType , int dstTType , Object dstTopology , Pointer dstEdgeData ) { return checkResult ( nvgraphConvertTopologyNative ( handle , srcTType , srcTopology , srcEdgeData , dataType , dstTTy... | Convert the edge data to another topology |
5,499 | public static int nvgraphConvertGraph ( nvgraphHandle handle , nvgraphGraphDescr srcDescrG , nvgraphGraphDescr dstDescrG , int dstTType ) { return checkResult ( nvgraphConvertGraphNative ( handle , srcDescrG , dstDescrG , dstTType ) ) ; } | Convert graph to another structure |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.