Changeset 34310 in osm for applications/editors


Ignore:
Timestamp:
2018-06-17T17:57:30+02:00 (7 years ago)
Author:
donvip
Message:

fix javadoc warnings

Location:
applications/editors/josm/plugins/indoorhelper/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/indoorhelper/src/model/IndoorHelperModel.java

    r34135 r34310  
    181181     * @author rebsc
    182182     * @param role The Multipolygon Role as String
     183     * @param innerRelation inner relation
    183184     */
    184185    public void editRelation(String role, Collection<OsmPrimitive> innerRelation) {
     
    267268     * @author rebsc
    268269     * @param ds active dataset
     270     * @param relations relations
    269271     * @return true if selected object is a relation
    270272     */
  • applications/editors/josm/plugins/indoorhelper/src/org/openstreetmap/josm/plugins/indoorhelper/IndoorHelperPlugin.java

    r34013 r34310  
    2222import java.io.File;
    2323import java.io.FileOutputStream;
     24import java.io.IOException;
    2425import java.io.InputStream;
    2526import java.io.OutputStream;
     
    4546 * @author egru
    4647 * @author rebsc
    47  *
    4848 */
    4949public class IndoorHelperPlugin extends Plugin implements PaintableInvalidationListener, ActiveLayerChangeListener {
    5050
    51     @SuppressWarnings("unused")
    5251    private IndoorHelperController controller;
    5352    String sep = System.getProperty("file.separator");
     
    5958     *
    6059     * @param info general information about the plug-in
    61      */
    62     public IndoorHelperPlugin(PluginInformation info) throws Exception {
     60     * @throws IOException if any I/O error occurs
     61     */
     62    public IndoorHelperPlugin(PluginInformation info) throws IOException {
    6363        super(info);
    6464        MainApplication.getLayerManager().addAndFireActiveLayerChangeListener(this);
     
    6868        this.exportStyleFile("entrance_icon.png");
    6969        this.exportStyleFile("elevator_icon.png");
    70 
    71         //this.setIndoorValidator();
    72     }
    73 
    74 
    75     /**
    76      * Secures that the plug-in is only loaded, if a new MapFrame is created.
    77      */
     70    }
     71
    7872    @Override
    7973    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
     
    8175
    8276        if (oldFrame == null && newFrame != null) {
     77            // Secures that the plug-in is only loaded, if a new MapFrame is created.
    8378            controller = new IndoorHelperController();
    8479        }
    8580    }
    8681
    87 
    8882    /**
    8983     * Exports the mapcss validator file to the preferences directory.
    90      */
    91     private void exportValidator(String resourceName) throws Exception {
    92         InputStream stream = null;
     84     * @param resourceName resource name
     85     * @throws IOException if any I/O error occurs
     86     */
     87    private void exportValidator(String resourceName) throws IOException {
    9388        OutputStream resStreamOut = null;
    9489
    95         try {
    96             stream = IndoorHelperPlugin.class.getResourceAsStream(resourceName);
     90        try (InputStream stream = IndoorHelperPlugin.class.getResourceAsStream(resourceName)) {
    9791            if (stream == null) {
    9892                System.out.println("Validator: stream is null");
    99                 throw new Exception("Cannot get resource \"" + resourceName + "\" from Jar file.");
    100             }
    101 
    102             String outPath;
     93                throw new IOException("Cannot get resource \"" + resourceName + "\" from Jar file.");
     94            }
     95
    10396            int readBytes;
    10497            byte[] buffer = new byte[4096];
     
    107100            File valDir = new File(valDirPath);
    108101            valDir.mkdirs();
    109             outPath = valDir.getAbsolutePath() +sep+ "indoorhelper.validator.mapcss";
    110             System.out.println("Validator:"+outPath);
     102            String outPath = valDir.getAbsolutePath() +sep+ "indoorhelper.validator.mapcss";
    111103
    112104            resStreamOut = new FileOutputStream(outPath);
     
    115107            }
    116108            resStreamOut.close();
    117         } catch (Exception ex) {
    118             throw ex;
    119         } finally {
    120             stream.close();
    121109        }
    122110    }
     
    124112    /**
    125113     * Exports the mapCSS file to the preferences directory.
    126      */
    127     private void exportStyleFile(String resourceName) throws Exception {
     114     * @param resourceName resource name
     115     * @throws IOException if any I/O error occurs
     116     */
     117    private void exportStyleFile(String resourceName) throws IOException {
    128118        try (InputStream stream = IndoorHelperPlugin.class.getResourceAsStream("/data/" + resourceName)) {
    129119            if (stream == null) {
    130120                System.out.println("MapPaint: stream is null");
    131                 throw new Exception("Cannot get resource \"" + resourceName + "\" from Jar file.");
     121                throw new IOException("Cannot get resource \"" + resourceName + "\" from Jar file.");
    132122            }
    133123
     
    146136                }
    147137            }
    148         } catch (Exception ex) {
    149             throw ex;
    150138        }
    151139    }
Note: See TracChangeset for help on using the changeset viewer.