Changeset 0f2a983b


Ignore:
Timestamp:
Nov 27, 2013 1:11:48 AM (6 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
4ee1445
Parents:
8fd2f909
Message:

i2psnark: type arguments, warning suppression (to be removed at Java6)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r8fd2f909 r0f2a983b  
    201201                } else {
    202202                    String base = addPaths(req.getRequestURI(), "/");
    203                     String listing = getListHTML(resource, base, true, method.equals("POST") ? req.getParameterMap() : null);
     203                    @SuppressWarnings("unchecked") // TODO-Java6: Remove cast, return type is correct
     204                    String listing = getListHTML(resource, base, true, method.equals("POST") ? (Map<String, String[]>) req.getParameterMap() : null);
    204205                    if (method.equals("POST")) {
    205206                        // P-R-G
     
    677678        if (action == null) {
    678679            // http://www.onenaught.com/posts/382/firefox-4-change-input-type-image-only-submits-x-and-y-not-name
    679             Map params = req.getParameterMap();
     680            @SuppressWarnings("unchecked") // TODO-Java6: Remove cast, return type is correct
     681            Map<String, String[]> params = req.getParameterMap();
    680682            for (Object o : params.keySet()) {
    681683                String key = (String) o;
     
    22022204     * @since 0.7.14
    22032205     */
    2204     private String getListHTML(File r, String base, boolean parent, Map postParams)
     2206    private String getListHTML(File r, String base, boolean parent, Map<String, String[]> postParams)
    22052207        throws IOException
    22062208    {
     
    26382640
    26392641    /** @since 0.8.1 */
    2640     private void savePriorities(Snark snark, Map postParams) {
     2642    private void savePriorities(Snark snark, Map<String, String[]> postParams) {
    26412643        Storage storage = snark.getStorage();
    26422644        if (storage == null)
    26432645            return;
    2644         Set<Map.Entry> entries = postParams.entrySet();
    2645         for (Map.Entry entry : entries) {
    2646             String key = (String)entry.getKey();
     2646        for (Map.Entry<String, String[]> entry : postParams.entrySet()) {
     2647            String key = entry.getKey();
    26472648            if (key.startsWith("pri.")) {
    26482649                try {
    26492650                    String file = key.substring(4);
    2650                     String val = ((String[])entry.getValue())[0];   // jetty arrays
     2651                    String val = entry.getValue()[0];   // jetty arrays
    26512652                    int pri = Integer.parseInt(val);
    26522653                    storage.setPriority(file, pri);
Note: See TracChangeset for help on using the changeset viewer.