Changeset 6951 in josm for trunk/src


Ignore:
Timestamp:
2014-03-31T15:03:38+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #9879 - make sure to not mention Oracle for OpenJDK-based JVMs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r6943 r6951  
    4545            String os = getOSDescription();
    4646            if (java != null && java.startsWith("1.6") && os != null && (
    47                     os.startsWith("Linux Debian GNU/Linux 7") || 
     47                    os.startsWith("Linux Debian GNU/Linux 7") ||
    4848                    os.startsWith("Linux Ubuntu 12") || os.startsWith("Linux Ubuntu 13") || os.startsWith("Linux Ubuntu 14"))) {
    4949                askUpdateJava(java, "apt://openjdk-7-jre");
     
    134134
    135135    /**
     136     * Determines if the JVM is OpenJDK-based.
     137     * @return {@code true} if {@code java.home} contains "openjdk", {@code false} otherwise
     138     * @since 6951
     139     */
     140    public static boolean isOpenJDK() {
     141        String javaHome = System.getProperty("java.home");
     142        return javaHome != null && javaHome.contains("openjdk");
     143    }
     144
     145    /**
    136146     * Get the package name including detailed version.
    137147     * @param packageName The package name
     
    191201     */
    192202    public String getWebStartPackageDetails() {
    193         if (isDebianOrUbuntu()) {
    194             String javaHome = System.getProperty("java.home");
    195             if (javaHome != null && javaHome.contains("openjdk")) {
    196                 return getPackageDetails("icedtea-netx");
    197             }
     203        if (isDebianOrUbuntu() && isOpenJDK()) {
     204            return getPackageDetails("icedtea-netx");
    198205        }
    199206        return null;
     
    350357                ed.setIcon(JOptionPane.WARNING_MESSAGE);
    351358                String content = tr("You are running version {0} of Java.", "<b>"+version+"</b>")+"<br><br>";
    352                 if ("Sun Microsystems Inc.".equals(System.getProperty("java.vendor"))) {
    353                     content += "<b>"+tr("This version is no longer supported by {0} since {1} and is not recommended for use.", 
     359                if ("Sun Microsystems Inc.".equals(System.getProperty("java.vendor")) && !isOpenJDK()) {
     360                    content += "<b>"+tr("This version is no longer supported by {0} since {1} and is not recommended for use.",
    354361                            "Oracle", tr("February 2013"))+"</b><br><br>";
    355362                }
Note: See TracChangeset for help on using the changeset viewer.