Changeset 3840 in josm
- Timestamp:
- 2011-02-01T17:12:54+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r3815 r3840 656 656 put(key, s); 657 657 } 658 return Arrays.asList(s.split("\u001e" ));658 return Arrays.asList(s.split("\u001e", -1)); 659 659 } 660 660 return Collections.emptyList(); … … 670 670 return put(key, join("\u001e", val)); 671 671 } 672 672 673 673 synchronized private void putCollectionDefault(String key, Collection<String> val) { 674 674 putDefault(key, join("\u001e", val)); 675 675 } 676 676 677 677 /** 678 678 * Used to read a 2-dimensional array of strings from the preference file. -
trunk/src/org/openstreetmap/josm/tools/Base64.java
r662 r3840 6 6 public class Base64 { 7 7 8 private static String enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 8 private static String encDefault = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 9 private static String encUrlSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; 9 10 10 11 public static String encode(String s) { 12 return encode(s, false); 13 } 14 15 public static String encode(String s, boolean urlsafe) { 11 16 StringBuilder out = new StringBuilder(); 17 String enc = urlsafe ? encUrlSafe : encDefault; 12 18 for (int i = 0; i < (s.length()+2)/3; ++i) { 13 19 int l = Math.min(3, s.length()-i*3); … … 26 32 27 33 public static String encode(ByteBuffer s) { 34 return encode(s, false); 35 } 36 37 public static String encode(ByteBuffer s, boolean urlsafe) { 28 38 StringBuilder out = new StringBuilder(); 39 String enc = urlsafe ? encUrlSafe : encDefault; 29 40 // Read 3 bytes at a time. 30 41 for (int i = 0; i < (s.limit()+2)/3; ++i) { -
trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r3832 r3840 14 14 import java.io.StringWriter; 15 15 import java.net.URL; 16 import java.nio.ByteBuffer; 16 17 17 18 import javax.swing.JLabel; … … 20 21 import javax.swing.JScrollPane; 21 22 import javax.swing.JTextArea; 22 23 import org.apache.commons.codec.binary.Base64;24 23 25 24 import org.openstreetmap.josm.Main; … … 109 108 110 109 URL url = new URL("http://josm.openstreetmap.de/josmticket?" + 111 "tdata="+Base64.encode Base64URLSafeString(urltext.getBytes("UTF8")));110 "tdata="+Base64.encode(ByteBuffer.wrap(urltext.getBytes("UTF8")), true)); 112 111 113 112 JPanel p = new JPanel(new GridBagLayout());
Note:
See TracChangeset
for help on using the changeset viewer.