DevBoost / JaMoPP

JaMoPP can parse Java source and byte code into EMF-based models and vice versa. It preserves source formatting and can be used for code analysis and refactoring.
17 stars 18 forks source link

IJavaOptions handling in JavaResource #19

Closed BenjaminKlatt closed 10 years ago

BenjaminKlatt commented 10 years ago

The methods JavaResource.isLocationMapEnabled()and JavaResource.isLayoutInformationRecordingEnabled() do only check if the accoreding IJavaOptions are set, not what there concrete values are.

This must be changed for example from

protected boolean isLocationMapEnabled() {
  if (loadOptions == null) {
    return true;
  }
  return !loadOptions.containsKey(org.emftext.language.java.resource.java.IJavaOptions.DISABLE_LOCATION_MAP);
}

to

protected boolean isLocationMapEnabled() {
  if (loadOptions == null) {
    return true;
  }
  return !loadOptions.containsKey(org.emftext.language.java.resource.java.IJavaOptions.DISABLE_LOCATION_MAP)
    || loadOptions.get(org.emftext.language.java.resource.java.IJavaOptions.DISABLE_LOCATION_MAP) == Boolean.FALSE;
}

Because JavaResource is fully generated by EMF Text, the prefered solution would be to adapt the generator.

BenjaminKlatt commented 10 years ago

This is fixed with the latest EMFText version