Changeset 8777 in josm


Ignore:
Timestamp:
2015-09-21T23:48:29+02:00 (9 years ago)
Author:
Don-vip
Message:

Basic Java 9 support: make code compile, and Linux scripts detect it

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/linux/latest/usr/bin/josm-latest

    r8333 r8777  
    1212# If OpenJDK is only available headless, do not try it
    1313if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
     14        JAVA9_CMDS="/usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java /usr/lib/jvm/java-9-oracle/bin/java"
    1415        JAVA8_CMDS="/usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java /usr/lib/jvm/java-8-oracle/bin/java"
    1516        JAVA7_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
    1617else
     18        JAVA9_CMDS="/usr/lib/jvm/java-9-oracle/bin/java"
    1719        JAVA8_CMDS="/usr/lib/jvm/java-8-oracle/bin/java"
    1820        JAVA7_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
     
    4547done
    4648
     49for jcmd in $JAVA9_CMDS; do
     50        if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then
     51        JAVACMD="$jcmd"
     52    fi
     53done
     54
     55for jcmd in $JAVA9_CMDS; do
     56    if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
     57        JAVACMD="$jcmd"
     58    fi
     59done
     60
    4761if [ "$JAVACMD" ]; then
    4862    echo "Using $JAVACMD to execute josm-latest." || true
  • trunk/linux/tested/usr/bin/josm

    r8333 r8777  
    1212# If OpenJDK is only available headless, do not try it
    1313if dpkg --get-selections 'openjdk-*-jre' | grep install$ > /dev/null ; then
     14        JAVA9_CMDS="/usr/lib/jvm/java-9-openjdk/bin/java /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java /usr/lib/jvm/java-9-oracle/bin/java"
    1415        JAVA8_CMDS="/usr/lib/jvm/java-8-openjdk/bin/java /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java /usr/lib/jvm/java-8-oracle/bin/java"
    1516        JAVA7_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-openjdk/bin/java /usr/lib/jvm/java-7-openjdk-$ARCH/bin/java /usr/lib/jvm/java-7-oracle/bin/java"
    1617else
     18        JAVA9_CMDS="/usr/lib/jvm/java-9-oracle/bin/java"
    1719        JAVA8_CMDS="/usr/lib/jvm/java-8-oracle/bin/java"
    1820        JAVA7_CMDS="$JAVA_HOME/bin/java /usr/lib/jvm/java-7-oracle/bin/java /usr/bin/java"
     
    4547done
    4648
     49for jcmd in $JAVA9_CMDS; do
     50        if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then
     51        JAVACMD="$jcmd"
     52    fi
     53done
     54
     55for jcmd in $JAVA9_CMDS; do
     56    if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
     57        JAVACMD="$jcmd"
     58    fi
     59done
     60
    4761if [ "$JAVACMD" ]; then
    4862    echo "Using $JAVACMD to execute josm." || true
  • trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java

    r8308 r8777  
    2424            return Collections.<Relation>emptySet();
    2525        } else {
    26             return new SubclassFilteredCollection<>(
     26            return new SubclassFilteredCollection<OsmPrimitive, Relation>(
    2727                    primitives, OsmPrimitive.relationPredicate);
    2828        }
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java

    r8510 r8777  
    2525     * All primitives, that are affected with this command.
    2626     */
    27     private final List<OsmPrimitive> objects;
     27    private final List<? extends OsmPrimitive> objects;
    2828    /**
    2929     * The key that is subject to change.
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r8540 r8777  
    369369            return null;
    370370
    371         Set<OsmPrimitive> primitivesToDelete = new HashSet<>(selection);
     371        Set<OsmPrimitive> primitivesToDelete = new HashSet<OsmPrimitive>(selection);
    372372
    373373        Collection<Relation> relationsToDelete = Utils.filteredCollection(primitivesToDelete, Relation.class);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r8510 r8777  
    381381    public Command fixError(TestError testError) {
    382382        if (!isFixable(testError)) return null;
    383         Collection<OsmPrimitive> sel = new LinkedList<>(testError.getPrimitives());
     383        Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>(testError.getPrimitives());
    384384        Set<Node> nodes = new LinkedHashSet<>(OsmPrimitive.getFilteredList(sel, Node.class));
    385385
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    r8510 r8777  
    302302                }
    303303            }
    304             List<OsmPrimitive> newPrimitives = new ArrayList<>(primitives);
     304            List<OsmPrimitive> newPrimitives = new ArrayList<OsmPrimitive>(primitives);
    305305            newPrimitives.add(0, r);
    306306            error.setPrimitives(newPrimitives);
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java

    r8510 r8777  
    108108            E oldPrototype = getPrototypeDisplayValue();
    109109            // Get internal JList to directly call the renderer
    110             JList<E> list = getList();
     110            @SuppressWarnings("rawtypes")
     111            JList list = getList();
    111112            try {
    112113                // Index to give to renderer
     
    117118                        // but not with TaggingPreset custom renderer that return a dummy height if index is equal to -1
    118119                        // So we explicitely call the renderer by simulating a correct index for the current value
     120                        @SuppressWarnings("unchecked")
    119121                        Component c = getRenderer().getListCellRendererComponent(list, value, i, true, true);
    120122                        if (c != null) {
     
    139141
    140142    @SuppressWarnings("unchecked")
    141     protected final JList<E> getList() {
     143    protected final JList<Object> getList() {
    142144        for (int i = 0; i < getUI().getAccessibleChildrenCount(this); i++) {
    143145            Accessible child = getUI().getAccessibleChild(this, i);
     
    158160            // If possible, adjust the maximum number of items with the real height of items
    159161            // It is not granted this works on every platform (tested OK on Windows)
    160             JList<E> list = getList();
     162            JList<Object> list = getList();
    161163            if (list != null) {
    162164                if (!prototype.equals(list.getPrototypeCellValue())) {
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r8764 r8777  
    131131
    132132    public static <T> Collection<T> filter(Collection<? extends T> collection, Predicate<? super T> predicate) {
    133         return new FilteredCollection<>(collection, predicate);
     133        return new FilteredCollection<T>(collection, predicate);
    134134    }
    135135
Note: See TracChangeset for help on using the changeset viewer.