Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 5.3.2.

Duplications

File Line
org/codehaus/mojo/natives/msvc/MSVC2008x86AMD64EnvFactory.java 37
org/codehaus/mojo/natives/msvc/MSVC2008x86EnvFactory.java 37
    extends AbstractMSVCEnvFactory
{
    private static final String VS90COMNTOOLS_ENV_KEY = "VS90COMNTOOLS";

    protected Map createEnvs()
        throws NativeBuildException
    {
        Map envs = new HashMap();

        File vsCommonToolDir = this.getCommonToolDirectory();

        File vsInstallDir = this.getVisualStudioInstallDirectory( vsCommonToolDir );

        if ( !vsInstallDir.isDirectory() )
        {
            throw new NativeBuildException( vsInstallDir.getPath() + " is not a directory." );
        }
        envs.put( "VSINSTALLDIR", vsInstallDir.getPath() );

        File vcInstallDir = new File( vsInstallDir.getPath() + "\\VC" );
        if ( !vcInstallDir.isDirectory() )
        {
            throw new NativeBuildException( vcInstallDir.getPath() + " is not a directory." );
        }
        envs.put( "VCINSTALLDIR", vcInstallDir.getPath() );

        File frameworkDir = new File( getSystemRoot() + "\\Microsoft.NET\\Framework" );
        envs.put( "FrameworkDir", frameworkDir.getPath() );

        File windowsSDKDir = new File( "C:\\Program Files" + "\\Microsoft SDKs\\Windows\\v6.0A" );
        String value =
            RegQuery.getValue( "REG_SZ", "HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows", "CurrentInstallFolder" );
        if ( value != null )
        {
            windowsSDKDir = new File( value );
        }

        envs.put( "WindowsSdkDir", windowsSDKDir.getPath() );

        String frameworkVersion = "v2.0.50727";
        envs.put( "FrameworkVersion", frameworkVersion );

        String framework35Version = "v3.5";
        envs.put( "Framework35Version", framework35Version );

        String devEnvDir = vsCommonToolDir + "\\..\\IDE";
        envs.put( "DevEnvDir", devEnvDir );

        // set "PATH=%WindowsSdkDir%bin;%PATH%"
        // @set PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Microsoft
        // Visual Studio 9.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio
        // 9.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v3.5;C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Program
        // Files (x86)\Microsoft Visual Studio 9.0\VC\VCPackages;%PATH%

        // setup new PATH
        String currentPathEnv = System.getProperty( "java.library.path" );

        String newPathEnv =
            devEnvDir + ";" + vcInstallDir.getPath() + "\\bin\\x86_amd64;" + vcInstallDir.getPath() + "\\bin" + ";"
File Line
org/codehaus/mojo/natives/msvc/MSVC2005x86AMD64EnvFactory.java 39
org/codehaus/mojo/natives/msvc/MSVC2005x86EnvFactory.java 39
    extends AbstractMSVC2005EnvFactory
{

    protected Map createEnvs()
        throws NativeBuildException
    {
        File vsInstallDir =
            new File( EnvUtil.getEnv( MSVS2005_INSTALL_ENV_KEY, MSVS2005_INSTALL_ENV_KEY, DEFAULT_MSVS2005_INSTALL_DIR ) );

        if ( !vsInstallDir.isDirectory() )
        {
            throw new NativeBuildException( vsInstallDir.getPath() + " is not a directory." );
        }

        Map envs = new HashMap();

        envs.put( "VSINSTALLDIR", vsInstallDir.getPath() );

        File vcInstallDir = new File( vsInstallDir.getPath() + "/VC" );
        envs.put( "VCINSTALLDIR", vcInstallDir.getPath() );

        // TODO get winhome dir
        File frameworkDir = new File( getSystemRoot() + "/Microsoft.NET/Framework" );
        envs.put( "FrameworkDir", frameworkDir.getPath() );

        String frameworkVersion = "v2.0.50727";
        envs.put( "FrameworkVersion", frameworkVersion );

        File frameworkSDKDir = new File( vsInstallDir.getPath() + "/SDK/v2.0" );
        envs.put( "FrameworkSDKDir", frameworkSDKDir.getPath() );

        File devEnvDir = new File( vsInstallDir.getPath() + "/Common7/IDE" );
        envs.put( "DevEnvDir", devEnvDir.getPath() );

        File platformSDKDir = new File( vcInstallDir.getPath() + "/PlatformSDK" );

        // setup new PATH
        String currentPath = System.getProperty( "java.library.path" );

        String newPath =
            devEnvDir.getPath() + ";" + vcInstallDir.getPath() + "\\BIN\\x86_amd64;" + vcInstallDir.getPath()
File Line
org/codehaus/mojo/natives/msvc/MSVC2005x86AMD64EnvFactory.java 79
org/codehaus/mojo/natives/msvc/MSVC2005x86EnvFactory.java 78
            devEnvDir.getPath() + ";" + vcInstallDir.getPath() + "\\BIN\\x86_amd64;" + vcInstallDir.getPath()
                + "\\BIN;" + vcInstallDir.getPath() + "\\Common7\\Tools;" + vcInstallDir.getPath()
                + "\\Common7\\Tools\\bin;" + platformSDKDir.getPath() + "\\BIN;" + frameworkSDKDir.getPath() + "\\BIN;"
                + frameworkDir.getPath() + "\\" + frameworkVersion + ";" + vcInstallDir.getPath() + "\\VCPackages;"
                + currentPath;

        envs.put( "PATH", newPath );

        // setup new INCLUDE PATH
        String currentIncludePath = EnvUtil.getEnv( "INCLUDE" );

        String newIncludePath =
            vcInstallDir.getPath() + "\\ATLMFC\\INCLUDE;" + vcInstallDir.getPath() + "\\INCLUDE;"
                + platformSDKDir.getPath() + "\\INCLUDE;" + frameworkSDKDir.getPath() + "\\INCLUDE;"
                + currentIncludePath;

        envs.put( "INCLUDE", newIncludePath );

        //
        // setup new LIB PATH
        //
        String currentLibPath = EnvUtil.getEnv( "LIB" );

        String newLibPath =
            vcInstallDir.getPath() + "\\ATLMFC\\LIB\\AMD64;" + vcInstallDir.getPath() + "\\LIB\\AMD64;"
File Line
org/codehaus/mojo/natives/msvc/MSVC2008x86AMD64EnvFactory.java 95
org/codehaus/mojo/natives/msvc/MSVC2008x86EnvFactory.java 95
            devEnvDir + ";" + vcInstallDir.getPath() + "\\bin\\x86_amd64;" + vcInstallDir.getPath() + "\\bin" + ";"
                + vsCommonToolDir + ";" + frameworkDir + "\\" + framework35Version + ";" + frameworkDir + "\\"
                + frameworkVersion + ";" + vcInstallDir.getPath() + "\\VCPackages" + ";" + windowsSDKDir.getPath()
                + "\\bin;" + currentPathEnv;

        envs.put( "PATH", newPathEnv );

        // setup new INCLUDE PATH
        // @set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Program Files
        // (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE;%INCLUDE%

        String currentIncludeEnv = EnvUtil.getEnv( "INCLUDE" );

        String newIncludeEnv =
            vcInstallDir.getPath() + "\\ATLMFC\\INCLUDE;" + vcInstallDir.getPath() + "\\INCLUDE;"
                + windowsSDKDir.getPath() + "\\include;" + currentIncludeEnv;

        envs.put( "INCLUDE", newIncludeEnv );

        //
        // setup new LIB PATH
        //
        String currentLibEnv = EnvUtil.getEnv( "LIB" );

        String newLibEnv =
            vcInstallDir.getPath() + "\\ATLMFC\\LIB\\amd64;" + vcInstallDir.getPath() + "\\LIB\\amd64;"
File Line
org/codehaus/mojo/natives/msvc/MSVC2005AMD64EnvFactory.java 39
org/codehaus/mojo/natives/msvc/MSVC2005x86AMD64EnvFactory.java 39
org/codehaus/mojo/natives/msvc/MSVC2005x86EnvFactory.java 39
    extends AbstractMSVC2005EnvFactory
{

    protected Map createEnvs()
        throws NativeBuildException
    {
        File vsInstallDir =
            new File( EnvUtil.getEnv( MSVS2005_INSTALL_ENV_KEY, MSVS2005_INSTALL_ENV_KEY, DEFAULT_MSVS2005_INSTALL_DIR ) );

        if ( !vsInstallDir.isDirectory() )
        {
            throw new NativeBuildException( vsInstallDir.getPath() + " is not a directory." );
        }

        Map envs = new HashMap();

        envs.put( "VSINSTALLDIR", vsInstallDir.getPath() );

        File vcInstallDir = new File( vsInstallDir.getPath() + "/VC" );
        envs.put( "VCINSTALLDIR", vcInstallDir.getPath() );

        // TODO get winhome dir
        File frameworkDir = new File( getSystemRoot() + "/Microsoft.NET/Framework64" );