- Timestamp:
- 2020-04-19T14:54:59+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainInitialization.java
r16321 r16358 8 8 import java.util.Arrays; 9 9 import java.util.Collection; 10 import java.util.Collections; 10 11 import java.util.List; 11 12 import java.util.Objects; … … 37 38 import org.openstreetmap.josm.tools.Logging; 38 39 import org.openstreetmap.josm.tools.OpenBrowser; 39 import org.openstreetmap.josm.tools.OverpassTurboQueryWizard;40 40 import org.openstreetmap.josm.tools.PlatformManager; 41 41 import org.openstreetmap.josm.tools.Shortcut; … … 127 127 @Override 128 128 public List<Callable<?>> asynchronousCallableTasks() { 129 return Arrays.asList( 130 OverpassTurboQueryWizard::getInstance 131 ); 129 return Collections.emptyList(); 132 130 } 133 131 -
trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java
r16355 r16358 16 16 import org.openstreetmap.josm.gui.download.overpass.OverpassWizardRegistration.OverpassWizardCallbacks; 17 17 import org.openstreetmap.josm.tools.Logging; 18 import org.openstreetmap.josm.tools. OverpassTurboQueryWizard;18 import org.openstreetmap.josm.tools.SearchCompilerQueryWizard; 19 19 import org.openstreetmap.josm.tools.UncheckedParseException; 20 20 import org.openstreetmap.josm.tools.Utils; … … 82 82 83 83 /** 84 * Tries to process a search term using {@link OverpassTurboQueryWizard}. If the term cannot84 * Tries to process a search term using {@link SearchCompilerQueryWizard}. If the term cannot 85 85 * be parsed, the the corresponding dialog is shown. 86 86 * @param searchTerm The search term to parse. … … 91 91 private Optional<String> tryParseSearchTerm(String searchTerm) { 92 92 try { 93 return Optional.of( OverpassTurboQueryWizard.getInstance().constructQuery(searchTerm));93 return Optional.of(SearchCompilerQueryWizard.getInstance().constructQuery(searchTerm)); 94 94 } catch (UncheckedParseException | IllegalStateException ex) { 95 95 Logging.error(ex); -
trunk/src/org/openstreetmap/josm/tools/SearchCompilerQueryWizard.java
r16357 r16358 24 24 * @since 8744 (using tyrasd/overpass-wizard), 16262 (standalone) 25 25 */ 26 public final class OverpassTurboQueryWizard {27 28 private static final OverpassTurboQueryWizard instance = newOverpassTurboQueryWizard();26 public final class SearchCompilerQueryWizard { 27 28 private static final SearchCompilerQueryWizard instance = new SearchCompilerQueryWizard(); 29 29 30 30 /** … … 33 33 * @return the unique instance of this class 34 34 */ 35 public static OverpassTurboQueryWizard getInstance() {35 public static SearchCompilerQueryWizard getInstance() { 36 36 return instance; 37 37 } 38 38 39 private OverpassTurboQueryWizard() {39 private SearchCompilerQueryWizard() { 40 40 // private constructor for utility class 41 41 } … … 182 182 private static List<Match> normalizeToDNF(final Match match) { 183 183 if (match instanceof SearchCompiler.And) { 184 return ((SearchCompiler.And) match).map( OverpassTurboQueryWizard::normalizeToDNF, (lhs, rhs) -> lhs.stream()184 return ((SearchCompiler.And) match).map(SearchCompilerQueryWizard::normalizeToDNF, (lhs, rhs) -> lhs.stream() 185 185 .flatMap(l -> rhs.stream().map(r -> new SearchCompiler.And(l, r))) 186 186 .collect(Collectors.toList())); 187 187 } else if (match instanceof SearchCompiler.Or) { 188 return ((SearchCompiler.Or) match).map( OverpassTurboQueryWizard::normalizeToDNF, CompositeList::new);188 return ((SearchCompiler.Or) match).map(SearchCompilerQueryWizard::normalizeToDNF, CompositeList::new); 189 189 } else if (match instanceof SearchCompiler.Xor) { 190 190 throw new UnsupportedOperationException(match.toString());
Note:
See TracChangeset
for help on using the changeset viewer.