(AnnotationSet source,
String type, long start, long end)
| 1063 | } |
| 1064 | |
| 1065 | private static AnnotationSet getCoextensiveAnnotationsWorker(AnnotationSet source, |
| 1066 | String type, long start, long end) { |
| 1067 | if (source instanceof gate.annotation.AnnotationSetImpl) { |
| 1068 | AnnotationSet ret = ((AnnotationSetImpl) source).getStrict(start, |
| 1069 | end); |
| 1070 | if (type != null) { |
| 1071 | return ret.get(type); |
| 1072 | } else { |
| 1073 | return ret; |
| 1074 | } |
| 1075 | } else { |
| 1076 | AnnotationSet annset = source.getContained(start, end); |
| 1077 | List<Annotation> annotationsToAdd = new ArrayList<Annotation>(); |
| 1078 | for (Annotation ann : annset) { |
| 1079 | if (start(ann) == start && end(ann) == end) { |
| 1080 | if (type == null || ann.getType().equals(type)) { |
| 1081 | annotationsToAdd.add(ann); |
| 1082 | } |
| 1083 | } |
| 1084 | } |
| 1085 | return Factory.createImmutableAnnotationSet(source.getDocument(), annotationsToAdd); |
| 1086 | } |
| 1087 | } |
| 1088 | |
| 1089 | /** |
| 1090 | * This will replace all occurrences of variables of the form $env{name}, |
no test coverage detected