Changeset 11942 in josm
- Timestamp:
- 2017-04-17T04:58:33+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r11746 r11942 707 707 protected List<CheckerElement> data = new ArrayList<>(); 708 708 private OsmPrimitiveType type; 709 private int code;709 private TagCheckLevel level; 710 710 protected Severity severity; 711 // CHECKSTYLE.OFF: SingleSpaceSeparator 712 protected static final int TAG_CHECK_ERROR = 1250; 713 protected static final int TAG_CHECK_WARN = 1260; 714 protected static final int TAG_CHECK_INFO = 1270; 715 // CHECKSTYLE.ON: SingleSpaceSeparator 711 712 private enum TagCheckLevel { 713 TAG_CHECK_ERROR(1250), 714 TAG_CHECK_WARN(1260), 715 TAG_CHECK_INFO(1270); 716 717 final int code; 718 719 TagCheckLevel(int code) { 720 this.code = code; 721 } 722 } 716 723 717 724 protected static class CheckerElement { … … 809 816 case "W": 810 817 severity = Severity.WARNING; 811 code =TAG_CHECK_WARN;818 level = TagCheckLevel.TAG_CHECK_WARN; 812 819 break; 813 820 case "E": 814 821 severity = Severity.ERROR; 815 code =TAG_CHECK_ERROR;822 level = TagCheckLevel.TAG_CHECK_ERROR; 816 823 break; 817 824 case "I": 818 825 severity = Severity.OTHER; 819 code =TAG_CHECK_INFO;826 level = TagCheckLevel.TAG_CHECK_INFO; 820 827 break; 821 828 default: … … 847 854 } 848 855 856 /** 857 * Returns the error description. 858 * @return the error description 859 */ 849 860 public String getDescription() { 850 861 return description; 851 862 } 852 863 864 /** 865 * Returns the error severity. 866 * @return the error severity 867 */ 853 868 public Severity getSeverity() { 854 869 return severity; 855 870 } 856 871 872 /** 873 * Returns the error code. 874 * @return the error code 875 */ 857 876 public int getCode() { 858 877 if (type == null) 859 return code; 860 861 return code + type.ordinal() + 1; 878 return level.code; 879 880 return level.code + type.ordinal() + 1; 862 881 } 863 882 }
Note:
See TracChangeset
for help on using the changeset viewer.