- Timestamp:
- 2015-10-22T02:01:00+02:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r8509 r8926 10 10 import java.util.Collection; 11 11 import java.util.List; 12 import java.util.concurrent.CancellationException; 13 import java.util.concurrent.ExecutionException; 12 14 import java.util.concurrent.Future; 13 15 … … 91 93 * This functions calculates the rectangles, asks the user to continue and downloads 92 94 * the areas if applicable. 95 * 96 * @param a download area hull 97 * @param maxArea maximum area size for a single download 98 * @param osmDownload Set to true if OSM data should be downloaded 99 * @param gpxDownload Set to true if GPX data should be downloaded 100 * @param title the title string for the confirmation dialog 101 * @param progressMonitor the progress monitor 93 102 */ 94 103 protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title, -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r8919 r8926 930 930 931 931 /** 932 * This is a method splits way into smaller parts, using the prepared nodes list as split points.932 * This is a method that splits way into smaller parts, using the prepared nodes list as split points. 933 933 * Uses {@link SplitWayAction#splitWay} for the heavy lifting. 934 * @param way way to split 935 * @param nodes split points 934 936 * @return list of split ways (or original ways if no splitting is done). 935 937 */ … … 1142 1144 * This method checks if polygons have several touching parts and splits them in several polygons. 1143 1145 * @param polygons the polygons to process. 1146 * @return the resulting list of polygons 1144 1147 */ 1145 1148 public static List<AssembledPolygon> fixTouchingPolygons(List<AssembledPolygon> polygons) { -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r8855 r8926 245 245 * - The same for vertical segments. 246 246 * 5. Rotate back. 247 * 247 * @throws InvalidUserInputException if selected ways have an angle different from 90 or 180 degrees 248 248 **/ 249 249 private static Collection<Command> orthogonalize(List<WayData> wayDataList, List<Node> headingNodes) throws InvalidUserInputException { … … 536 536 * Recognize angle to be approximately 0, 90, 180 or 270 degrees. 537 537 * returns an integral value, corresponding to a counter clockwise turn: 538 * @throws RejectedAngleException in case of invalid angle 538 539 */ 539 540 private static int angleToDirectionChange(double a, double deltaMax) throws RejectedAngleException { -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r8924 r8926 837 837 /** 838 838 * Called after every put. In case of a problem, do nothing but output the error in log. 839 * @throws IOException if any I/O error occurs 839 840 */ 840 841 public void save() throws IOException { -
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r8836 r8926 113 113 * 114 114 * @return the option selected by user. {@link JOptionPane#CLOSED_OPTION} if the dialog was closed. 115 * @throws HeadlessException if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code> 115 116 */ 116 117 public static int showOptionDialog(String preferenceKey, Component parent, Object message, String title, int optionType, … … 153 154 * 154 155 * @return true, if the selected option is equal to <code>trueOption</code>, otherwise false. 156 * @throws HeadlessException if <code>GraphicsEnvironment.isHeadless</code> returns <code>true</code> 155 157 * 156 158 * @see JOptionPane#INFORMATION_MESSAGE -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r8863 r8926 198 198 /** 199 199 * Called from the XML parser to set the types this preset affects. 200 * @throws SAXException if any SAX error occurs 200 201 */ 201 202 public void setType(String types) throws SAXException { -
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r8846 r8926 128 128 /** 129 129 * Parse the given input source and return the dataset. 130 * @throws IllegalDataException if an error was found while parsing the OSM data 130 131 * 131 132 * @see OsmReader#parseDataSet(InputStream, ProgressMonitor) -
trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
r8840 r8926 60 60 * executed in the current thread. 61 61 * @return the data to cache 62 * @throws T a {@link Throwable} 62 63 */ 63 64 protected abstract byte[] updateData() throws T; … … 175 176 /** 176 177 * Tries to load the data using the given ident from disk. If this fails, data will be updated, unless run in offline mode 178 * @throws T a {@link Throwable} 177 179 */ 178 180 private void loadFromDisk() throws T { -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r8846 r8926 877 877 } 878 878 879 /** Method for parsing API responses for operations on individual notes */ 879 /** 880 * Method for parsing API responses for operations on individual notes 881 * @param xml the API response as XML data 882 * @return the resulting Note 883 * @throws OsmTransferException if the API response cannot be parsed 884 */ 880 885 private Note parseSingleNote(String xml) throws OsmTransferException { 881 886 try { -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r8855 r8926 84 84 * @param associatedFile filename of data (layer name will be generated from name of file) 85 85 * @param pm handler for progress monitoring and canceling 86 * @throws IllegalDataException if an error was found while parsing the OSM data 86 87 */ 87 88 protected void importData(InputStream in, final File associatedFile, ProgressMonitor pm) throws IllegalDataException { … … 112 113 * @param layerName name of generated layer 113 114 * @param progressMonitor handler for progress monitoring and canceling 115 * @throws IllegalDataException if an error was found while parsing the OSM data 114 116 */ 115 117 public OsmImporterData loadLayer(InputStream in, final File associatedFile, final String layerName, ProgressMonitor progressMonitor) -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r8846 r8926 398 398 * This is basically the same code as parseUnknown(), except for the warnings, which 399 399 * are displayed for inner elements and not at top level. 400 * @throws XMLStreamException if there is an error processing the underlying XML source 400 401 */ 401 402 private void jumpToEnd(boolean printWarning) throws XMLStreamException { … … 430 431 /** 431 432 * Read out the common attributes and put them into current OsmPrimitive. 433 * @throws XMLStreamException if there is an error processing the underlying XML source 432 434 */ 433 435 private void readCommon(PrimitiveData current) throws XMLStreamException { -
trunk/src/org/openstreetmap/josm/io/UTFInputStreamReader.java
r8510 r8926 16 16 * Creates a new {@link InputStreamReader} from the {@link InputStream} with UTF-8 as default encoding. 17 17 * @return A reader with the correct encoding. Starts to read after the BOM. 18 * @throws IOException if any I/O error occurs 18 19 * @see #create(java.io.InputStream, String) 19 20 */ … … 26 27 * @param defaultEncoding Used, when no BOM was recognized. Can be null. 27 28 * @return A reader with the correct encoding. Starts to read after the BOM. 29 * @throws IOException if any I/O error occurs 28 30 */ 29 31 public static UTFInputStreamReader create(InputStream input, String defaultEncoding) throws IOException { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r8840 r8926 134 134 * @param algorithm the signing algorithm, eg "SHA256withRSA" 135 135 * @param san SubjectAlternativeName extension (optional) 136 * @return the self-signed X.509 Certificate 137 * @throws GeneralSecurityException if any security error occurs 138 * @throws IOException if any I/O error occurs 136 139 */ 137 140 private static X509Certificate generateCertificate(String dn, KeyPair pair, int days, String algorithm, String san) 138 141 throws GeneralSecurityException, IOException { 139 PrivateKey privkey = pair.getPrivate();140 142 X509CertInfo info = new X509CertInfo(); 141 143 Date from = new Date(); … … 193 195 194 196 // Sign the cert to identify the algorithm that's used. 197 PrivateKey privkey = pair.getPrivate(); 195 198 X509CertImpl cert = new X509CertImpl(info); 196 199 cert.sign(privkey, algorithm); -
trunk/src/org/openstreetmap/josm/io/session/SessionLayerExporter.java
r5391 r8926 6 6 import java.util.Collection; 7 7 8 import org.w3c.dom.Element;9 10 8 import org.openstreetmap.josm.gui.layer.Layer; 11 9 import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport; 10 import org.w3c.dom.Element; 12 11 13 12 public interface SessionLayerExporter { … … 15 14 /** 16 15 * Return the Layers, this Layer depends on. 16 * @return the layer dependencies 17 17 */ 18 18 Collection<Layer> getDependencies(); … … 20 20 /** 21 21 * The GUI for exporting this layer. 22 * @return the export panel 22 23 */ 23 24 Component getExportPanel(); 24 25 25 26 /** 26 * Return true, if the layer should be included in the 27 * list of exported layers. 27 * Return true, if the layer should be included in the list of exported layers. 28 28 * 29 29 * The user can veto this in the export panel. 30 * @return {@code true} if the layer should be included in the list of exported layers, {@code false} otherwise. 30 31 */ 31 32 boolean shallExport(); 32 33 33 34 /** 34 * Return true, if some data needs to be included in 35 * the zip archive. This decision depends on the user 35 * Return true, if some data needs to be included in the zip archive. This decision depends on the user 36 36 * selection in the export panel. 37 37 * 38 * If any layer requires zip, the user can only save as 39 * .joz. Otherwise both .jos and .joz are possible.38 * If any layer requires zip, the user can only save as .joz. Otherwise both .jos and .joz are possible. 39 * @return {@code true} if some data needs to be included in the zip archive, {@code false} otherwise. 40 40 */ 41 41 boolean requiresZip(); … … 44 44 * Save meta data to the .jos file. Return a layer XML element. 45 45 * Use <code>support</code> to save files in the zip archive as needed. 46 * @param support support class providing export utilities 47 * @return the resulting XML element 48 * @throws IOException if any I/O error occurs 46 49 */ 47 50 Element export(ExportSupport support) throws IOException; 48 49 51 } 50 -
trunk/src/org/openstreetmap/josm/io/session/SessionLayerImporter.java
r4668 r8926 4 4 import java.io.IOException; 5 5 6 import org.w3c.dom.Element;7 8 6 import org.openstreetmap.josm.gui.layer.Layer; 9 7 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 10 8 import org.openstreetmap.josm.io.IllegalDataException; 11 9 import org.openstreetmap.josm.io.session.SessionReader.ImportSupport; 10 import org.w3c.dom.Element; 12 11 13 12 public interface SessionLayerImporter { 13 14 14 /** 15 15 * Load the layer from xml meta-data. 16 * @param elem XML element 17 * @param support support class providing import utilities 18 * @param progressMonitor progress monitor 19 * @return the resulting layer 20 * @throws IOException if any I/O error occurs 21 * @throws IllegalDataException if invalid data is read 16 22 */ 17 23 Layer load(Element elem, ImportSupport support, ProgressMonitor progressMonitor) throws IOException, IllegalDataException; -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r8850 r8926 196 196 * Returns null if the URI points to a file inside the zip archive. 197 197 * In this case, inZipPath will be set to the corresponding path. 198 * @param uriStr the URI as string 199 * @return the resulting File 200 * @throws IOException if any I/O error occurs 198 201 */ 199 202 public File getFile(String uriStr) throws IOException { -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r8836 r8926 142 142 * @return the OutputStream you can write to. Never close the returned 143 143 * output stream, but make sure to flush buffers. 144 * @throws IOException if any I/O error occurs 144 145 */ 145 146 public OutputStream getOutputStreamZip(String zipPath) throws IOException { -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r8840 r8926 83 83 along with this program; if not, write to the Free Software 84 84 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 85 86 85 */ 87 88 86 public class Diff { 89 87 … … 94 92 be needed again later to print the results of the comparison as 95 93 an edit script, if desired. 94 * @param a first array 95 * @param b second array 96 96 */ 97 97 public Diff(Object[] a, Object[] b) { -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r8924 r8926 222 222 223 223 /** 224 * return the modulus in the range [0, n) 224 * Return the modulus in the range [0, n) 225 * @param a dividend 226 * @param n divisor 227 * @return modulo (remainder of the Euclidian division of a by n) 225 228 */ 226 229 public static int mod(int a, int n) { -
trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java
r8811 r8926 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.tools.template_engine; 3 4 3 5 4 import static org.openstreetmap.josm.tools.I18n.tr; … … 15 14 import org.openstreetmap.josm.tools.template_engine.Tokenizer.TokenType; 16 15 17 16 /** 17 * Template parser. 18 */ 18 19 public class TemplateParser { 19 20 private final Tokenizer tokenizer; … … 22 23 private static final Collection<TokenType> CONDITION_WITH_APOSTROPHES_END_TOKENS = Arrays.asList(TokenType.APOSTROPHE); 23 24 25 /** 26 * Constructs a new {@code TemplateParser}. 27 * @param template template to parse 28 */ 24 29 public TemplateParser(String template) { 25 30 this.tokenizer = new Tokenizer(template); … … 34 39 } 35 40 41 /** 42 * Parse the template. 43 * @return the resulting template entry 44 * @throws ParseError if the template cannot be parsed 45 */ 36 46 public TemplateEntry parse() throws ParseError { 37 47 return parseExpression(EXPRESSION_END_TOKENS); … … 91 101 result.getEntries().add(new SearchExpressionCondition( 92 102 SearchCompiler.compile(searchExpression.getText()), condition)); 93 } catch ( org.openstreetmap.josm.actions.search.SearchCompiler.ParseError e) {103 } catch (SearchCompiler.ParseError e) { 94 104 throw new ParseError(searchExpression.getPosition(), e); 95 105 } … … 121 131 Match match = SearchCompiler.compile(searchExpression.getText()); 122 132 result = new ContextSwitchTemplate(match, template, searchExpression.getPosition()); 123 } catch ( org.openstreetmap.josm.actions.search.SearchCompiler.ParseError e) {133 } catch (SearchCompiler.ParseError e) { 124 134 throw new ParseError(searchExpression.getPosition(), e); 125 135 } … … 129 139 return result; 130 140 } 131 132 141 } -
trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
r8510 r8926 10 10 import java.io.File; 11 11 import java.io.FileInputStream; 12 import java.io.FileNotFoundException; 12 13 import java.io.FileOutputStream; 13 14 import java.io.IOException; … … 174 175 /** 175 176 * Setup test. 177 * @throws IOException if any I/O error occurs 178 * @throws IllegalDataException if an error was found while parsing the OSM data 179 * @throws FileNotFoundException if the dataset file cannot be found 176 180 */ 177 181 @Before 178 public void setUp() throws IOException, IllegalDataException {182 public void setUp() throws IOException, IllegalDataException, FileNotFoundException { 179 183 File f = new File(System.getProperty("java.io.tmpdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset"); 180 184 logger.info(MessageFormat.format("reading cached dataset ''{0}''", f.toString())); -
trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
r8540 r8926 10 10 import java.io.File; 11 11 import java.io.FileInputStream; 12 import java.io.FileNotFoundException; 12 13 import java.io.FileOutputStream; 13 14 import java.io.IOException; … … 130 131 * @param ds the data set 131 132 * @throws OsmTransferException if something goes wrong 133 * @throws CyclicUploadDependencyException if a cyclic dependency is detected 132 134 */ 133 135 public static void createDataSetOnServer(APIDataSet ds) throws OsmTransferException, CyclicUploadDependencyException { … … 144 146 static DataSet testDataSet; 145 147 148 /** 149 * Setup test. 150 * @throws OsmTransferException if something goes wrong 151 * @throws CyclicUploadDependencyException if a cyclic dependency is detected 152 */ 146 153 @BeforeClass 147 public static void init() throws OsmTransferException, CyclicUploadDependencyException {154 public static void setUpBeforeClass() throws OsmTransferException, CyclicUploadDependencyException { 148 155 logger.info("initializing ..."); 149 156 … … 195 202 /** 196 203 * Setup test. 204 * @throws IOException if any I/O error occurs 205 * @throws IllegalDataException if an error was found while parsing the OSM data 206 * @throws FileNotFoundException if the dataset file cannot be found 197 207 */ 198 208 @Before 199 public void setUp() throws IOException, IllegalDataException {209 public void setUp() throws IOException, IllegalDataException, FileNotFoundException { 200 210 File f = new File(System.getProperty("java.io.tmpdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset"); 201 211 logger.info(MessageFormat.format("reading cached dataset ''{0}''", f.toString())); -
trunk/test/performance/org/openstreetmap/josm/data/osm/OsmDataGenerator.java
r8655 r8926 111 111 /** 112 112 * Create a random node and add it to the dataset. 113 * @param ds the data set 113 114 * @return a random node 114 115 */ -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java
r7937 r8926 6 6 7 7 import java.io.FileInputStream; 8 import java.io.FileNotFoundException; 9 import java.io.IOException; 8 10 import java.io.InputStream; 9 11 … … 13 15 import org.openstreetmap.josm.data.osm.DataSet; 14 16 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 17 import org.openstreetmap.josm.io.IllegalDataException; 15 18 import org.openstreetmap.josm.io.OsmReader; 16 19 20 /** 21 * Unit tests of {@code UnconnectedWays} class. 22 */ 17 23 public class UnconnectedWaysTest { 18 24 19 UnconnectedWays bib;25 private UnconnectedWays bib; 20 26 21 27 /** 22 28 * Setup test. 29 * @throws Exception if the test cannot be initialized 23 30 */ 24 31 @Before … … 30 37 } 31 38 39 /** 40 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/6313">Bug #6313</a>. 41 * @throws IOException if any I/O error occurs 42 * @throws IllegalDataException if the OSM data cannot be parsed 43 * @throws FileNotFoundException if the data file cannot be found 44 */ 32 45 @Test 33 public void testTicket6313() throws Exception {46 public void testTicket6313() throws IOException, IllegalDataException, FileNotFoundException { 34 47 try (InputStream fis = new FileInputStream("data_nodist/UnconnectedWaysTest.osm")) { 35 48 final DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); -
trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEngineTest.java
r8857 r8926 30 30 } 31 31 32 /** 33 * Test to parse an empty string. 34 * @throws ParseError if the template cannot be parsed 35 */ 32 36 @Test 33 37 public void testEmpty() throws ParseError { … … 36 40 } 37 41 42 /** 43 * Test to parse a variable. 44 * @throws ParseError if the template cannot be parsed 45 */ 38 46 @Test 39 47 public void testVariable() throws ParseError { … … 43 51 } 44 52 53 /** 54 * Test to parse a condition with whitespaces. 55 * @throws ParseError if the template cannot be parsed 56 */ 45 57 @Test 46 58 public void testConditionWhitespace() throws ParseError { … … 53 65 } 54 66 67 /** 68 * Test to parse a condition without whitespace. 69 * @throws ParseError if the template cannot be parsed 70 */ 55 71 @Test 56 72 public void testConditionNoWhitespace() throws ParseError { … … 63 79 } 64 80 65 private static Match compile(String expression) throws org.openstreetmap.josm.actions.search.SearchCompiler.ParseError {81 private static Match compile(String expression) throws SearchCompiler.ParseError { 66 82 return SearchCompiler.compile(expression); 67 83 } 68 84 69 @Test 70 public void testConditionSearchExpression() throws Exception { 85 /** 86 * Test to parse a search expression condition. 87 * @throws ParseError if the template cannot be parsed 88 * @throws SearchCompiler.ParseError if an error has been encountered while compiling 89 */ 90 @Test 91 public void testConditionSearchExpression() throws ParseError, SearchCompiler.ParseError { 71 92 TemplateParser parser = new TemplateParser("?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' | '{admin_level}'}"); 72 93 Condition condition = new Condition(); … … 108 129 }; 109 130 110 @Test 111 public void testFilling() throws Exception { 131 /** 132 * Test to fill a template. 133 * @throws ParseError if the template cannot be parsed 134 */ 135 @Test 136 public void testFilling() throws ParseError { 112 137 TemplateParser parser = new TemplateParser("{name} u{unknown}u i{number}i"); 113 138 TemplateEntry entry = parser.parse(); … … 117 142 } 118 143 119 @Test 120 public void testFillingSearchExpression() throws Exception { 144 /** 145 * Test to parse a search expression. 146 * @throws ParseError if the template cannot be parsed 147 */ 148 @Test 149 public void testFillingSearchExpression() throws ParseError { 121 150 TemplateParser parser = new TemplateParser("?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' | '{admin_level}'}"); 122 151 TemplateEntry templateEntry = parser.parse(); … … 134 163 } 135 164 136 @Test 137 public void testPrintAll() throws Exception { 165 /** 166 * Test to print all. 167 * @throws ParseError if the template cannot be parsed 168 */ 169 @Test 170 public void testPrintAll() throws ParseError { 138 171 TemplateParser parser = new TemplateParser("{special:everything}"); 139 172 TemplateEntry entry = parser.parse(); … … 143 176 } 144 177 145 @Test 146 public void testPrintMultiline() throws Exception { 178 /** 179 * Test to print on several lines. 180 * @throws ParseError if the template cannot be parsed 181 */ 182 @Test 183 public void testPrintMultiline() throws ParseError { 147 184 TemplateParser parser = new TemplateParser("{name}\\n{number}"); 148 185 TemplateEntry entry = parser.parse(); … … 152 189 } 153 190 154 @Test 155 public void testSpecialVariable() throws Exception { 191 /** 192 * Test to print special variables. 193 * @throws ParseError if the template cannot be parsed 194 */ 195 @Test 196 public void testSpecialVariable() throws ParseError { 156 197 TemplateParser parser = new TemplateParser("{name}u{special:localName}u{special:special:key}"); 157 198 TemplateEntry templateEntry = parser.parse(); … … 169 210 } 170 211 171 @Test 172 public void testSwitchContext() throws Exception { 212 /** 213 * Test to switch context. 214 * @throws ParseError if the template cannot be parsed 215 */ 216 @Test 217 public void testSwitchContext() throws ParseError { 173 218 TemplateParser parser = new TemplateParser("!{parent() type=parent2 '{name}'}"); 174 219 DatasetFactory ds = new DatasetFactory(); … … 208 253 parent1.addMember(new RelationMember("", child2)); 209 254 parent2.addMember(new RelationMember("", child2)); 210 211 255 212 256 StringBuilder sb = new StringBuilder();
Note:
See TracChangeset
for help on using the changeset viewer.