Changeset 10965 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2016-09-05T23:50:16+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
r10762 r10965 201 201 IDiskCacheAttributes ret; 202 202 removeStaleFiles(cachePath + File.separator + cacheName, USE_BLOCK_CACHE.get() ? "_INDEX_v2" : "_BLOCK_v2"); 203 cacheName = cacheName + (USE_BLOCK_CACHE.get() ? "_BLOCK_v2" : "_INDEX_v2");203 String newCacheName = cacheName + (USE_BLOCK_CACHE.get() ? "_BLOCK_v2" : "_INDEX_v2"); 204 204 205 205 if (USE_BLOCK_CACHE.get()) { … … 211 211 * wants to reduce the file size, (s)he may just go to preferences and there it should be handled (by removing old file) 212 212 */ 213 File diskCacheFile = new File(cachePath + File.separator + cacheName + ".data");213 File diskCacheFile = new File(cachePath + File.separator + newCacheName + ".data"); 214 214 if (diskCacheFile.exists()) { 215 215 blockAttr.setMaxKeySize((int) Math.max(maxDiskObjects, diskCacheFile.length()/1024)); … … 231 231 ret.setDiskPath(cachePath); 232 232 } 233 ret.setCacheName( cacheName);233 ret.setCacheName(newCacheName); 234 234 235 235 return ret; -
trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java
r10938 r10965 414 414 double up = (vp * cosgamma0 + sp * singamma0) / (0.5 * (qp + temp)); 415 415 if (Math.abs(Math.abs(up) - 1.0) < EPSILON) { 416 x = 0.0; 417 y = up < 0.0 ? -Math.PI / 2.0 : Math.PI / 2.0; 416 return new double[] { 417 up < 0.0 ? -(Math.PI / 2.0) : (Math.PI / 2.0), 418 0.0}; 418 419 } else { 419 y = Math.pow(e / Math.sqrt((1. + up) / (1. - up)), 1.0 / b); //calculate t 420 y = cphi2(y); 421 x = -Math.atan2(sp * cosgamma0 - vp * singamma0, Math.cos(bra * u)) / b; 422 } 423 return new double[] {y, x}; 420 return new double[] { 421 cphi2(Math.pow(e / Math.sqrt((1. + up) / (1. - up)), 1.0 / b)), //calculate t 422 -Math.atan2(sp * cosgamma0 - vp * singamma0, Math.cos(bra * u)) / b}; 423 } 424 424 } 425 425 -
trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java
r10923 r10965 157 157 return false; 158 158 } 159 domain = unicodeToASCII(domain);159 String asciiDomain = unicodeToASCII(domain); 160 160 // hosts must be equally reachable via punycode and Unicode 161 161 // Unicode is never shorter than punycode, so check punycode 162 162 // if domain did not convert, then it will be caught by ASCII 163 163 // checks in the regexes below 164 if ( domain.length() > MAX_DOMAIN_LENGTH) {164 if (asciiDomain.length() > MAX_DOMAIN_LENGTH) { 165 165 return false; 166 166 } 167 String[] groups = domainRegex.match( domain);167 String[] groups = domainRegex.match(asciiDomain); 168 168 if (groups != null && groups.length > 0) { 169 169 return isValidTld(groups[0]); 170 170 } 171 return allowLocal && hostnameRegex.isValid( domain);171 return allowLocal && hostnameRegex.isValid(asciiDomain); 172 172 } 173 173 … … 183 183 return false; 184 184 } 185 domain = unicodeToASCII(domain);185 String asciiDomain = unicodeToASCII(domain); 186 186 // hosts must be equally reachable via punycode and Unicode 187 187 // Unicode is never shorter than punycode, so check punycode 188 188 // if domain did not convert, then it will be caught by ASCII 189 189 // checks in the regexes below 190 if ( domain.length() > MAX_DOMAIN_LENGTH) {190 if (asciiDomain.length() > MAX_DOMAIN_LENGTH) { 191 191 return false; 192 192 } 193 String[] groups = domainRegex.match( domain);193 String[] groups = domainRegex.match(asciiDomain); 194 194 return (groups != null && groups.length > 0) 195 || hostnameRegex.isValid( domain);195 || hostnameRegex.isValid(asciiDomain); 196 196 } 197 197 … … 204 204 */ 205 205 public boolean isValidTld(String tld) { 206 tld = unicodeToASCII(tld);207 if (allowLocal && isValidLocalTld( tld)) {206 String asciiTld = unicodeToASCII(tld); 207 if (allowLocal && isValidLocalTld(asciiTld)) { 208 208 return true; 209 209 } 210 return isValidInfrastructureTld( tld)211 || isValidGenericTld( tld)212 || isValidCountryCodeTld( tld);210 return isValidInfrastructureTld(asciiTld) 211 || isValidGenericTld(asciiTld) 212 || isValidCountryCodeTld(asciiTld); 213 213 } 214 214
Note:
See TracChangeset
for help on using the changeset viewer.