Changeset 32904 in osm
- Timestamp:
- 2016-09-03T15:27:40+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreferencesModel.java
r32545 r32904 11 11 import java.util.LinkedList; 12 12 import java.util.List; 13 import java.util.Observable;14 13 import java.util.Set; 15 14 16 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.gui.util.ChangeNotifier; 17 17 import org.openstreetmap.josm.plugins.opendata.OdPlugin; 18 18 import org.openstreetmap.josm.plugins.opendata.core.OdConstants; … … 20 20 import org.openstreetmap.josm.plugins.opendata.core.modules.ModuleInformation; 21 21 22 public class ModulePreferencesModel extends Observable{22 public class ModulePreferencesModel extends ChangeNotifier { 23 23 private final ArrayList<ModuleInformation> availableModules = new ArrayList<>(); 24 24 private final ArrayList<ModuleInformation> displayedModules = new ArrayList<>(); … … 51 51 } 52 52 filterExpression = filter; 53 clearChanged(); 54 notifyObservers(); 53 fireStateChanged(); 55 54 } 56 55 … … 71 70 } 72 71 } 73 clearChanged(); 74 notifyObservers(); 72 fireStateChanged(); 75 73 } 76 74 … … 106 104 } 107 105 } 108 clearChanged(); 109 notifyObservers(); 106 fireStateChanged(); 110 107 } 111 108 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/OdsDocument.java
r30723 r32904 12 12 import org.jopendocument.model.OpenDocument; 13 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.tools.Utils; 14 15 import org.xml.sax.InputSource; 15 16 import org.xml.sax.XMLReader; 16 import org.xml.sax.helpers.XMLReaderFactory;17 17 18 18 public class OdsDocument extends OpenDocument { … … 21 21 loadFrom(in); 22 22 } 23 23 24 24 private InputSource getEntryInputSource(ZipInputStream zis) throws IOException { 25 int n = -1;25 int n; 26 26 final byte[] buffer = new byte[4096]; 27 27 final ByteArrayOutputStream baos = new ByteArrayOutputStream(); … … 37 37 try { 38 38 final ZipInputStream zis = new ZipInputStream(in); 39 final XMLReader rdr = XMLReaderFactory.createXMLReader();40 41 ZipEntry entry = null;39 final XMLReader rdr = Utils.newSafeSAXParser().getXMLReader(); 40 41 ZipEntry entry; 42 42 boolean contentParsed = false; 43 43 44 44 while (!contentParsed && (entry = zis.getNextEntry()) != null) { 45 45 if (entry.getName().equals("content.xml")) { … … 50 50 } 51 51 } 52 53 } catch ( finalException e) {54 e.printStackTrace();52 53 } catch (Exception e) { 54 Main.error(e); 55 55 } 56 56 57 57 init(contentHandler.getBody()); 58 58 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/AbstractModule.java
r32545 r32904 106 106 if (handlerClass != null) { 107 107 try { 108 result.add(handlerClass. newInstance());109 } catch ( InstantiationException | IllegalAccessException t) {110 Main.error( "Cannot instantiate "+handlerClass+" because of "+t.getClass().getName()+": "+t.getMessage());108 result.add(handlerClass.getConstructor().newInstance()); 109 } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException t) { 110 Main.error(t, "Cannot instantiate "+handlerClass+" because of "+t.getClass().getName()); 111 111 } 112 112 }
Note:
See TracChangeset
for help on using the changeset viewer.