Ignore:
Timestamp:
2016-07-21T01:57:41+02:00 (4 years ago)
Author:
Don-vip
Message:

see #11390 - switch to Java 8

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
4 edited

Legend:

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

    r10485 r10580  
    10261026                    // This can be removed if someday Oracle fixes https://bugs.openjdk.java.net/browse/JDK-6788458
    10271027                    // CHECKSTYLE.OFF: LineLength
    1028                     // hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/828c4fedd29f/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java#l656
     1028                    // hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/dc4322602480/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java#l656
    10291029                    // CHECKSTYLE.ON: LineLength
    10301030                    Image img = read(new ByteArrayInputStream(bytes), false, true);
     
    11511151                // See #10479: for PNG files, always enforce transparency to be sure tNRS chunk is used even not in paletted mode
    11521152                // This can be removed if someday Oracle fixes https://bugs.openjdk.java.net/browse/JDK-6788458
    1153                 // hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/828c4fedd29f/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java#l656
     1153                // hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/dc4322602480/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java#l656
    11541154                img = read(path, false, true);
    11551155                if (Main.isDebugEnabled() && isTransparencyForced(img)) {
     
    18091809     * @return the {@code TransparentColor} defined in image reader metadata, or {@code null}
    18101810     * @throws IOException if an error occurs during reading
    1811      * @see <a href="http://docs.oracle.com/javase/7/docs/api/javax/imageio/metadata/doc-files/standard_metadata.html">javax_imageio_1.0 metadata</a>
     1811     * @see <a href="http://docs.oracle.com/javase/8/docs/api/javax/imageio/metadata/doc-files/standard_metadata.html">javax_imageio_1.0 metadata</a>
    18121812     * @since 7499
    18131813     */
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r10339 r10580  
    7373            // We'll just ignore this for now. The user will still be able to close JOSM by closing all its windows.
    7474            Main.warn("Failed to register with OSX: " + ex);
    75         }
    76         // Invite users to install Java 8 if they are still with Java 7
    77         String java = System.getProperty("java.version");
    78         if (java != null && java.startsWith("1.7")) {
    79             askUpdateJava(java);
    8075        }
    8176    }
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r10379 r10580  
    113113    @Override
    114114    public void startupHook() {
    115         if (isDebianOrUbuntu()) {
    116             // Invite users to install Java 8 if they are still with Java 7 and using a compatible distrib (Debian >= 8 or Ubuntu >= 15.10)
    117             String java = System.getProperty("java.version");
    118             String os = getOSDescription();
    119             if (java != null && java.startsWith("1.7") && os != null && (
    120                     os.startsWith("Linux Debian GNU/Linux 8") || os.matches("^Linux Ubuntu 1[567].*"))) {
    121                 String url;
    122                 // apturl does not exist on Debian (see #8465)
    123                 if (os.startsWith("Linux Debian")) {
    124                     url = "https://packages.debian.org/jessie-backports/openjdk-8-jre";
    125                 } else if (getPackageDetails("apturl") != null) {
    126                     url = "apt://openjdk-8-jre";
    127                 } else {
    128                     url = "http://packages.ubuntu.com/xenial/openjdk-8-jre";
    129                 }
    130                 askUpdateJava(java, url);
    131             }
    132         }
     115        // Do nothing
    133116    }
    134117
     
    272255    public String getJavaPackageDetails() {
    273256        String home = System.getProperty("java.home");
    274         if (home.contains("java-7-openjdk") || home.contains("java-1.7.0-openjdk")) {
    275             return getPackageDetails("openjdk-7-jre", "java-1_7_0-openjdk", "java-1.7.0-openjdk");
     257        if (home.contains("java-8-openjdk") || home.contains("java-1.8.0-openjdk")) {
     258            return getPackageDetails("openjdk-8-jre", "java-1_8_0-openjdk", "java-1.8.0-openjdk");
     259        } else if (home.contains("java-9-openjdk") || home.contains("java-1.9.0-openjdk")) {
     260            return getPackageDetails("openjdk-9-jre", "java-1_9_0-openjdk", "java-1.9.0-openjdk");
    276261        } else if (home.contains("icedtea")) {
    277262            return getPackageDetails("icedtea-bin");
     
    434419    }
    435420
    436     protected void askUpdateJava(String version) {
    437         if (!GraphicsEnvironment.isHeadless()) {
    438             askUpdateJava(version, "https://www.java.com/download");
    439         }
    440     }
    441 
     421    // Method unused, but kept for translation already done. To reuse during Java 9 migration
    442422    protected void askUpdateJava(final String version, final String url) {
    443423        GuiHelper.runInEDTAndWait(new Runnable() {
     
    449429                        new String[]{tr("OK"), tr("Update Java"), tr("Cancel")});
    450430                // Check if the dialog has not already been permanently hidden by user
    451                 if (!ed.toggleEnable("askUpdateJava8").toggleCheckState()) {
     431                if (!ed.toggleEnable("askUpdateJava9").toggleCheckState()) {
    452432                    ed.setButtonIcons(new String[]{"ok", "java", "cancel"}).setCancelButton(3);
    453433                    ed.setMinimumSize(new Dimension(480, 300));
     
    457437                    if ("Sun Microsystems Inc.".equals(System.getProperty("java.vendor")) && !isOpenJDK()) {
    458438                        content.append("<b>").append(tr("This version is no longer supported by {0} since {1} and is not recommended for use.",
    459                                 "Oracle", tr("April 2015"))).append("</b><br><br>");
     439                                "Oracle", tr("April 2015"))).append("</b><br><br>"); // TODO: change date once Java 8 EOL is announced
    460440                    }
    461441                    content.append("<b>")
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r10378 r10580  
    6464    @Override
    6565    public void startupHook() {
    66         // Invite users to install Java 8 if they are still with Java 7
    67         String version = System.getProperty("java.version");
    68         if (version != null && version.startsWith("1.7")) {
    69             askUpdateJava(version);
    70         }
     66        // Do nothing
    7167    }
    7268
Note: See TracChangeset for help on using the changeset viewer.