- String locAnnotationStr;
- if (inferLocMap.containsKey(fd)) {
- CompositeLocation inferLoc = inferLocMap.get(fd);
- locAnnotationStr = generateLocationAnnoatation(inferLoc);
- } else {
- // if the field is not accssed by SS part, just assigns dummy
- // location
- locAnnotationStr = "@LOC(\"LOC\")";
- }
- int fdLineNum = fd.getLineNum();
- String orgFieldDeclarationStr = sourceVec.get(fdLineNum);
- String fieldDeclaration = fd.toString();
- fieldDeclaration = fieldDeclaration.substring(0, fieldDeclaration.length() - 1);
+ // generate annotations for field declarations
+ LocationInfo fieldLocInfo = getLocationInfo(cd);
+ Map<Descriptor, CompositeLocation> inferLocMap = fieldLocInfo.getMapDescToInferLocation();