- Timestamp:
- 2014-01-30T02:08:22+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6779 r6783 373 373 */ 374 374 public static String getErrorMessage(Throwable t) { 375 376 377 375 if (t == null) { 376 return null; 377 } 378 378 StringBuilder sb = new StringBuilder(t.getClass().getName()); 379 379 String msg = t.getMessage(); -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r6623 r6783 173 173 } 174 174 175 protected Layer getActiveLayer() {176 try {177 return Main.map.mapView.getActiveLayer();178 } catch(NullPointerException e) {179 return null;180 }181 }182 183 175 /** 184 176 * Replies the first selected layer in the layer list dialog. null, if no … … 208 200 } 209 201 } else if (mode.equals("layer")) { 210 if (getActiveLayer() == null) 202 if (Main.main.getActiveLayer() == null) 211 203 return null; 212 204 // try to zoom to the first selected layer -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r6699 r6783 285 285 286 286 private static void addPresetValue(TaggingPreset p, KeyedItem ky) { 287 if (ky.key != null && ky.getValues() != null) { 287 Collection<String> values = ky.getValues(); 288 if (ky.key != null && values != null) { 288 289 try { 289 presetsValueData.putAll(ky.key, ky.getValues());290 presetsValueData.putAll(ky.key, values); 290 291 } catch (NullPointerException e) { 291 292 Main.error(p+": Unable to initialize "+ky); -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r6595 r6783 31 31 import javax.swing.UIManager; 32 32 33 import org.openstreetmap.josm.Main;34 33 import org.openstreetmap.josm.gui.help.HelpBrowser; 35 34 import org.openstreetmap.josm.gui.help.HelpUtil; … … 431 430 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 432 431 Dimension x = new Dimension(screenSize.width*2/3, screenSize.height*2/3); 433 try { 434 if(parent != null) { 435 x = JOptionPane.getFrameForComponent(parent).getSize(); 436 } 437 } catch(NullPointerException e) { 438 Main.warn(e); 432 if (parent != null) { 433 x = JOptionPane.getFrameForComponent(parent).getSize(); 439 434 } 440 435 return x; -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r6666 r6783 283 283 } 284 284 285 286 285 // Popup Information 287 286 // display them if the middle mouse button is pressed and … … 328 327 oldMousePos = ms.mousePos; 329 328 } catch (ConcurrentModificationException x) { 330 Main.warn(x);331 } catch (NullPointerException x) {332 329 Main.warn(x); 333 330 } finally { -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r6706 r6783 109 109 private LayerListModel model; 110 110 111 /** the selection model */112 private DefaultListSelectionModel selectionModel;113 114 111 /** the list of layers (technically its a JTable, but appears like a list) */ 115 112 private LayerList layerList; … … 165 162 // create the models 166 163 // 167 selectionModel = new DefaultListSelectionModel(); 164 DefaultListSelectionModel selectionModel = new DefaultListSelectionModel(); 168 165 selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 169 166 model = new LayerListModel(selectionModel); -
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r6362 r6783 27 27 * @return the base wiki URL 28 28 */ 29 static public String getWikiBaseUrl() {29 public static String getWikiBaseUrl() { 30 30 return Main.pref.get("help.baseurl", Main.JOSM_WEBSITE); 31 31 } … … 36 36 * @return the base wiki URL for help pages 37 37 */ 38 static public String getWikiBaseHelpUrl() {38 public static String getWikiBaseHelpUrl() { 39 39 return getWikiBaseUrl() + "/wiki"; 40 40 } … … 47 47 * @see #buildAbsoluteHelpTopic 48 48 */ 49 static public String getHelpTopicUrl(String absoluteHelpTopic) {49 public static String getHelpTopicUrl(String absoluteHelpTopic) { 50 50 if(absoluteHelpTopic == null) 51 51 return null; … … 63 63 * @return the URL to the edit page 64 64 */ 65 static public String getHelpTopicEditUrl(String absoluteHelpTopic) {65 public static String getHelpTopicEditUrl(String absoluteHelpTopic) { 66 66 String topicUrl = getHelpTopicUrl(absoluteHelpTopic); 67 67 topicUrl = topicUrl.replaceAll("#[^#]*$", ""); // remove optional fragment … … 76 76 * @return the relative help topic in the URL, i.e. "/Action/New" 77 77 */ 78 static public String extractRelativeHelpTopic(String url) {78 public static String extractRelativeHelpTopic(String url) { 79 79 String topic = extractAbsoluteHelpTopic(url); 80 80 if (topic == null) … … 94 94 * @return the absolute help topic in the URL, i.e. "/De:Help/Action/New" 95 95 */ 96 static public String extractAbsoluteHelpTopic(String url) {96 public static String extractAbsoluteHelpTopic(String url) { 97 97 if (!url.startsWith(getWikiBaseHelpUrl())) return null; 98 98 url = url.substring(getWikiBaseHelpUrl().length()); … … 119 119 * @since 5915 120 120 */ 121 staticprivate String getHelpTopicPrefix(LocaleType type) {121 private static String getHelpTopicPrefix(LocaleType type) { 122 122 String ret = LanguageInfo.getWikiLanguagePrefix(type); 123 123 if(ret == null) … … 138 138 * @since 5915 139 139 */ 140 static public String buildAbsoluteHelpTopic(String topic, LocaleType type) {140 public static String buildAbsoluteHelpTopic(String topic, LocaleType type) { 141 141 String prefix = getHelpTopicPrefix(type); 142 142 if (prefix == null || topic == null || topic.trim().length() == 0 || topic.trim().equals("/")) … … 151 151 * @return the help topic. null, if no context specific help topic is found 152 152 */ 153 static public String getContextSpecificHelpTopic(Object context) {153 public static String getContextSpecificHelpTopic(Object context) { 154 154 if (context == null) 155 155 return null; … … 183 183 * @return instance of help action 184 184 */ 185 staticprivate Action getHelpAction() {186 try{185 private static Action getHelpAction() { 186 if (Main.main.menu != null) { 187 187 return Main.main.menu.help; 188 } catch(NullPointerException e) { 189 return new HelpAction(); 190 } 188 } 189 return new HelpAction(); 191 190 } 192 191 … … 201 200 * @param relativeHelpTopic the help topic. Set to the default help topic if null. 202 201 */ 203 static public void setHelpContext(JComponent component, String relativeHelpTopic) {202 public static void setHelpContext(JComponent component, String relativeHelpTopic) { 204 203 if (relativeHelpTopic == null) { 205 204 relativeHelpTopic = "/"; … … 224 223 * @param helpTopic 225 224 */ 226 static public String ht(String helpTopic) {225 public static String ht(String helpTopic) { 227 226 // this is just a marker method 228 227 return helpTopic; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r6643 r6783 196 196 if (children != null) { 197 197 progressMonitor.subTask(tr("Scanning directory {0}", f.getPath())); 198 try { 199 addRecursiveFiles(files, Arrays.asList(children)); 200 } catch(NullPointerException npe) { 201 Main.error(npe); 202 rememberError(tr("Found null file in directory {0}\n", f.getPath())); 203 } 198 addRecursiveFiles(files, Arrays.asList(children)); 204 199 } else { 205 200 rememberError(tr("Error while getting files from directory {0}\n", f.getPath())); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java
r6764 r6783 45 45 /** the combo box with the available locales */ 46 46 private JosmComboBox langCombo; 47 /** the model for the combo box */48 private LanguageComboBoxModel model;49 47 50 48 @Override 51 49 public void addGui(final PreferenceTabbedPane gui) { 52 model = new LanguageComboBoxModel(); 50 LanguageComboBoxModel model = new LanguageComboBoxModel(); 53 51 // Selecting the language BEFORE the JComboBox listens to model changes speed up initialization by ~35ms (see #7386) 54 52 // See http://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java
r6267 r6783 42 42 private final PresetHandler presetHandler; 43 43 44 private AutoCompletionManager autocomplete;45 46 44 /** 47 45 * builds the panel with the table for editing tags … … 183 181 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 184 182 185 autocomplete = layer.data.getAutoCompletionManager(); 183 AutoCompletionManager autocomplete = layer.data.getAutoCompletionManager(); 186 184 AutoCompletionList acList = new AutoCompletionList(); 187 185 -
trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java
r6340 r6783 245 245 } 246 246 247 private Dimension minimumComponentSize(Node node) {248 Component child = childForNode(node);249 return (child != null) ? child.getMinimumSize() : new Dimension(0, 0);250 251 }252 253 247 private Dimension preferredNodeSize(Node root) { 254 248 if (root instanceof Leaf)
Note:
See TracChangeset
for help on using the changeset viewer.