<commit_before>/*
 * JLibs: Common Utilities for Java
 * Copyright (C) 2009  <NAME>
 * <p/>
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * <p/>
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */

package jlibs.core.annotation.processing;

import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
import javax.tools.Diagnostic;

/**
 * @author <NAME>
 */
public class AnnotationError extends Error{
    private Element pos1;
    private AnnotationMirror pos2;
    private AnnotationValue pos3;

    public AnnotationError(String message){
        this(null, null, message);
    }

    public AnnotationError(Element pos, String message){
        this(pos, null, message);
    }

    public AnnotationError(Element pos1, AnnotationMirror pos2, String message){
        super(message);
        this.pos1 = pos1;
        this.pos2 = pos2;
    }

    public AnnotationError(Element pos1, AnnotationMirror pos2, AnnotationValue pos3, String message){
        super(message);
        this.pos1 = pos1;
        this.pos2 = pos2;
        this.pos3 = pos3;
    }

    public void report(){
        if(pos1==null)
            Environment.get().getMessager().printMessage(Diagnostic.Kind.ERROR, getMessage());
        else if(pos2==null)
            Environment.get().getMessager().printMessage(Diagnostic.Kind.ERROR, getMessage(), pos1);
        else if(pos3==null)
            Environment.get().getMessager().printMessage(Diagnostic.Kind.ERROR, getMessage(), pos1, pos2);
        else{
            System.out.println("came here");
            Environment.get().getMessager().printMessage(Diagnostic.Kind.ERROR, getMessage(), pos1, pos2, pos3);
        }
    }
}<commit_msg>removed debug message<commit_after>/*
 * JLibs: Common Utilities for Java
 * Copyright (C) 2009  <NAME>
 * <p/>
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * <p/>
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */

package jlibs.core.annotation.processing;

import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
import javax.tools.Diagnostic;

/**
 * @author <NAME>
 */
public class AnnotationError extends Error{
    private Element pos1;
    private AnnotationMirror pos2;
    private AnnotationValue pos3;

    public AnnotationError(String message){
        this(null, null, message);
    }

    public AnnotationError(Element pos, String message){
        this(pos, null, message);
    }

    public AnnotationError(Element pos1, AnnotationMirror pos2, String message){
        super(message);
        this.pos1 = pos1;
        this.pos2 = pos2;
    }

    public AnnotationError(Element pos1, AnnotationMirror pos2, AnnotationValue pos3, String message){
        super(message);
        this.pos1 = pos1;
        this.pos2 = pos2;
        this.pos3 = pos3;
    }

    public void report(){
        if(pos1==null)
            Environment.get().getMessager().printMessage(Diagnostic.Kind.ERROR, getMessage());
        else if(pos2==null)
            Environment.get().getMessager().printMessage(Diagnostic.Kind.ERROR, getMessage(), pos1);
        else if(pos3==null)
            Environment.get().getMessager().printMessage(Diagnostic.Kind.ERROR, getMessage(), pos1, pos2);
        else
            Environment.get().getMessager().printMessage(Diagnostic.Kind.ERROR, getMessage(), pos1, pos2, pos3);
    }
}
{'fraction_non_alphanumeric': 0.10139860139860139, 'fraction_numerical': 0.015384615384615385, 'mean_word_length': 3.2401185770750986, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1692375', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1171, 'n_words': 372}