Changeset 19637 in josm for trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java
- Timestamp:
- 2026-10-06T08:57:52+02:00 (5 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java
r19535 r19637 5 5 import java.io.Serializable; 6 6 import java.lang.reflect.InvocationTargetException; 7 import java.nio.file.InvalidPathException; 7 8 import java.util.ArrayList; 8 9 import java.util.Arrays; … … 22 23 import org.openstreetmap.josm.tools.Logging; 23 24 import org.openstreetmap.josm.tools.StreamUtils; 25 import org.openstreetmap.josm.tools.Utils; 24 26 25 27 /** … … 279 281 280 282 /** 283 * Check if this is caused by the name of a file which cannot be represented in the character set Java uses for 284 * file names. Java takes that character set from the locale, so this happens when JOSM runs in the C/POSIX locale, 285 * or with a locale which is not installed: file names are then ASCII only, and opening a folder which holds a 286 * non-ASCII name fails. See #14596. 287 * @return <code>true</code> if it is. 288 * @since 19637 289 */ 290 public boolean isUnmappableFileName() { 291 return !"UTF-8".equalsIgnoreCase(Utils.getSystemProperty("sun.jnu.encoding")) 292 && StreamUtils.toStream(CauseTraceIterator::new).anyMatch(t -> t instanceof InvalidPathException 293 && String.valueOf(((InvalidPathException) t).getReason()).contains("unmappable characters")); 294 } 295 296 /** 281 297 * Iterates over the causes for this exception. Ignores cycles and aborts iteration then. 282 298 * @author Michal Zangl
Note:
See TracChangeset
for help on using the changeset viewer.
