Update only open parser

This commit is contained in:
Victor Shcherb 2015-04-10 01:34:46 +02:00
parent 992365e02b
commit 12ebbd0965
2 changed files with 10 additions and 7 deletions

View file

@ -654,6 +654,9 @@ public class OpeningHoursParser {
* @return null when parsing was unsuccessful
*/
public static OpeningHours parseOpenedHours(String format){
if(format == null) {
return null;
}
// split the OSM string in multiple rules
String[] rules = format.split(";"); //$NON-NLS-1$
// FIXME: What if the semicolon is inside a quoted string?

View file

@ -270,14 +270,14 @@ public class PoiLegacyFilter implements SearchPoiTypeFilter {
@Override
public boolean accept(Amenity a) {
if(sm != null) {
String lower = OsmAndFormatter.getPoiStringWithoutType(a, en);
if(!sm.matches(lower)) {
return false;
if (sm != null) {
String lower = OsmAndFormatter.getPoiStringWithoutType(a, en);
if (!sm.matches(lower)) {
return false;
}
}
}
if(allTime) {
if(!"24/7".equalsIgnoreCase(a.getOpeningHours())) {
if (allTime) {
if (!"24/7".equalsIgnoreCase(a.getOpeningHours())) {
return false;
}
}