/**
  * Turn annotation processing on or off for this project.
  *
  * <p>Prior to Eclipse 3.3, this affected the org.eclipse.jdt.apt.aptEnabled setting. In Eclipse
  * 3.3, it affects the org.eclipse.jdt.core.compiler.processingEnabled setting; the older setting
  * is still set (and read) in order to preserve backward compatibility.
  *
  * @param jproject an IJavaProject, or null to set workspace preferences.
  * @param enabled
  */
 public static void setEnabled(IJavaProject jproject, boolean enabled) {
   if (jproject == null && enabled == true) {
     IllegalArgumentException e = new IllegalArgumentException();
     IStatus status =
         AptPlugin.createWarningStatus(
             e, "Illegal attempt to enable annotation processing workspace-wide"); // $NON-NLS-1$
     AptPlugin.log(status);
     throw e;
   }
   setString(
       jproject,
       AptPreferenceConstants.APT_PROCESSANNOTATIONS,
       enabled ? AptPreferenceConstants.ENABLED : AptPreferenceConstants.DISABLED);
   // backward compatibility: also save old setting
   setBoolean(jproject, AptPreferenceConstants.APT_ENABLED, enabled);
 }