Ignore:
Timestamp:
2009-12-13T11:48:12+01:00 (15 years ago)
Author:
jttt
Message:

Fixed some of the warnings found by FindBugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MultiPartFormOutputStream.java

    r2512 r2626  
    88are permitted provided that the following conditions are met:
    99
    10     * Redistribution of source code must retain the above copyright notice, this list
     10 * Redistribution of source code must retain the above copyright notice, this list
    1111      of conditions and the following disclaimer.
    1212
    13     * Redistribution in binary form must reproduce the above copyright notice, this
     13 * Redistribution in binary form must reproduce the above copyright notice, this
    1414      list of conditions and the following disclaimer in the documentation and/or other
    1515      materials provided with the distribution.
     
    3131You acknowledge that this software is not designed, licensed or intended for use in the
    3232design, construction, operation or maintenance of any nuclear facility.
    33 */
     33 */
    3434
    3535package org.openstreetmap.josm.io;
     
    8686     */
    8787    public MultiPartFormOutputStream(OutputStream os, String boundary) {
    88         if(os == null) {
     88        if(os == null)
    8989            throw new IllegalArgumentException("Output stream is required.");
    90         }
    91         if(boundary == null || boundary.length() == 0) {
     90        if(boundary == null || boundary.length() == 0)
    9291            throw new IllegalArgumentException("Boundary stream is required.");
    93         }
    9492        this.out = new DataOutputStream(os);
    9593        this.boundary = boundary;
     
    106104    public void writeField(String name, boolean value)
    107105    throws java.io.IOException {
    108         writeField(name, new Boolean(value).toString());
     106        writeField(name, Boolean.valueOf(value).toString());
    109107    }
    110108
     
    178176    public void writeField(String name, char value)
    179177    throws java.io.IOException {
    180         writeField(name, new Character(value).toString());
     178        writeField(name, Character.valueOf(value).toString());
    181179    }
    182180
     
    191189    public void writeField(String name, String value)
    192190    throws java.io.IOException {
    193         if(name == null) {
     191        if(name == null)
    194192            throw new IllegalArgumentException("Name cannot be null or empty.");
    195         }
    196193        if(value == null) {
    197194            value = "";
     
    229226    public void writeFile(String name, String mimeType, java.io.File file)
    230227    throws java.io.IOException {
    231         if(file == null) {
     228        if(file == null)
    232229            throw new IllegalArgumentException("File cannot be null.");
    233         }
    234         if(!file.exists()) {
     230        if(!file.exists())
    235231            throw new IllegalArgumentException("File does not exist.");
    236         }
    237         if(file.isDirectory()) {
     232        if(file.isDirectory())
    238233            throw new IllegalArgumentException("File cannot be a directory.");
    239         }
    240234        writeFile(name, mimeType, file.getCanonicalPath(), new FileInputStream(file));
    241235    }
     
    254248            String fileName, InputStream is)
    255249    throws java.io.IOException {
    256         if(is == null) {
     250        if(is == null)
    257251            throw new IllegalArgumentException("Input stream cannot be null.");
    258         }
    259         if(fileName == null || fileName.length() == 0) {
     252        if(fileName == null || fileName.length() == 0)
    260253            throw new IllegalArgumentException("File name cannot be null or empty.");
    261         }
    262254        /*
    263255            --boundary\r\n
     
    308300            String fileName, byte[] data)
    309301    throws java.io.IOException {
    310         if(data == null) {
     302        if(data == null)
    311303            throw new IllegalArgumentException("Data cannot be null.");
    312         }
    313         if(fileName == null || fileName.length() == 0) {
     304        if(fileName == null || fileName.length() == 0)
    314305            throw new IllegalArgumentException("File name cannot be null or empty.");
    315         }
    316306        /*
    317307            --boundary\r\n
Note: See TracChangeset for help on using the changeset viewer.