int contentStartIndex = rawAnnotationString.indexOf('('); if (contentStartIndex != -1 && !rawAnnotationString.endsWith(")")) { throw new SourceParseException("annotation not well-formed, needs to end with a closing parenthesis [" + rawAnnotationString + "]"); }  String value; if (contentStartIndex != -1) { value = rawAnnotationString.substring(contentStartIndex + 1, rawAnnotationString.length() - 1); } else { value = tag.getValue(); if (value.length()>0 && !value.startsWith("\"")) {
if (rawAnnotationString.length() > annotationName.length()) { String rawValueString = rawAnnotationString.substring(annotationName.length()); rawValueString = rawValueString.trim(); char first = rawValueString.charAt(0); if (first == '(') { if (!rawValueString.endsWith(")")) { throw new CompilerException("annotation not well-formed, needs to end with a closing parenthesis [" + rawAnnotationString + "]", SourceLocation.render(annotationClass, tag, enclosingClassName, enclosingClassFileName) ); } return new RawAnnotation(annotationClass, rawValueString.substring(1, rawValueString.length()-1), tag.getLineNumber(), enclosingClassName, enclosingClassFileName); } else if (first == '"') { if (!rawValueString.endsWith("\"")) { throw new CompilerException("annotation not well-formed, needs to end with a closing \" [" + rawAnnotationString + "]", SourceLocation.render(annotationClass, tag, enclosingClassName, enclosingClassFileName) ); } return new RawAnnotation(annotationClass, rawValueString, tag.getLineNumber(), enclosingClassName, enclosingClassFileName); } else {
    public static RawAnnotation getRawAnnotation(final Class annotationClass, final DocletTag tag, final String enclosingClassName, final String enclosingClassFileName) {        String rawAnnotationString = tag.getName() + " " + tag.getValue();        rawAnnotationString = rawAnnotationString.trim();        removeFormattingCharacters(rawAnnotationString);        int contentStartIndex = rawAnnotationString.indexOf('(');        if (contentStartIndex != -1 && !rawAnnotationString.endsWith(")")) {            throw new SourceParseException("annotation not well-formed, needs to end with a closing parenthesis [" + rawAnnotationString + "]");        }        String value;        if (contentStartIndex != -1) {            value = rawAnnotationString.substring(contentStartIndex + 1, rawAnnotationString.length() - 1);        } else {            value = tag.getValue();            if (value.length()>0 && !value.startsWith("\"")) {                StringBuffer sb = new StringBuffer("\"");                for (int i = 0; i < value.length(); i++) {                    char c = value.charAt(i);                    if (c == '\"') {                        sb.append("\\\"");                    } else {                        sb.append(c);                    }                }                value = sb.append("\"").toString();            }        }        return new RawAnnotation(annotationClass, value, tag.getLineNumber(), enclosingClassName, enclosingClassFileName);    }