Changeset 6987 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-04-16T02:29:53+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r6920 r6987 457 457 } 458 458 459 String full _name = subdir + name + ext;460 String cache _name = full_name;459 String fullName = subdir + name + ext; 460 String cacheName = fullName; 461 461 /* cache separately */ 462 462 if (dirs != null && !dirs.isEmpty()) { 463 cache _name = "id:" + id + ":" + full_name;463 cacheName = "id:" + id + ":" + fullName; 464 464 if(archive != null) { 465 cache _name += ":" + archive.getName();465 cacheName += ":" + archive.getName(); 466 466 } 467 467 } 468 468 469 ImageResource ir = cache.get(cache _name);469 ImageResource ir = cache.get(cacheName); 470 470 if (ir != null) return ir; 471 471 … … 473 473 case ARCHIVE: 474 474 if (archive != null) { 475 ir = getIfAvailableZip(full _name, archive, inArchiveDir, type);475 ir = getIfAvailableZip(fullName, archive, inArchiveDir, type); 476 476 if (ir != null) { 477 cache.put(cache _name, ir);477 cache.put(cacheName, ir); 478 478 return ir; 479 479 } … … 486 486 // and don't bother to create a URL unless we're actually 487 487 // creating the image. 488 URL path = getImageUrl(full _name, dirs, additionalClassLoaders);488 URL path = getImageUrl(fullName, dirs, additionalClassLoaders); 489 489 if (path == null) { 490 490 continue; … … 492 492 ir = getIfAvailableLocalURL(path, type); 493 493 if (ir != null) { 494 cache.put(cache _name, ir);494 cache.put(cacheName, ir); 495 495 return ir; 496 496 } … … 602 602 } 603 603 604 private static ImageResource getIfAvailableZip(String full _name, File archive, String inArchiveDir, ImageType type) {604 private static ImageResource getIfAvailableZip(String fullName, File archive, String inArchiveDir, ImageType type) { 605 605 ZipFile zipFile = null; 606 try 607 { 606 try { 608 607 zipFile = new ZipFile(archive); 609 608 if (inArchiveDir == null || inArchiveDir.equals(".")) { … … 612 611 inArchiveDir += "/"; 613 612 } 614 String entry _name = inArchiveDir + full_name;615 ZipEntry entry = zipFile.getEntry(entry _name);613 String entryName = inArchiveDir + fullName; 614 ZipEntry entry = zipFile.getEntry(entryName); 616 615 if(entry != null) 617 616 { … … 624 623 switch (type) { 625 624 case SVG: 626 URI uri = getSvgUniverse().loadSVG(is, entry _name);625 URI uri = getSvgUniverse().loadSVG(is, entryName); 627 626 SVGDiagram svg = getSvgUniverse().getDiagram(uri); 628 627 return svg == null ? null : new ImageResource(svg); … … 755 754 /** Quit parsing, when a certain condition is met */ 756 755 class SAXReturnException extends SAXException { 757 private String result;756 private final String result; 758 757 759 758 public SAXReturnException(String result) {
Note:
See TracChangeset
for help on using the changeset viewer.