J2ObjC: Only output Kythe mappings for valid Java source positions
Change on 2018/07/16 by duffin
@@ -81,9 +81,12 @@ public class GeneratedSourceMappings {
private int targetOffset = 0;
public void addMethodMapping(MethodDeclaration methodDeclaration, int targetBegin, int length) {
+ assert methodDeclaration.getName() != null;
+ if (methodDeclaration.getName().getStartPosition() != -1) {
mappings.add(
Mapping.fromMethodDeclaration(methodDeclaration, targetBegin, targetBegin + length));
}
+ }
public Set<Mapping> getMappings() {
return Collections.unmodifiableSet(mappings);
