// Path: src/main/java/info/gianlucacosta/easypmd/ide/annotations/BasicAnnotation.java
// public class BasicAnnotation extends Annotation {
// 
//     private final String annotationType;
//     private final String message;
// 
//     public BasicAnnotation(String annotationType, String message) {
//         this.annotationType = annotationType;
//         this.message = message;
//     }
// 
//     @Override
//     public String getAnnotationType() {
//         return annotationType;
//     }
// 
//     @Override
//     public String getShortDescription() {
//         return message;
//     }
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/ide/options/Options.java
// public interface Options {
// 
//     static OptionsChanges computeChanges(Options oldOptions, Options newOptions) {
//         if (oldOptions == null) {
//             return OptionsChanges.ENGINE;
//         }
// 
//         boolean noEngineChanges
//                 = Objects.equals(oldOptions.getTargetJavaVersion(), newOptions.getTargetJavaVersion())
//                 && Objects.equals(oldOptions.getSourceFileEncoding(), newOptions.getSourceFileEncoding())
//                 && Objects.equals(oldOptions.getSuppressMarker(), newOptions.getSuppressMarker())
//                 && CollectionItems.equals(oldOptions.getAdditionalClassPathUrls(), newOptions.getAdditionalClassPathUrls())
//                 && CollectionItems.equals(oldOptions.getRuleSets(), newOptions.getRuleSets())
//                 && (oldOptions.isShowAllMessagesInGuardedSections() == newOptions.isShowAllMessagesInGuardedSections())
//                 && Objects.equals(oldOptions.getPathFilteringOptions(), newOptions.getPathFilteringOptions())
//                 && (oldOptions.getMinimumPriority() == newOptions.getMinimumPriority())
//                 && Objects.equals(oldOptions.getAuxiliaryClassPath(), newOptions.getAuxiliaryClassPath())
//                 && (oldOptions.isUseScanMessagesCache() == newOptions.isUseScanMessagesCache());
// 
//         if (noEngineChanges) {
//             boolean noChanges
//                     = (oldOptions.isShowRulePriorityInTasks() == newOptions.isShowRulePriorityInTasks())
//                     && (oldOptions.isShowDescriptionInTasks() == newOptions.isShowDescriptionInTasks())
//                     && (oldOptions.isShowRuleInTasks() == newOptions.isShowRuleInTasks())
//                     && (oldOptions.isShowRuleSetInTasks() == newOptions.isShowRuleSetInTasks())
//                     && (oldOptions.isShowAnnotationsInEditor() == newOptions.isShowAnnotationsInEditor());
// 
//             if (noChanges) {
//                 return OptionsChanges.NONE;
//             } else {
//                 return OptionsChanges.VIEW_ONLY;
//             }
//         } else {
//             return OptionsChanges.ENGINE;
//         }
//     }
// 
//     String getTargetJavaVersion();
// 
//     String getSourceFileEncoding();
// 
//     String getSuppressMarker();
// 
//     Collection<URL> getAdditionalClassPathUrls();
// 
//     Collection<String> getRuleSets();
// 
//     boolean isUseScanMessagesCache();
// 
//     boolean isShowRulePriorityInTasks();
// 
//     boolean isShowDescriptionInTasks();
// 
//     boolean isShowRuleInTasks();
// 
//     boolean isShowRuleSetInTasks();
// 
//     boolean isShowAnnotationsInEditor();
// 
//     boolean isShowAllMessagesInGuardedSections();
// 
//     PathFilteringOptions getPathFilteringOptions();
// 
//     RulePriority getMinimumPriority();
// 
//     String getAuxiliaryClassPath();
// 
//     Options clone();
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/pmdscanner/ScanMessage.java
// public interface ScanMessage extends Serializable {
// 
//     boolean isShowableInGuardedSections();
// 
//     int getLineNumber();
// 
//     Task createTask(Options options, FileObject fileObject);
// 
//     Annotation createAnnotation(Options options);
// }


import info.gianlucacosta.easypmd.ide.annotations.BasicAnnotation;
import info.gianlucacosta.easypmd.ide.options.Options;
import info.gianlucacosta.easypmd.pmdscanner.ScanMessage;
import net.sourceforge.pmd.RulePriority;
import net.sourceforge.pmd.RuleViolation;
import org.netbeans.spi.tasklist.Task;
import org.openide.filesystems.FileObject;
import org.openide.text.Annotation;
            case HIGH:
                return "info.gianlucacosta.easypmd.ide.tasklist.High";
            case MEDIUM_HIGH:
                return "info.gianlucacosta.easypmd.ide.tasklist.MediumHigh";
            case MEDIUM:
                return "info.gianlucacosta.easypmd.ide.tasklist.Medium";
            case MEDIUM_LOW:
                return "info.gianlucacosta.easypmd.ide.tasklist.MediumLow";
            case LOW:
                return "info.gianlucacosta.easypmd.ide.tasklist.Low";
            default:
                throw new RuntimeException(String.format("Unexpected priority value: '%s'", priority));
        }
    }

    private String formatTaskText(Options options) {
        return formatViolationComponents(
                TASK_TOKEN_SEPARATOR,
                options.isShowRulePriorityInTasks(),
                options.isShowDescriptionInTasks(),
                options.isShowRuleInTasks(),
                options.isShowRuleSetInTasks()
        );
    }

    @Override
    public Annotation createAnnotation(Options options) {
        String annotationType = getAnnotationType();
        String annotationMessage = formatAnnotationText();

// Path: src/main/java/info/gianlucacosta/easypmd/ide/annotations/BasicAnnotation.java
// public class BasicAnnotation extends Annotation {
// 
//     private final String annotationType;
//     private final String message;
// 
//     public BasicAnnotation(String annotationType, String message) {
//         this.annotationType = annotationType;
//         this.message = message;
//     }
// 
//     @Override
//     public String getAnnotationType() {
//         return annotationType;
//     }
// 
//     @Override
//     public String getShortDescription() {
//         return message;
//     }
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/ide/options/Options.java
// public interface Options {
// 
//     static OptionsChanges computeChanges(Options oldOptions, Options newOptions) {
//         if (oldOptions == null) {
//             return OptionsChanges.ENGINE;
//         }
// 
//         boolean noEngineChanges
//                 = Objects.equals(oldOptions.getTargetJavaVersion(), newOptions.getTargetJavaVersion())
//                 && Objects.equals(oldOptions.getSourceFileEncoding(), newOptions.getSourceFileEncoding())
//                 && Objects.equals(oldOptions.getSuppressMarker(), newOptions.getSuppressMarker())
//                 && CollectionItems.equals(oldOptions.getAdditionalClassPathUrls(), newOptions.getAdditionalClassPathUrls())
//                 && CollectionItems.equals(oldOptions.getRuleSets(), newOptions.getRuleSets())
//                 && (oldOptions.isShowAllMessagesInGuardedSections() == newOptions.isShowAllMessagesInGuardedSections())
//                 && Objects.equals(oldOptions.getPathFilteringOptions(), newOptions.getPathFilteringOptions())
//                 && (oldOptions.getMinimumPriority() == newOptions.getMinimumPriority())
//                 && Objects.equals(oldOptions.getAuxiliaryClassPath(), newOptions.getAuxiliaryClassPath())
//                 && (oldOptions.isUseScanMessagesCache() == newOptions.isUseScanMessagesCache());
// 
//         if (noEngineChanges) {
//             boolean noChanges
//                     = (oldOptions.isShowRulePriorityInTasks() == newOptions.isShowRulePriorityInTasks())
//                     && (oldOptions.isShowDescriptionInTasks() == newOptions.isShowDescriptionInTasks())
//                     && (oldOptions.isShowRuleInTasks() == newOptions.isShowRuleInTasks())
//                     && (oldOptions.isShowRuleSetInTasks() == newOptions.isShowRuleSetInTasks())
//                     && (oldOptions.isShowAnnotationsInEditor() == newOptions.isShowAnnotationsInEditor());
// 
//             if (noChanges) {
//                 return OptionsChanges.NONE;
//             } else {
//                 return OptionsChanges.VIEW_ONLY;
//             }
//         } else {
//             return OptionsChanges.ENGINE;
//         }
//     }
// 
//     String getTargetJavaVersion();
// 
//     String getSourceFileEncoding();
// 
//     String getSuppressMarker();
// 
//     Collection<URL> getAdditionalClassPathUrls();
// 
//     Collection<String> getRuleSets();
// 
//     boolean isUseScanMessagesCache();
// 
//     boolean isShowRulePriorityInTasks();
// 
//     boolean isShowDescriptionInTasks();
// 
//     boolean isShowRuleInTasks();
// 
//     boolean isShowRuleSetInTasks();
// 
//     boolean isShowAnnotationsInEditor();
// 
//     boolean isShowAllMessagesInGuardedSections();
// 
//     PathFilteringOptions getPathFilteringOptions();
// 
//     RulePriority getMinimumPriority();
// 
//     String getAuxiliaryClassPath();
// 
//     Options clone();
// }
// 
// Path: src/main/java/info/gianlucacosta/easypmd/pmdscanner/ScanMessage.java
// public interface ScanMessage extends Serializable {
// 
//     boolean isShowableInGuardedSections();
// 
//     int getLineNumber();
// 
//     Task createTask(Options options, FileObject fileObject);
// 
//     Annotation createAnnotation(Options options);
// }


// Path: src/main/java/info/gianlucacosta/easypmd/pmdscanner/messages/ScanViolation.java
import info.gianlucacosta.easypmd.ide.annotations.BasicAnnotation;
import info.gianlucacosta.easypmd.ide.options.Options;
import info.gianlucacosta.easypmd.pmdscanner.ScanMessage;
import net.sourceforge.pmd.RulePriority;
import net.sourceforge.pmd.RuleViolation;
import org.netbeans.spi.tasklist.Task;
import org.openide.filesystems.FileObject;
import org.openide.text.Annotation;

            case HIGH:
                return "info.gianlucacosta.easypmd.ide.tasklist.High";
            case MEDIUM_HIGH:
                return "info.gianlucacosta.easypmd.ide.tasklist.MediumHigh";
            case MEDIUM:
                return "info.gianlucacosta.easypmd.ide.tasklist.Medium";
            case MEDIUM_LOW:
                return "info.gianlucacosta.easypmd.ide.tasklist.MediumLow";
            case LOW:
                return "info.gianlucacosta.easypmd.ide.tasklist.Low";
            default:
                throw new RuntimeException(String.format("Unexpected priority value: '%s'", priority));
        }
    }

    private String formatTaskText(Options options) {
        return formatViolationComponents(
                TASK_TOKEN_SEPARATOR,
                options.isShowRulePriorityInTasks(),
                options.isShowDescriptionInTasks(),
                options.isShowRuleInTasks(),
                options.isShowRuleSetInTasks()
        );
    }

    @Override
    public Annotation createAnnotation(Options options) {
        String annotationType = getAnnotationType();
        String annotationMessage = formatAnnotationText();

        return new BasicAnnotation(