Changeset 7019 in josm


Ignore:
Timestamp:
2014-04-28T16:41:29+02:00 (5 years ago)
Author:
Don-vip
Message:

see #8465 - fix @SafeVarargs warning, see http://docs.oracle.com/javase/7/docs/api/java/lang/SafeVarargs.html

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/.settings/org.eclipse.jdt.core.prefs

    r6757 r7019  
    77org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
    88org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
    9 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
     9org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
    1010org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
    11 org.eclipse.jdt.core.compiler.compliance=1.6
     11org.eclipse.jdt.core.compiler.compliance=1.7
    1212org.eclipse.jdt.core.compiler.debug.lineNumber=generate
    1313org.eclipse.jdt.core.compiler.debug.localVariable=generate
     
    111111org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
    112112org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
    113 org.eclipse.jdt.core.compiler.source=1.6
     113org.eclipse.jdt.core.compiler.source=1.7
    114114org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
    115115org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
  • trunk/build.xml

    r7001 r7019  
    197197    </target>
    198198    <target name="compile" depends="init,javacc">
    199         <javac srcdir="src" includes="com/**,oauth/**,org/apache/commons/codec/**" destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" encoding="iso-8859-1"/>
    200         <javac srcdir="src" excludes="com/**,oauth/**,org/apache/commons/codec/**" destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" encoding="UTF-8">
     199        <!-- COTS -->
     200        <javac srcdir="src" includes="com/**,oauth/**,org/apache/commons/codec/**" nowarn="on"
     201                destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" encoding="iso-8859-1">
     202            <!-- get rid of "internal proprietary API" warning -->
     203                <compilerarg value="-XDignore.symbol.file"/>
     204        </javac>
     205        <!-- JMapViewer/JOSM -->
     206        <javac srcdir="src" excludes="com/**,oauth/**,org/apache/commons/codec/**,org/openstreetmap/gui/jmapviewer/Demo.java"
     207                destdir="build" target="1.7" source="1.7" debug="on" includeantruntime="false" encoding="UTF-8">
    201208            <compilerarg value="-Xlint:deprecation"/>
    202209            <compilerarg value="-Xlint:unchecked"/>
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r7005 r7019  
    179179        }
    180180    });
    181    
     181
    182182    /**
    183183     * The linked preferences class (optional). If set, accessible from the title bar with a dedicated button
     
    862862    }
    863863
    864     protected Component createLayout(Component data, boolean scroll, Collection<SideButton> firstButtons, Collection<SideButton>... nextButtons) {
     864    @SafeVarargs
     865    protected final Component createLayout(Component data, boolean scroll, Collection<SideButton> firstButtons, Collection<SideButton>... nextButtons) {
    865866        if (scroll) {
    866867            data = new JScrollPane(data);
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r7009 r7019  
    126126    /**
    127127     * Returns the first element from {@code items} which is non-null, or null if all elements are null.
    128      */
     128     * @param items the items to look for
     129     * @return first non-null item if there is one
     130     */
     131    @SafeVarargs
    129132    public static <T> T firstNonNull(T... items) {
    130133        for (T i : items) {
     
    972975        }
    973976    }
    974    
    975     /**
    976      * Fixes URL with illegal characters in the query (and fragment) part by 
     977
     978    /**
     979     * Fixes URL with illegal characters in the query (and fragment) part by
    977980     * percent encoding those characters.
    978      * 
     981     *
    979982     * special characters like &amp; and # are not encoded
    980      * 
     983     *
    981984     * @param url the URL that should be fixed
    982985     * @return the repaired URL
    983986     */
    984987    public static String fixURLQuery(String url) {
    985         if (url.indexOf('?') == -1) 
     988        if (url.indexOf('?') == -1)
    986989            return url;
    987        
     990
    988991        String query = url.substring(url.indexOf('?') + 1);
    989        
     992
    990993        StringBuilder sb = new StringBuilder(url.substring(0, url.indexOf('?') + 1));
    991        
     994
    992995        for (int i=0; i<query.length(); i++) {
    993996            String c = query.substring(i, i+1);
     
    10041007        return sb.toString();
    10051008    }
    1006    
     1009
    10071010}
Note: See TracChangeset for help on using the changeset viewer.