idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
35,500 | private static void serializeBoolean ( final Boolean val , final ContentHandler handler ) throws SAXException { String tag = "false" ; if ( val . booleanValue ( ) ) { tag = "true" ; } final AttributesImpl attributes = new AttributesImpl ( ) ; handler . startElement ( null , tag , tag , attributes ) ; handler . endEleme... | Serialize a Boolean as a true or false element . | 84 | 11 |
35,501 | private static void serializeElement ( final String tag , final String content , final ContentHandler handler ) throws SAXException { final AttributesImpl attributes = new AttributesImpl ( ) ; handler . startElement ( null , tag , tag , attributes ) ; handler . characters ( content . toCharArray ( ) , 0 , content . len... | Creates an element with the specified tag name and character content . | 84 | 13 |
35,502 | private static void serializeInteger ( final Number integer , final ContentHandler handler ) throws SAXException { serializeElement ( "integer" , String . valueOf ( integer . longValue ( ) ) , handler ) ; } | Serialize a Number as an integer element . | 46 | 9 |
35,503 | private static void serializeList ( final List list , final ContentHandler handler ) throws SAXException { final AttributesImpl attributes = new AttributesImpl ( ) ; handler . startElement ( null , "array" , "array" , attributes ) ; for ( final Object aList : list ) { serializeObject ( aList , handler ) ; } handler . e... | Serialize a list as an array element . | 88 | 9 |
35,504 | private static void serializeMap ( final Map map , final ContentHandler handler ) throws SAXException { final AttributesImpl attributes = new AttributesImpl ( ) ; handler . startElement ( null , "dict" , "dict" , attributes ) ; if ( map . size ( ) > 0 ) { // // need to output with sorted keys to maintain // reproducabi... | Serialize a map as a dict element . | 214 | 9 |
35,505 | private static void serializeObject ( final Object obj , final ContentHandler handler ) throws SAXException { if ( obj instanceof Map ) { serializeMap ( ( Map ) obj , handler ) ; } else if ( obj instanceof List ) { serializeList ( ( List ) obj , handler ) ; } else if ( obj instanceof Number ) { if ( obj instanceof Doub... | Serialize an object using the best available element . | 157 | 10 |
35,506 | private static void serializeReal ( final Number real , final ContentHandler handler ) throws SAXException { serializeElement ( "real" , String . valueOf ( real . doubleValue ( ) ) , handler ) ; } | Serialize a Number as a real element . | 46 | 9 |
35,507 | protected boolean canParse ( final File sourceFile ) { final String sourceName = sourceFile . toString ( ) ; final int lastPeriod = sourceName . lastIndexOf ( ' ' ) ; if ( lastPeriod >= 0 && lastPeriod == sourceName . length ( ) - 4 ) { final String ext = sourceName . substring ( lastPeriod ) . toUpperCase ( ) ; if ( e... | Checks file name to see if parse should be attempted | 127 | 11 |
35,508 | public final DependencyInfo parseIncludes ( final CCTask task , final File source , final File [ ] includePath , final File [ ] sysIncludePath , final File [ ] envIncludePath , final File baseDir , final String includePathIdentifier ) { // // if any of the include files can not be identified // change the sourceLastMod... | Returns dependency info for the specified source file | 662 | 8 |
35,509 | private static void addAttribute ( final AttributesImpl attributes , final String attrName , final String attrValue ) { if ( attrName == null ) { throw new IllegalArgumentException ( "attrName" ) ; } if ( attrValue != null ) { attributes . addAttribute ( null , attrName , attrName , "#PCDATA" , attrValue ) ; } } | Adds an non - namespace - qualified attribute to attribute list . | 83 | 12 |
35,510 | private String getAdditionalDependencies ( final TargetInfo linkTarget , final List < DependencyDef > projectDependencies , final Map < String , TargetInfo > targets , final String basePath ) { String dependencies = null ; final File [ ] linkSources = linkTarget . getAllSources ( ) ; final StringBuffer buf = new String... | Get value of AdditionalDependencies property . | 442 | 9 |
35,511 | private String getAdditionalIncludeDirectories ( final String baseDir , final CommandLineCompilerConfiguration compilerConfig ) { final File [ ] includePath = compilerConfig . getIncludePath ( ) ; final StringBuffer includeDirs = new StringBuffer ( ) ; // Darren Sargent Feb 10 2010 -- reverted to older code to ensure s... | Get value of AdditionalIncludeDirectories property . | 189 | 10 |
35,512 | private String getBasicRuntimeChecks ( final CommandLineCompilerConfiguration compilerConfig ) { String checks = "0" ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/RTCs" . equals ( arg ) ) { checks = "1" ; } if ( "/RTCu" . equals ( arg ) ) { checks = "2" ; } if... | Get value of BasicRuntimeChecks property . | 128 | 9 |
35,513 | private String getCharacterSet ( final CommandLineCompilerConfiguration compilerConfig ) { final String [ ] args = compilerConfig . getPreArguments ( ) ; String charset = "0" ; for ( final String arg : args ) { if ( "/D_UNICODE" . equals ( arg ) || "/DUNICODE" . equals ( arg ) ) { charset = "1" ; } if ( "/D_MBCS" . equ... | Get character set for Windows API . | 115 | 7 |
35,514 | private String getConfigurationType ( final CCTask task ) { final String outputType = task . getOuttype ( ) ; String targtype = "2" ; // Win32 (x86) Dynamic-Link Library"; if ( "executable" . equals ( outputType ) ) { targtype = "1" ; // "Win32 (x86) Console Application"; } else if ( "static" . equals ( outputType ) ) ... | Gets the configuration type . | 117 | 6 |
35,515 | private String getDebugInformationFormat ( final CommandLineCompilerConfiguration compilerConfig ) { String format = "0" ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/Z7" . equals ( arg ) ) { format = "1" ; } if ( "/Zd" . equals ( arg ) ) { format = "2" ; } if... | Get value of DebugInformationFormat property . | 133 | 8 |
35,516 | private String getDetect64BitPortabilityProblems ( final CommandLineCompilerConfiguration compilerConfig ) { String warn64 = null ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/Wp64" . equals ( arg ) ) { warn64 = this . trueLiteral ; } } return warn64 ; } | Get value of Detect64BitPortabilityProblems property . | 83 | 12 |
35,517 | private String getLinkIncremental ( final CommandLineLinkerConfiguration linkerConfig ) { String incremental = "0" ; final String [ ] args = linkerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/INCREMENTAL:NO" . equals ( arg ) ) { incremental = "1" ; } if ( "/INCREMENTAL:YES" . equals ( arg ) )... | Get value of LinkIncremental property . | 104 | 8 |
35,518 | private String getOptimization ( final CommandLineCompilerConfiguration compilerConfig ) { final String [ ] args = compilerConfig . getPreArguments ( ) ; String opt = "0" ; for ( final String arg : args ) { if ( "/Od" . equals ( arg ) ) { opt = "0" ; } if ( "/O1" . equals ( arg ) ) { opt = "1" ; } if ( "/O2" . equals (... | Get value of Optimization property . | 133 | 7 |
35,519 | private String getPrecompiledHeaderFile ( final CommandLineCompilerConfiguration compilerConfig ) { String pch = null ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( arg . startsWith ( "/Fp" ) ) { pch = arg . substring ( 3 ) ; } } return pch ; } | Get value of PrecompiledHeaderFile property . | 82 | 10 |
35,520 | private String getPreprocessorDefinitions ( final CommandLineCompilerConfiguration compilerConfig , final boolean isDebug ) { final StringBuffer defines = new StringBuffer ( ) ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( arg . startsWith ( "/D" ) ) { String mac... | Get value of PreprocessorDefinitions property . | 185 | 9 |
35,521 | private String getRuntimeLibrary ( final CommandLineCompilerConfiguration compilerConfig , final boolean isDebug ) { String rtl = null ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( arg . startsWith ( "/MT" ) ) { if ( isDebug ) { rtl = "1" ; } else { rtl = "0" ; ... | Get value of RuntimeLibrary property . | 135 | 7 |
35,522 | private String getSubsystem ( final CommandLineLinkerConfiguration linkerConfig ) { String subsystem = "0" ; final String [ ] args = linkerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/SUBSYSTEM:CONSOLE" . equals ( arg ) ) { subsystem = "1" ; } if ( "/SUBSYSTEM:WINDOWS" . equals ( arg ) ) { su... | Get value of Subsystem property . | 130 | 7 |
35,523 | private String getTargetMachine ( final CommandLineLinkerConfiguration linkerConfig ) { String subsystem = "0" ; final String [ ] args = linkerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/MACHINE:X86" . equals ( arg ) ) { subsystem = "1" ; } } return subsystem ; } | Get value of TargetMachine property . | 79 | 7 |
35,524 | private String getUsePrecompiledHeader ( final CommandLineCompilerConfiguration compilerConfig ) { String usePCH = "0" ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/Yc" . equals ( arg ) ) { usePCH = "1" ; } if ( "/Yu" . equals ( arg ) ) { usePCH = "2" ; } } re... | Get value of UsePrecompiledHeader property . | 103 | 10 |
35,525 | private String getWarningLevel ( final CommandLineCompilerConfiguration compilerConfig ) { String warn = null ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( "/W0" . equals ( arg ) ) { warn = "0" ; } if ( "/W1" . equals ( arg ) ) { warn = "1" ; } if ( "/W2" . equa... | Get value of WarningLevel property . | 167 | 7 |
35,526 | private boolean isGroupMember ( final String filter , final File candidate ) { final String fileName = candidate . getName ( ) ; final int lastDot = fileName . lastIndexOf ( ' ' ) ; if ( lastDot >= 0 && lastDot < fileName . length ( ) - 1 ) { final String extension = ";" + fileName . substring ( lastDot + 1 ) . toLower... | Returns true if the file has an extension that appears in the group filter . | 122 | 15 |
35,527 | private void writeCompilerElement ( final ContentHandler content , final boolean isDebug , final String basePath , final CommandLineCompilerConfiguration compilerConfig ) throws SAXException { final AttributesImpl attributes = new AttributesImpl ( ) ; addAttribute ( attributes , "Name" , "VCCLCompilerTool" ) ; String o... | write the Compiler element . | 435 | 6 |
35,528 | private void writeConfigurationStartTag ( final ContentHandler content , final boolean isDebug , final CCTask task , final CommandLineCompilerConfiguration compilerConfig ) throws SAXException { final AttributesImpl attributes = new AttributesImpl ( ) ; if ( isDebug ) { addAttribute ( attributes , "Name" , "Debug|Win32... | Write the start tag of the Configuration element . | 210 | 9 |
35,529 | private void writeFilteredSources ( final String name , final String filter , final String basePath , final File [ ] sortedSources , final ContentHandler content ) throws SAXException { final AttributesImpl filterAttrs = new AttributesImpl ( ) ; filterAttrs . addAttribute ( null , "Name" , "Name" , "#PCDATA" , name ) ;... | Writes a cluster of source files to the project . | 275 | 11 |
35,530 | private void writeLinkerElement ( final ContentHandler content , final boolean isDebug , final List < DependencyDef > dependencies , final String basePath , final TargetInfo linkTarget , final Map < String , TargetInfo > targets ) throws SAXException { final AttributesImpl attributes = new AttributesImpl ( ) ; addAttri... | Write Tool element for linker . | 324 | 7 |
35,531 | @ Override protected String getIncludeDirSwitch ( final String source ) { final StringBuffer buf = new StringBuffer ( "-I" ) ; quoteFile ( buf , source ) ; return buf . toString ( ) ; } | Returns command line option to specify include directory | 47 | 8 |
35,532 | public static JavaClass getBcelClass ( final String filename ) throws IOException { final ClassParser parser = new ClassParser ( filename ) ; return parser . parse ( ) ; } | Returns the Bcel Class corresponding to the given class filename | 37 | 11 |
35,533 | public static String replace ( final CharSequence target , final CharSequence replacement , final String string ) { return Pattern . compile ( quote ( target . toString ( ) ) /* * , Pattern.LITERAL jdk 1.4 */ ) . matcher ( string ) . replaceAll ( /* Matcher. jdk 1.4 */ quoteReplacement ( replacement . toString ( ) ) ) ... | Replaces target with replacement in string . For jdk 1 . 4 compatiblity . | 85 | 18 |
35,534 | @ Override protected Parser createParser ( final File source ) { if ( source != null ) { final String sourceName = source . getName ( ) ; final int lastDot = sourceName . lastIndexOf ( ' ' ) ; if ( lastDot >= 0 && lastDot + 1 < sourceName . length ( ) ) { final char afterDot = sourceName . charAt ( lastDot + 1 ) ; if (... | Create parser to determine dependencies . | 127 | 6 |
35,535 | private static String arraysToString ( final Object [ ] a ) { if ( a == null ) { return "null" ; } final int iMax = a . length - 1 ; if ( iMax == - 1 ) { return "[]" ; } final StringBuilder b = new StringBuilder ( ) ; b . append ( ' ' ) ; for ( int i = 0 ; ; i ++ ) { b . append ( String . valueOf ( a [ i ] ) ) ; if ( i... | JDK 1 . 4 compatibility | 132 | 6 |
35,536 | @ Override protected String quoteFilename ( final StringBuffer buf , final String filename ) { buf . setLength ( 0 ) ; BorlandProcessor . quoteFile ( buf , filename ) ; return buf . toString ( ) ; } | Encloses problematic file names within quotes . | 48 | 9 |
35,537 | public static NarProperties getInstance ( final MavenProject project ) throws MojoFailureException { NarProperties instance = instances . get ( project ) ; if ( instance == null ) { if ( project == null ) { instance = new NarProperties ( project , null , null ) ; } else { String customPropertyLocation = project . getPr... | Retrieve the NarProperties | 249 | 6 |
35,538 | public void setClassname ( final String className ) { Object proc = null ; try { final Class < ? > implClass = ProjectDef . class . getClassLoader ( ) . loadClass ( className ) ; try { final Method getInstance = implClass . getMethod ( "getInstance" ) ; proc = getInstance . invoke ( null ) ; } catch ( final Exception e... | Class name for a user - supplied project writer . Use the type attribute to specify built - in project writer implementations . | 122 | 23 |
35,539 | public void setOutfile ( final File outfile ) { // // if file name was empty, skip link step // if ( outfile == null || outfile . toString ( ) . length ( ) > 0 ) { this . outFile = outfile ; } } | Sets the name for the generated project file . | 56 | 10 |
35,540 | private File [ ] getSources ( final List < File > sourceList ) { final File [ ] sortedSources = new File [ sourceList . size ( ) ] ; sourceList . toArray ( sortedSources ) ; Arrays . sort ( sortedSources , new Comparator < File > ( ) { @ Override public int compare ( final File o1 , final File o2 ) { return o1 . getNam... | Get alphabetized array of source files . | 109 | 8 |
35,541 | private void writeLinkOptions ( final Writer writer , final boolean isDebug , final List < DependencyDef > dependencies , final String basePath , final TargetInfo linkTarget , final Map < String , TargetInfo > targets ) throws IOException { final StringBuffer baseOptions = new StringBuffer ( 100 ) ; final StringBuffer ... | Writes link options . | 689 | 5 |
35,542 | private void writeMessage ( final Writer writer , final String projectName , final String targtype ) throws IOException { writer . write ( "!MESSAGE This is not a valid makefile. " ) ; writer . write ( "To build this project using NMAKE,\r\n" ) ; writer . write ( "!MESSAGE use the Export Makefile command and run\r\n" )... | Writes This is not a makefile warning . | 493 | 10 |
35,543 | private void writeSource ( final Writer writer , final String basePath , final File groupMember ) throws IOException { writer . write ( "# Begin Source File\r\n\r\nSOURCE=" ) ; String relativePath = CUtil . getRelativePath ( basePath , groupMember ) ; // // if relative path is just a name (hello.c) then // make it .\he... | Writes the entry for one source file in the project . | 170 | 12 |
35,544 | private static void encodeVersion ( final StringBuffer buf , final short [ ] version ) { for ( int i = 0 ; i < 3 ; i ++ ) { buf . append ( Short . toString ( version [ i ] ) ) ; buf . append ( ' ' ) ; } buf . append ( Short . toString ( version [ 3 ] ) ) ; } | Converts parsed version information into a string representation . | 75 | 10 |
35,545 | private static boolean hasSameContent ( final InputStream stream1 , final InputStream stream2 ) throws IOException { int byte1 = - 1 ; int byte2 = - 1 ; do { byte1 = stream1 . read ( ) ; byte2 = stream2 . read ( ) ; } while ( byte1 == byte2 && byte1 != - 1 ) ; return byte1 == byte2 ; } | Compare two input streams for duplicate content | 83 | 7 |
35,546 | public static short [ ] parseVersion ( final String version ) { final short [ ] values = new short [ ] { 0 , 0 , 0 , 0 } ; if ( version != null ) { final StringBuffer buf = new StringBuffer ( version ) ; int start = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { int end = version . indexOf ( ' ' , start ) ; if ( end <= 0 ) { e... | Parse version string into array of four short values . | 226 | 11 |
35,547 | public void setDir ( final File dir ) throws BuildException { if ( this . localSet == null ) { this . localSet = new ConditionalFileSet ( ) ; this . owner . appendExceptFileSet ( this . localSet ) ; } this . localSet . setDir ( dir ) ; } | Sets the base - directory | 64 | 6 |
35,548 | public void setIncludes ( final String includes ) { if ( this . localSet == null ) { this . localSet = new ConditionalFileSet ( ) ; this . owner . appendExceptFileSet ( this . localSet ) ; } this . localSet . setIncludes ( includes ) ; } | Comma or space separated list of file patterns that should not be compiled using precompiled headers . | 61 | 20 |
35,549 | public void setLocal ( final File value ) { if ( value == null ) { throw new NullPointerException ( "value" ) ; } if ( value . exists ( ) && ! value . isDirectory ( ) ) { throw new BuildException ( "local should be a directory" ) ; } this . localName = value ; try { this . canonicalPath = this . localName . getCanonica... | Sets local directory for base of mapping . | 108 | 9 |
35,550 | public String toRemote ( final String host , final File localFile ) { if ( this . remoteName != null && ( this . hosts == null || this . hosts . contains ( host ) ) ) { try { final String canonical = localFile . getCanonicalPath ( ) ; if ( canonical . startsWith ( this . canonicalPath ) && isActive ( ) ) { return this ... | Converts the local file name to the remote name for the same file . | 134 | 15 |
35,551 | public static boolean hasQObject ( final Reader reader ) throws IOException { final MetaObjectParser parser = new MetaObjectParser ( ) ; parser . parse ( reader ) ; return parser . hasQObject ; } | Determines if source file contains Q_OBJECT . | 43 | 12 |
35,552 | protected org . eclipse . aether . graph . DependencyNode getVerboseDependencyTree ( ) { // Create CollectRequest object that will be submitted to collect the dependencies CollectRequest collectReq = new CollectRequest ( ) ; // Get artifact this Maven project is attempting to build Artifact art = getMavenProject ( ) . ... | Gets the project s full dependency tree prior to dependency mediation . This is required if we want to know where to push libraries in the linker line . | 401 | 31 |
35,553 | protected DependencyNode getRootNodeDependecyTree ( ) throws MojoExecutionException { try { ArtifactFilter artifactFilter = null ; // works for only maven 3. Use of dependency graph component not handled for maven 2 // as current version of NAR already requires Maven 3.x rootNode = dependencyGraphBuilder . buildDepende... | Get root node of the current Maven project Dependency tree generated by maven . shared dependency graph builder . | 124 | 22 |
35,554 | protected static String getIdentifier ( final String [ ] command , final String fallback ) { String identifier = fallback ; try { final String [ ] cmdout = CaptureStreamHandler . run ( command ) ; if ( cmdout . length > 0 ) { identifier = cmdout [ 0 ] ; } } catch ( final Throwable ex ) { identifier = fallback + ":" + e... | Determines the identification of a command line processor by capture the first line of its output for a specific command . | 91 | 23 |
35,555 | private static String registryGet32StringValue ( com . sun . jna . platform . win32 . WinReg . HKEY root , String key , String value ) throws com . sun . jna . platform . win32 . Win32Exception { com . sun . jna . platform . win32 . WinReg . HKEYByReference phkKey = new com . sun . jna . platform . win32 . WinReg . HKE... | Get a registry REG_SZ value . | 356 | 9 |
35,556 | public static UndefineArgument [ ] merge ( final UndefineArgument [ ] base , final UndefineArgument [ ] override ) { if ( base . length == 0 ) { final UndefineArgument [ ] overrideClone = override . clone ( ) ; return overrideClone ; } if ( override . length == 0 ) { final UndefineArgument [ ] baseClone = base . clone ... | This method returns an array of UndefineArgument and DefineArgument s by merging a base list with an override list . | 317 | 27 |
35,557 | public static String [ ] run ( final String [ ] cmdline ) { final CaptureStreamHandler handler = execute ( cmdline ) ; return handler . getOutput ( ) != null ? handler . getOutput ( ) : new String [ 0 ] ; } | Runs an executable and captures the output in a String array | 51 | 12 |
35,558 | public void gatherOutput ( ) { try { final Copier errorCopier = new Copier ( this . processErrorStream ) ; final Copier outputCopier = new Copier ( this . processOutputStream ) ; errorCopier . start ( ) ; outputCopier . start ( ) ; errorCopier . join ( ) ; outputCopier . join ( ) ; this . stderr = new String [ errorCop... | Reads concurrently both the process standard output and standard error . The standard error is copied to the stderr string array field . The standard output is copied to the stdout string array field . Both fields are set to an empty array in case of any error . | 192 | 53 |
35,559 | public static File [ ] getEnvironmentPath ( final String toolName , final char switchChar , final String [ ] defaultRelativePath ) { if ( toolName == null ) { throw new NullPointerException ( "toolName" ) ; } if ( defaultRelativePath == null ) { throw new NullPointerException ( "defaultRelativePath" ) ; } String [ ] pa... | This method extracts path information from the appropriate . cfg file in the install directory . | 519 | 17 |
35,560 | @ Override public String decorateLinkerOption ( final StringBuffer buf , final String arg ) { String decoratedArg = arg ; if ( arg . length ( ) > 1 && arg . charAt ( 0 ) == ' ' ) { switch ( arg . charAt ( 1 ) ) { // // passed automatically by GCC // case ' ' : case ' ' : case ' ' : /* Darwin */ case ' ' : case ' ' : ca... | Allows drived linker to decorate linker option . Override by GppLinker to prepend a - Wl to pass option to through gcc to linker . | 199 | 36 |
35,561 | public final List /* <AttachedNarArtifact> */ getAttachedNarDependencies ( final List /* * < * NarArtifacts * > */ narArtifacts , final AOL archOsLinker , final String type ) throws MojoExecutionException , MojoFailureException { boolean noarch = false ; AOL aol = archOsLinker ; if ( aol == null ) { noarch = true ; aol... | Returns a list of all attached nar dependencies for a specific binding and noarch but not where local is specified | 327 | 21 |
35,562 | @ Override public void compile ( final CCTask task , final File outputDir , final String [ ] sourceFiles , final String [ ] args , final String [ ] endArgs , final boolean relentless , final CommandLineCompilerConfiguration config , final ProgressMonitor monitor ) { BuildException exc = null ; final String [ ] thisSour... | Compiles an . idl file into the corresponding . h and . xpt files . | 613 | 18 |
35,563 | private String getActivePlatform ( final CCTask task ) { final String osName = System . getProperty ( "os.name" ) . toLowerCase ( Locale . US ) ; if ( osName . contains ( "windows" ) ) { return "win32" ; } return "linux" ; } | Gets active platform . | 66 | 5 |
35,564 | private String getBuildType ( final CCTask task ) { final String outType = task . getOuttype ( ) ; if ( "executable" . equals ( outType ) ) { return "exeproject" ; } else if ( "static" . equals ( outType ) ) { return "libraryproject" ; } return "dllproject" ; } | Gets build type from link target . | 77 | 8 |
35,565 | private void writeCompileOptions ( final String baseDir , final PropertyWriter writer , final CommandLineCompilerConfiguration compilerConfig ) throws SAXException { boolean isBcc = false ; boolean isUnix = true ; String compileID = "linux.Debug_Build.gnuc++.g++compile" ; if ( compilerConfig . getCompiler ( ) instanceo... | Writes elements corresponding to compilation options . | 603 | 8 |
35,566 | private void writeIlinkArgs ( final PropertyWriter writer , final String linkID , final String [ ] args ) throws SAXException { for ( final String arg : args ) { if ( arg . charAt ( 0 ) == ' ' || arg . charAt ( 0 ) == ' ' ) { final int equalsPos = arg . indexOf ( ' ' ) ; if ( equalsPos > 0 ) { final String option = "op... | Writes ilink32 linker options to project file . | 183 | 12 |
35,567 | private void writeLdArgs ( final PropertyWriter writer , final String linkID , final String [ ] preArgs ) throws SAXException { int objnameIndex = 1 ; int libnameIndex = 1 ; int libpathIndex = 1 ; for ( final String preArg : preArgs ) { if ( preArg . startsWith ( "-o" ) ) { writer . write ( linkID , "option.o.arg." + o... | Writes ld linker options to project file . | 327 | 11 |
35,568 | private void writeLinkOptions ( final String baseDir , final PropertyWriter writer , final TargetInfo linkTarget ) throws SAXException { if ( linkTarget != null ) { final ProcessorConfiguration config = linkTarget . getConfiguration ( ) ; if ( config instanceof CommandLineLinkerConfiguration ) { final CommandLineLinker... | Writes elements corresponding to link options . | 377 | 8 |
35,569 | @ Override protected final void addImpliedArgs ( final Vector < String > args , final boolean debug , final boolean multithreaded , final boolean exceptions , final LinkType linkType , final Boolean rtti , final OptimizationEnum optimization ) { args . addElement ( "/c" ) ; if ( exceptions ) { args . addElement ( "/xs"... | Add implied arguments . | 230 | 4 |
35,570 | @ Override protected final void addWarningSwitch ( final Vector < String > args , final int level ) { OpenWatcomProcessor . addWarningSwitch ( args , level ) ; } | Add warning switch . | 39 | 4 |
35,571 | @ Override protected final void getDefineSwitch ( final StringBuffer buffer , final String define , final String value ) { OpenWatcomProcessor . getDefineSwitch ( buffer , define , value ) ; } | Get define switch . | 45 | 4 |
35,572 | @ Override protected final void getUndefineSwitch ( final StringBuffer buffer , final String define ) { OpenWatcomProcessor . getUndefineSwitch ( buffer , define ) ; } | Get undefine switch . | 41 | 6 |
35,573 | public static Map < CompilerConfiguration , Vector < TargetInfo > > getTargetsToBuildByConfiguration ( final Map < String , TargetInfo > targets ) { final Map < CompilerConfiguration , Vector < TargetInfo > > targetsByConfig = new HashMap <> ( ) ; for ( final TargetInfo target : targets . values ( ) ) { if ( target . g... | Builds a Hashtable to targets needing to be rebuilt keyed by compiler configuration | 212 | 16 |
35,574 | public void addConfiguredCompiler ( final CompilerDef compiler ) { if ( compiler == null ) { throw new NullPointerException ( "compiler" ) ; } compiler . setProject ( getProject ( ) ) ; this . _compilers . addElement ( compiler ) ; } | Adds a compiler definition or reference . | 60 | 7 |
35,575 | public void addConfiguredLinker ( final LinkerDef linker ) { if ( linker == null ) { throw new NullPointerException ( "linker" ) ; } linker . setProject ( getProject ( ) ) ; this . _linkers . addElement ( linker ) ; } | Adds a linker definition . The first linker that is not disqualified by its if and unless attributes will perform the link . If no child linker element is active the linker implied by the cc elements name or classname attribute will be used . | 64 | 50 |
35,576 | protected int checkForChangedIncludeFiles ( final Map < String , TargetInfo > targets ) { int potentialTargets = 0 ; int definiteTargets = 0 ; Iterator < TargetInfo > targetEnum = targets . values ( ) . iterator ( ) ; while ( targetEnum . hasNext ( ) ) { final TargetInfo target = targetEnum . next ( ) ; if ( ! target .... | Checks all targets that are not forced to be rebuilt or are missing object files to be checked for modified include files | 479 | 23 |
35,577 | public void setName ( final CompilerEnum name ) { this . compilerDef . setName ( name ) ; final Processor compiler = this . compilerDef . getProcessor ( ) ; final Linker linker = compiler . getLinker ( this . linkType ) ; this . linkerDef . setProcessor ( linker ) ; } | Sets type of the default compiler and linker . | 72 | 11 |
35,578 | public void setNewenvironment ( final boolean newenv ) { this . compilerDef . setNewenvironment ( newenv ) ; for ( int i = 0 ; i < this . _compilers . size ( ) ; i ++ ) { final CompilerDef currentCompilerDef = this . _compilers . elementAt ( i ) ; currentCompilerDef . setNewenvironment ( newenv ) ; } this . linkerDef .... | Do not propagate old environment when new environment variables are specified . | 98 | 12 |
35,579 | public void setOutfile ( final File outfile ) { // // if file name was empty, skip link step // if ( outfile == null || outfile . toString ( ) . length ( ) > 0 ) { this . _outfile = outfile ; } } | Sets the output file name . If not specified the task will only compile files and not attempt to link . If an extension is not specified the task may use a system appropriate extension and prefix for example outfile = example may result in libexample . so being created . | 57 | 54 |
35,580 | @ Override public void setProject ( final Project project ) { super . setProject ( project ) ; this . compilerDef . setProject ( project ) ; this . linkerDef . setProject ( project ) ; } | Sets the project . | 45 | 5 |
35,581 | public VersionInfo merge ( ) { if ( isReference ( ) ) { final VersionInfo refVersion = ( VersionInfo ) getCheckedRef ( VersionInfo . class , "VersionInfo" ) ; return refVersion . merge ( ) ; } Reference currentRef = this . getExtends ( ) ; if ( currentRef == null ) { return this ; } final Vector < VersionInfo > stack =... | Returns a VersionInfo that reflects any inherited version information . | 261 | 11 |
35,582 | public static String [ ] getOutputFileSwitch ( final String outPath ) { final StringBuffer buf = new StringBuffer ( "/fo=" ) ; if ( outPath . indexOf ( ' ' ) >= 0 ) { buf . append ( ' ' ) ; buf . append ( outPath ) ; buf . append ( ' ' ) ; } else { buf . append ( outPath ) ; } final String [ ] retval = new String [ ] {... | Builds command line options to specify the output file names . | 106 | 12 |
35,583 | @ Override public Linker getLinker ( final LinkType type ) { if ( type . isStaticLibrary ( ) ) { return OpenWatcomLibrarian . getInstance ( ) ; } if ( type . isSharedLibrary ( ) ) { return DLL_LINKER ; } return INSTANCE ; } | Get linker . | 67 | 4 |
35,584 | public DistributerMap createMap ( ) { final DistributerMap map = new DistributerMap ( ) ; map . setProject ( getProject ( ) ) ; this . maps . addElement ( map ) ; return map ; } | Local to remote filename maps . | 47 | 6 |
35,585 | public String getHosts ( ) { if ( isReference ( ) ) { final DistributerDef refDistributer = ( DistributerDef ) getCheckedRef ( DistributerDef . class , "DistributerDef" ) ; return refDistributer . getHosts ( ) ; } return this . hosts ; } | Gets hosts . | 68 | 4 |
35,586 | public DistributerProtocolEnum getProtocol ( ) { if ( isReference ( ) ) { final DistributerDef refDistributer = ( DistributerDef ) getCheckedRef ( DistributerDef . class , "DistributerDef" ) ; return refDistributer . getProtocol ( ) ; } return this . protocol ; } | Gets protocol . | 73 | 4 |
35,587 | public int getTcpcork ( ) { if ( isReference ( ) ) { final DistributerDef refDistributer = ( DistributerDef ) getCheckedRef ( DistributerDef . class , "DistributerDef" ) ; return refDistributer . getTcpcork ( ) ; } return this . tcpCork ; } | Gets tcp cork . | 74 | 6 |
35,588 | public void link ( final CCTask task , final File outputFile , final String [ ] sourceFiles , final CommandLineLinkerConfiguration config ) throws BuildException { final File parentDir = new File ( outputFile . getParent ( ) ) ; String parentPath ; try { parentPath = parentDir . getCanonicalPath ( ) ; } catch ( final I... | Performs a link using a command line linker | 303 | 10 |
35,589 | protected String prepareFilename ( final StringBuffer buf , final String outputDir , final String sourceFile ) { // FREEHEP BEGIN exit if absolute path is too long. Max length on relative // paths in windows is even shorter. if ( isWindows ( ) && sourceFile . length ( ) > this . maxPathLength ) { throw new BuildExcepti... | Processes filename into argument form | 125 | 6 |
35,590 | @ Override public final String [ ] getLibraryPatterns ( final String [ ] libnames , final LibraryTypeEnum libType ) { return OpenWatcomProcessor . getLibraryPatterns ( libnames , libType ) ; } | Get file selectors for libraries . | 50 | 7 |
35,591 | public void addConfiguredDefineset ( final DefineSet defs ) { if ( defs == null ) { throw new NullPointerException ( "defs" ) ; } if ( isReference ( ) ) { throw noChildrenAllowed ( ) ; } this . defineSets . addElement ( defs ) ; } | Adds a defineset . | 70 | 5 |
35,592 | public IncludePath createIncludePath ( ) { final Project p = getProject ( ) ; if ( p == null ) { throw new java . lang . IllegalStateException ( "project must be set" ) ; } if ( isReference ( ) ) { throw noChildrenAllowed ( ) ; } final IncludePath path = new IncludePath ( p ) ; this . includePaths . addElement ( path )... | Creates an include path . | 90 | 6 |
35,593 | public PrecompileDef createPrecompile ( ) throws BuildException { final Project p = getProject ( ) ; if ( isReference ( ) ) { throw noChildrenAllowed ( ) ; } final PrecompileDef precomp = new PrecompileDef ( ) ; precomp . setProject ( p ) ; this . precompileDefs . addElement ( precomp ) ; return precomp ; } | Specifies precompilation prototype file and exclusions . | 86 | 11 |
35,594 | public SystemIncludePath createSysIncludePath ( ) { final Project p = getProject ( ) ; if ( p == null ) { throw new java . lang . IllegalStateException ( "project must be set" ) ; } if ( isReference ( ) ) { throw noChildrenAllowed ( ) ; } final SystemIncludePath path = new SystemIncludePath ( p ) ; this . sysIncludePat... | Creates a system include path . Locations and timestamps of files located using the system include paths are not used in dependency analysis . | 99 | 27 |
35,595 | @ Override public void setClassname ( final String classname ) throws BuildException { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } super . setClassname ( classname ) ; final Processor proc = getProcessor ( ) ; if ( ! ( proc instanceof Compiler ) ) { throw new BuildException ( classname + " does not impleme... | Sets the default compiler adapter . Use the name attribute when the compiler is a supported compiler . | 85 | 19 |
35,596 | public void setName ( final CompilerEnum name ) throws BuildException { if ( isReference ( ) ) { throw tooManyAttributes ( ) ; } final Compiler compiler = name . getCompiler ( ) ; setProcessor ( compiler ) ; } | Sets compiler type . | 53 | 5 |
35,597 | public void addFileset ( final ConditionalFileSet srcSet ) throws BuildException { if ( isReference ( ) ) { throw noChildrenAllowed ( ) ; } srcSet . setProject ( getProject ( ) ) ; this . srcSets . addElement ( srcSet ) ; } | Adds a source file set . | 61 | 6 |
35,598 | public ProcessorConfiguration createConfiguration ( final CCTask task , final LinkType linkType , final ProcessorDef baseDef , final TargetDef targetPlatform , final VersionInfo versionInfo ) { if ( isReference ( ) ) { return ( ( ProcessorDef ) getCheckedRef ( ProcessorDef . class , "ProcessorDef" ) ) . createConfigura... | Creates a configuration | 143 | 4 |
35,599 | public boolean getDebug ( final ProcessorDef [ ] defaultProviders , final int index ) { if ( isReference ( ) ) { return ( ( ProcessorDef ) getCheckedRef ( ProcessorDef . class , "ProcessorDef" ) ) . getDebug ( defaultProviders , index ) ; } if ( this . debug != null ) { return this . debug . booleanValue ( ) ; } else {... | Gets boolean indicating debug build | 127 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.