Program: 27727
Project: 27727
Buggy source:
private JsDocToken parseAnnotation(JsDocToken token,List<ExtendedTypeInfo> extendedTypes){
  JSTypeExpression type;
  int lineno=stream.getLineno();
  int charno=stream.getCharno();
  String annotationName=stream.getString();
  Annotation annotation=annotationNames.get(annotationName);
  if (annotation == null) {
    parser.addParserWarning("String_Node_Str",annotationName,stream.getLineno(),stream.getCharno());
  }
 else {
    jsdocBuilder.markAnnotation(annotationName,lineno,charno);
switch (annotation) {
case NG_INJECT:
      if (jsdocBuilder.isNgInjectRecorded()) {
        parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
      }
 else {
        jsdocBuilder.recordNgInject(true);
      }
    return eatUntilEOLIfNotAnnotation();
case JAGGER_INJECT:
  if (jsdocBuilder.isJaggerInjectRecorded()) {
    parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
  }
 else {
    jsdocBuilder.recordJaggerInject(true);
  }
return eatUntilEOLIfNotAnnotation();
case JAGGER_MODULE:
if (jsdocBuilder.isJaggerModuleRecorded()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.recordJaggerModule(true);
}
return eatUntilEOLIfNotAnnotation();
case JAGGER_PROVIDE:
if (jsdocBuilder.isJaggerProvideRecorded()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.recordJaggerProvide(true);
}
return eatUntilEOLIfNotAnnotation();
case JAGGER_PROVIDE_PROMISE:
if (jsdocBuilder.isJaggerProvidePromiseRecorded()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.recordJaggerProvidePromise(true);
}
return eatUntilEOLIfNotAnnotation();
case AUTHOR:
if (jsdocBuilder.shouldParseDocumentation()) {
ExtractionInfo authorInfo=extractSingleLineBlock();
String author=authorInfo.string;
if (author.isEmpty()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.addAuthor(author);
}
token=authorInfo.token;
}
 else {
token=eatUntilEOLIfNotAnnotation();
}
return token;
case CONSISTENTIDGENERATOR:
if (!jsdocBuilder.recordConsistentIdGenerator()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case UNRESTRICTED:
if (!jsdocBuilder.recordUnrestricted()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case STRUCT:
if (!jsdocBuilder.recordStruct()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case DICT:
if (!jsdocBuilder.recordDict()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case CONSTRUCTOR:
if (!jsdocBuilder.recordConstructor()) {
if (jsdocBuilder.isInterfaceRecorded()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
return eatUntilEOLIfNotAnnotation();
case DEPRECATED:
if (!jsdocBuilder.recordDeprecated()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
ExtractionInfo reasonInfo=extractMultilineTextualBlock(token);
String reason=reasonInfo.string;
if (reason.length() > 0) {
jsdocBuilder.recordDeprecationReason(reason);
}
token=reasonInfo.token;
return token;
case INTERFACE:
if (!jsdocBuilder.recordInterface()) {
if (jsdocBuilder.isConstructorRecorded()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
return eatUntilEOLIfNotAnnotation();
case DESC:
if (jsdocBuilder.isDescriptionRecorded()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
return eatUntilEOLIfNotAnnotation();
}
 else {
ExtractionInfo descriptionInfo=extractMultilineTextualBlock(token);
String description=descriptionInfo.string;
jsdocBuilder.recordDescription(description);
token=descriptionInfo.token;
return token;
}
case FILE_OVERVIEW:
String fileOverview="String_Node_Str";
if (jsdocBuilder.shouldParseDocumentation()) {
ExtractionInfo fileOverviewInfo=extractMultilineTextualBlock(token,WhitespaceOption.TRIM);
fileOverview=fileOverviewInfo.string;
token=fileOverviewInfo.token;
}
 else {
token=eatTokensUntilEOL(token);
}
if (!jsdocBuilder.recordFileOverview(fileOverview)) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return token;
case LICENSE:
case PRESERVE:
ExtractionInfo preserveInfo=extractMultilineTextualBlock(token,WhitespaceOption.PRESERVE);
String preserve=preserveInfo.string;
if (preserve.length() > 0) {
if (fileLevelJsDocBuilder != null) {
fileLevelJsDocBuilder.append(preserve);
}
}
token=preserveInfo.token;
return token;
case ENUM:
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
type=null;
if (token != JsDocToken.EOL && token != JsDocToken.EOC) {
type=createJSTypeExpression(parseAndRecordTypeNode(token));
}
if (type == null) {
type=createJSTypeExpression(newStringNode("String_Node_Str"));
}
if (!jsdocBuilder.recordEnumParameterType(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
token=eatUntilEOLIfNotAnnotation(token);
return token;
case EXPORT:
if (!jsdocBuilder.recordExport()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case EXPOSE:
if (!jsdocBuilder.recordExpose()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case EXTERNS:
if (!jsdocBuilder.recordExterns()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case JAVA_DISPATCH:
if (!jsdocBuilder.recordJavaDispatch()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case EXTENDS:
case IMPLEMENTS:
skipEOLs();
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
boolean matchingRc=false;
if (token == JsDocToken.LC) {
token=next();
matchingRc=true;
}
if (token == JsDocToken.STRING) {
Node typeNode=parseAndRecordTypeNameNode(token,lineno,charno,matchingRc);
lineno=stream.getLineno();
charno=stream.getCharno();
typeNode=wrapNode(Token.BANG,typeNode);
type=createJSTypeExpression(typeNode);
if (annotation == Annotation.EXTENDS) {
extendedTypes.add(new ExtendedTypeInfo(type,stream.getLineno(),stream.getCharno()));
}
 else {
Preconditions.checkState(annotation == Annotation.IMPLEMENTS);
if (!jsdocBuilder.recordImplementedInterface(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
}
token=next();
if (matchingRc) {
if (token != JsDocToken.RC) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
token=next();
}
}
 else if (token != JsDocToken.EOL && token != JsDocToken.EOF && token != JsDocToken.EOC) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
 else {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
token=eatUntilEOLIfNotAnnotation(token);
return token;
case HIDDEN:
if (!jsdocBuilder.recordHiddenness()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case LENDS:
skipEOLs();
matchingRc=false;
if (match(JsDocToken.LC)) {
token=next();
matchingRc=true;
}
if (match(JsDocToken.STRING)) {
token=next();
if (!jsdocBuilder.recordLends(stream.getString())) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
 else {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
if (matchingRc && !match(JsDocToken.RC)) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case MEANING:
ExtractionInfo meaningInfo=extractMultilineTextualBlock(token);
String meaning=meaningInfo.string;
token=meaningInfo.token;
if (!jsdocBuilder.recordMeaning(meaning)) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return token;
case NO_ALIAS:
if (!jsdocBuilder.recordNoAlias()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NO_COMPILE:
if (!jsdocBuilder.recordNoCompile()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NO_TYPE_CHECK:
if (!jsdocBuilder.recordNoTypeCheck()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NOT_IMPLEMENTED:
return eatUntilEOLIfNotAnnotation();
case INHERIT_DOC:
case OVERRIDE:
if (!jsdocBuilder.recordOverride()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case THROWS:
{
skipEOLs();
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
type=null;
if (token == JsDocToken.LC) {
type=createJSTypeExpression(parseAndRecordTypeNode(token));
if (type == null) {
return eatUntilEOLIfNotAnnotation();
}
}
token=current();
jsdocBuilder.recordThrowType(type);
boolean isAnnotationNext=lookAheadForAnnotation();
if (jsdocBuilder.shouldParseDocumentation() && !isAnnotationNext) {
ExtractionInfo descriptionInfo=extractMultilineTextualBlock(token);
String description=descriptionInfo.string;
if (description.length() > 0) {
jsdocBuilder.recordThrowDescription(type,description);
}
token=descriptionInfo.token;
}
 else {
token=eatUntilEOLIfNotAnnotation();
}
return token;
}
case PARAM:
skipEOLs();
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
type=null;
if (token == JsDocToken.LC) {
type=createJSTypeExpression(parseAndRecordParamTypeNode(token));
if (type == null) {
return eatUntilEOLIfNotAnnotation();
}
skipEOLs();
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
}
String name=null;
boolean isBracketedParam=JsDocToken.LB == token;
if (isBracketedParam) {
token=next();
}
if (JsDocToken.STRING != token) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
 else {
name=stream.getString();
if (isBracketedParam) {
token=next();
if (JsDocToken.EQUALS == token) {
token=next();
if (JsDocToken.STRING == token) {
token=next();
}
}
if (JsDocToken.RB != token) {
reportTypeSyntaxWarning("String_Node_Str");
}
 else if (type != null) {
type=JSTypeExpression.makeOptionalArg(type);
}
}
if (name.indexOf('.') > -1) {
name=null;
}
 else if (!jsdocBuilder.recordParameter(name,type)) {
if (jsdocBuilder.hasParameter(name)) {
parser.addTypeWarning("String_Node_Str",name,lineno,charno);
}
 else {
parser.addTypeWarning("String_Node_Str",name,lineno,charno);
}
}
}
if (name == null) {
token=eatUntilEOLIfNotAnnotation(token);
return token;
}
jsdocBuilder.markName(name,sourceFile,lineno,charno);
if (jsdocBuilder.shouldParseDocumentation() && token != JsDocToken.ANNOTATION) {
ExtractionInfo paramDescriptionInfo=extractMultilineTextualBlock(token);
String paramDescription=paramDescriptionInfo.string;
if (paramDescription.length() > 0) {
jsdocBuilder.recordParameterDescription(name,paramDescription);
}
token=paramDescriptionInfo.token;
}
 else if (token != JsDocToken.EOC && token != JsDocToken.EOF) {
token=eatUntilEOLIfNotAnnotation();
}
return token;
case PRESERVE_TRY:
if (!jsdocBuilder.recordPreserveTry()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NO_SHADOW:
if (!jsdocBuilder.recordNoShadow()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NO_SIDE_EFFECTS:
if (!jsdocBuilder.recordNoSideEffects()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case MODIFIES:
token=parseModifiesTag(next());
return token;
case IMPLICIT_CAST:
if (!jsdocBuilder.recordImplicitCast()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case SEE:
if (jsdocBuilder.shouldParseDocumentation()) {
ExtractionInfo referenceInfo=extractSingleLineBlock();
String reference=referenceInfo.string;
if (reference.isEmpty()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.addReference(reference);
}
token=referenceInfo.token;
}
 else {
token=eatUntilEOLIfNotAnnotation();
}
return token;
case STABLEIDGENERATOR:
if (!jsdocBuilder.recordStableIdGenerator()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case SUPPRESS:
token=parseSuppressTag(next());
return token;
case TEMPLATE:
{
ExtractionInfo templateInfo=extractMultilineTextualBlock(token);
List<String> templateString=Splitter.on("String_Node_Str").trimResults().splitToList(templateInfo.string);
boolean isTypeTransformation=false;
if (templateString.size() >= 2) {
isTypeTransformation=true;
if (templateString.get(1).isEmpty()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
if (templateString.size() >= 3) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
List<String> names=Lists.newArrayList(Splitter.on(',').trimResults().split(templateString.get(0)));
if (names.size() == 1 && names.get(0).isEmpty()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
for (String typeName : names) {
if (!validTemplateTypeName(typeName)) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else if (!jsdocBuilder.recordTemplateTypeName(typeName)) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
}
if (isTypeTransformation && names.size() > 1) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
token=templateInfo.token;
return token;
}
case IDGENERATOR:
token=parseIdGeneratorTag(next());
return token;
case WIZACTION:
if (!jsdocBuilder.recordWizaction()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case DISPOSES:
{
ExtractionInfo templateInfo=extractSingleLineBlock();
List<String> names=Lists.newArrayList(Splitter.on(',').trimResults().split(templateInfo.string));
if (names.isEmpty() || names.get(0).isEmpty()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else if (!jsdocBuilder.recordDisposesParameter(names)) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
token=templateInfo.token;
return token;
}
case VERSION:
ExtractionInfo versionInfo=extractSingleLineBlock();
String version=versionInfo.string;
if (version.isEmpty()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
if (!jsdocBuilder.recordVersion(version)) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
token=versionInfo.token;
return token;
case CONSTANT:
case DEFINE:
case RETURN:
case PACKAGE:
case PRIVATE:
case PROTECTED:
case PUBLIC:
case THIS:
case TYPE:
case TYPEDEF:
lineno=stream.getLineno();
charno=stream.getCharno();
Node typeNode=null;
boolean hasType=lookAheadForType();
boolean isAlternateTypeAnnotation=(annotation == Annotation.PACKAGE || annotation == Annotation.PRIVATE || annotation == Annotation.PROTECTED || annotation == Annotation.PUBLIC || annotation == Annotation.CONSTANT);
boolean canSkipTypeAnnotation=(isAlternateTypeAnnotation || annotation == Annotation.RETURN);
type=null;
if (hasType || !canSkipTypeAnnotation) {
skipEOLs();
token=next();
typeNode=parseAndRecordTypeNode(token);
if (annotation == Annotation.THIS) {
typeNode=wrapNode(Token.BANG,typeNode);
}
type=createJSTypeExpression(typeNode);
}
boolean hasError=type == null && !canSkipTypeAnnotation;
if (!hasError) {
if ((type != null && isAlternateTypeAnnotation) || annotation == Annotation.TYPE) {
if (!jsdocBuilder.recordType(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
}
boolean isAnnotationNext=lookAheadForAnnotation();
switch (annotation) {
case CONSTANT:
if (!jsdocBuilder.recordConstancy()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
break;
case DEFINE:
if (!jsdocBuilder.recordDefineType(type)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case PRIVATE:
if (!jsdocBuilder.recordVisibility(Visibility.PRIVATE)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case PACKAGE:
if (!jsdocBuilder.recordVisibility(Visibility.PACKAGE)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case PROTECTED:
if (!jsdocBuilder.recordVisibility(Visibility.PROTECTED)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case PUBLIC:
if (!jsdocBuilder.recordVisibility(Visibility.PUBLIC)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case RETURN:
if (type == null) {
type=createJSTypeExpression(newNode(Token.QMARK));
}
if (!jsdocBuilder.recordReturnType(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
break;
}
if (jsdocBuilder.shouldParseDocumentation() && !isAnnotationNext) {
ExtractionInfo returnDescriptionInfo=extractMultilineTextualBlock(token);
String returnDescription=returnDescriptionInfo.string;
if (returnDescription.length() > 0) {
jsdocBuilder.recordReturnDescription(returnDescription);
}
token=returnDescriptionInfo.token;
}
 else {
token=eatUntilEOLIfNotAnnotation();
}
return token;
case THIS:
if (!jsdocBuilder.recordThisType(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
break;
case TYPEDEF:
if (!jsdocBuilder.recordTypedef(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
break;
}
}
return eatUntilEOLIfNotAnnotation();
}
}
return next();
}

Fixed version (ground truth):
private JsDocToken parseAnnotation(JsDocToken token,List<ExtendedTypeInfo> extendedTypes){
  JSTypeExpression type;
  int lineno=stream.getLineno();
  int charno=stream.getCharno();
  String annotationName=stream.getString();
  Annotation annotation=annotationNames.get(annotationName);
  if (annotation == null) {
    parser.addParserWarning("String_Node_Str",annotationName,stream.getLineno(),stream.getCharno());
  }
 else {
    jsdocBuilder.markAnnotation(annotationName,lineno,charno);
switch (annotation) {
case NG_INJECT:
      if (jsdocBuilder.isNgInjectRecorded()) {
        parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
      }
 else {
        jsdocBuilder.recordNgInject(true);
      }
    return eatUntilEOLIfNotAnnotation();
case JAGGER_INJECT:
  if (jsdocBuilder.isJaggerInjectRecorded()) {
    parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
  }
 else {
    jsdocBuilder.recordJaggerInject(true);
  }
return eatUntilEOLIfNotAnnotation();
case JAGGER_MODULE:
if (jsdocBuilder.isJaggerModuleRecorded()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.recordJaggerModule(true);
}
return eatUntilEOLIfNotAnnotation();
case JAGGER_PROVIDE:
if (jsdocBuilder.isJaggerProvideRecorded()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.recordJaggerProvide(true);
}
return eatUntilEOLIfNotAnnotation();
case JAGGER_PROVIDE_PROMISE:
if (jsdocBuilder.isJaggerProvidePromiseRecorded()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.recordJaggerProvidePromise(true);
}
return eatUntilEOLIfNotAnnotation();
case AUTHOR:
if (jsdocBuilder.shouldParseDocumentation()) {
ExtractionInfo authorInfo=extractSingleLineBlock();
String author=authorInfo.string;
if (author.isEmpty()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.addAuthor(author);
}
token=authorInfo.token;
}
 else {
token=eatUntilEOLIfNotAnnotation();
}
return token;
case CONSISTENTIDGENERATOR:
if (!jsdocBuilder.recordConsistentIdGenerator()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case UNRESTRICTED:
if (!jsdocBuilder.recordUnrestricted()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case STRUCT:
if (!jsdocBuilder.recordStruct()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case DICT:
if (!jsdocBuilder.recordDict()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case CONSTRUCTOR:
if (!jsdocBuilder.recordConstructor()) {
if (jsdocBuilder.isInterfaceRecorded()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
return eatUntilEOLIfNotAnnotation();
case DEPRECATED:
if (!jsdocBuilder.recordDeprecated()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
ExtractionInfo reasonInfo=extractMultilineTextualBlock(token);
String reason=reasonInfo.string;
if (reason.length() > 0) {
jsdocBuilder.recordDeprecationReason(reason);
}
token=reasonInfo.token;
return token;
case INTERFACE:
if (!jsdocBuilder.recordInterface()) {
if (jsdocBuilder.isConstructorRecorded()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
return eatUntilEOLIfNotAnnotation();
case DESC:
if (jsdocBuilder.isDescriptionRecorded()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
return eatUntilEOLIfNotAnnotation();
}
 else {
ExtractionInfo descriptionInfo=extractMultilineTextualBlock(token);
String description=descriptionInfo.string;
jsdocBuilder.recordDescription(description);
token=descriptionInfo.token;
return token;
}
case FILE_OVERVIEW:
String fileOverview="String_Node_Str";
if (jsdocBuilder.shouldParseDocumentation()) {
ExtractionInfo fileOverviewInfo=extractMultilineTextualBlock(token,WhitespaceOption.TRIM);
fileOverview=fileOverviewInfo.string;
token=fileOverviewInfo.token;
}
 else {
token=eatTokensUntilEOL(token);
}
if (!jsdocBuilder.recordFileOverview(fileOverview)) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return token;
case LICENSE:
case PRESERVE:
ExtractionInfo preserveInfo=extractMultilineTextualBlock(token,WhitespaceOption.PRESERVE);
String preserve=preserveInfo.string;
if (preserve.length() > 0) {
if (fileLevelJsDocBuilder != null) {
fileLevelJsDocBuilder.append(preserve);
}
}
token=preserveInfo.token;
return token;
case ENUM:
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
type=null;
if (token != JsDocToken.EOL && token != JsDocToken.EOC) {
type=createJSTypeExpression(parseAndRecordTypeNode(token));
}
if (type == null) {
type=createJSTypeExpression(newStringNode("String_Node_Str"));
}
if (!jsdocBuilder.recordEnumParameterType(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
token=eatUntilEOLIfNotAnnotation(token);
return token;
case EXPORT:
if (!jsdocBuilder.recordExport()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case EXPOSE:
if (!jsdocBuilder.recordExpose()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case EXTERNS:
if (!jsdocBuilder.recordExterns()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case JAVA_DISPATCH:
if (!jsdocBuilder.recordJavaDispatch()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case EXTENDS:
case IMPLEMENTS:
skipEOLs();
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
boolean matchingRc=false;
if (token == JsDocToken.LC) {
token=next();
matchingRc=true;
}
if (token == JsDocToken.STRING) {
Node typeNode=parseAndRecordTypeNameNode(token,lineno,charno,matchingRc);
lineno=stream.getLineno();
charno=stream.getCharno();
typeNode=wrapNode(Token.BANG,typeNode);
type=createJSTypeExpression(typeNode);
if (annotation == Annotation.EXTENDS) {
extendedTypes.add(new ExtendedTypeInfo(type,stream.getLineno(),stream.getCharno()));
}
 else {
Preconditions.checkState(annotation == Annotation.IMPLEMENTS);
if (!jsdocBuilder.recordImplementedInterface(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
}
token=next();
if (matchingRc) {
if (token != JsDocToken.RC) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
token=next();
}
}
 else if (token != JsDocToken.EOL && token != JsDocToken.EOF && token != JsDocToken.EOC) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
 else {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
token=eatUntilEOLIfNotAnnotation(token);
return token;
case HIDDEN:
if (!jsdocBuilder.recordHiddenness()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case LENDS:
skipEOLs();
matchingRc=false;
if (match(JsDocToken.LC)) {
token=next();
matchingRc=true;
}
if (match(JsDocToken.STRING)) {
token=next();
if (!jsdocBuilder.recordLends(stream.getString())) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
 else {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
if (matchingRc && !match(JsDocToken.RC)) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case MEANING:
ExtractionInfo meaningInfo=extractMultilineTextualBlock(token);
String meaning=meaningInfo.string;
token=meaningInfo.token;
if (!jsdocBuilder.recordMeaning(meaning)) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return token;
case NO_ALIAS:
if (!jsdocBuilder.recordNoAlias()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NO_COMPILE:
if (!jsdocBuilder.recordNoCompile()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NO_TYPE_CHECK:
if (!jsdocBuilder.recordNoTypeCheck()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NOT_IMPLEMENTED:
return eatUntilEOLIfNotAnnotation();
case INHERIT_DOC:
case OVERRIDE:
if (!jsdocBuilder.recordOverride()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case THROWS:
{
skipEOLs();
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
type=null;
if (token == JsDocToken.LC) {
type=createJSTypeExpression(parseAndRecordTypeNode(token));
if (type == null) {
return eatUntilEOLIfNotAnnotation();
}
}
token=current();
jsdocBuilder.recordThrowType(type);
boolean isAnnotationNext=lookAheadForAnnotation();
if (jsdocBuilder.shouldParseDocumentation() && !isAnnotationNext) {
ExtractionInfo descriptionInfo=extractMultilineTextualBlock(token);
String description=descriptionInfo.string;
if (description.length() > 0) {
jsdocBuilder.recordThrowDescription(type,description);
}
token=descriptionInfo.token;
}
 else {
token=eatUntilEOLIfNotAnnotation();
}
return token;
}
case PARAM:
skipEOLs();
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
type=null;
if (token == JsDocToken.LC) {
type=createJSTypeExpression(parseAndRecordParamTypeNode(token));
if (type == null) {
return eatUntilEOLIfNotAnnotation();
}
skipEOLs();
token=next();
lineno=stream.getLineno();
charno=stream.getCharno();
}
String name=null;
boolean isBracketedParam=JsDocToken.LB == token;
if (isBracketedParam) {
token=next();
}
if (JsDocToken.STRING != token) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
 else {
name=stream.getString();
if (isBracketedParam) {
token=next();
if (JsDocToken.EQUALS == token) {
token=next();
if (JsDocToken.STRING == token) {
token=next();
}
}
if (JsDocToken.RB != token) {
reportTypeSyntaxWarning("String_Node_Str");
}
 else if (type != null) {
type=JSTypeExpression.makeOptionalArg(type);
}
}
if (name.indexOf('.') > -1) {
name=null;
}
 else if (!jsdocBuilder.recordParameter(name,type)) {
if (jsdocBuilder.hasParameter(name)) {
parser.addTypeWarning("String_Node_Str",name,lineno,charno);
}
 else {
parser.addTypeWarning("String_Node_Str",name,lineno,charno);
}
}
}
if (name == null) {
token=eatUntilEOLIfNotAnnotation(token);
return token;
}
jsdocBuilder.markName(name,sourceFile,lineno,charno);
if (jsdocBuilder.shouldParseDocumentation() && token != JsDocToken.ANNOTATION) {
ExtractionInfo paramDescriptionInfo=extractMultilineTextualBlock(token);
String paramDescription=paramDescriptionInfo.string;
if (paramDescription.length() > 0) {
jsdocBuilder.recordParameterDescription(name,paramDescription);
}
token=paramDescriptionInfo.token;
}
 else if (token != JsDocToken.EOC && token != JsDocToken.EOF) {
token=eatUntilEOLIfNotAnnotation();
}
return token;
case PRESERVE_TRY:
if (!jsdocBuilder.recordPreserveTry()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NO_SHADOW:
if (!jsdocBuilder.recordNoShadow()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case NO_SIDE_EFFECTS:
if (!jsdocBuilder.recordNoSideEffects()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case MODIFIES:
token=parseModifiesTag(next());
return token;
case IMPLICIT_CAST:
if (!jsdocBuilder.recordImplicitCast()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case SEE:
if (jsdocBuilder.shouldParseDocumentation()) {
ExtractionInfo referenceInfo=extractSingleLineBlock();
String reference=referenceInfo.string;
if (reference.isEmpty()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
jsdocBuilder.addReference(reference);
}
token=referenceInfo.token;
}
 else {
token=eatUntilEOLIfNotAnnotation();
}
return token;
case STABLEIDGENERATOR:
if (!jsdocBuilder.recordStableIdGenerator()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case SUPPRESS:
token=parseSuppressTag(next());
return token;
case TEMPLATE:
{
ExtractionInfo templateInfo=extractSingleLineBlock();
boolean isTypeTransformation=false;
String templateNames;
String typeTransformationStart="String_Node_Str";
if (templateInfo.string.contains("String_Node_Str")) {
isTypeTransformation=true;
int typeTransformationIndex=templateInfo.string.indexOf("String_Node_Str");
templateNames=templateInfo.string.substring(0,typeTransformationIndex);
typeTransformationStart=templateInfo.string.substring(typeTransformationIndex + 3);
}
 else {
templateNames=templateInfo.string;
}
List<String> names=Lists.newArrayList(Splitter.on(',').trimResults().split(templateNames));
if (names.size() == 1 && names.get(0).isEmpty()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
for (String typeName : names) {
if (!validTemplateTypeName(typeName)) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else if (!jsdocBuilder.recordTemplateTypeName(typeName)) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
}
if (isTypeTransformation) {
if (names.size() > 1) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
ExtractionInfo typeTransformationInfo=extractMultilineTextualBlock(templateInfo.token);
String typeTransformationEnd=typeTransformationInfo.string;
String typeTransformationString=typeTransformationStart + typeTransformationEnd;
if (typeTransformationString.equals("String_Node_Str")) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
token=typeTransformationInfo.token;
}
 else {
token=templateInfo.token;
}
return token;
}
case IDGENERATOR:
token=parseIdGeneratorTag(next());
return token;
case WIZACTION:
if (!jsdocBuilder.recordWizaction()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
return eatUntilEOLIfNotAnnotation();
case DISPOSES:
{
ExtractionInfo templateInfo=extractSingleLineBlock();
List<String> names=Lists.newArrayList(Splitter.on(',').trimResults().split(templateInfo.string));
if (names.isEmpty() || names.get(0).isEmpty()) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else if (!jsdocBuilder.recordDisposesParameter(names)) {
parser.addTypeWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
token=templateInfo.token;
return token;
}
case VERSION:
ExtractionInfo versionInfo=extractSingleLineBlock();
String version=versionInfo.string;
if (version.isEmpty()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
 else {
if (!jsdocBuilder.recordVersion(version)) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
}
token=versionInfo.token;
return token;
case CONSTANT:
case DEFINE:
case RETURN:
case PACKAGE:
case PRIVATE:
case PROTECTED:
case PUBLIC:
case THIS:
case TYPE:
case TYPEDEF:
lineno=stream.getLineno();
charno=stream.getCharno();
Node typeNode=null;
boolean hasType=lookAheadForType();
boolean isAlternateTypeAnnotation=(annotation == Annotation.PACKAGE || annotation == Annotation.PRIVATE || annotation == Annotation.PROTECTED || annotation == Annotation.PUBLIC || annotation == Annotation.CONSTANT);
boolean canSkipTypeAnnotation=(isAlternateTypeAnnotation || annotation == Annotation.RETURN);
type=null;
if (hasType || !canSkipTypeAnnotation) {
skipEOLs();
token=next();
typeNode=parseAndRecordTypeNode(token);
if (annotation == Annotation.THIS) {
typeNode=wrapNode(Token.BANG,typeNode);
}
type=createJSTypeExpression(typeNode);
}
boolean hasError=type == null && !canSkipTypeAnnotation;
if (!hasError) {
if ((type != null && isAlternateTypeAnnotation) || annotation == Annotation.TYPE) {
if (!jsdocBuilder.recordType(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
}
boolean isAnnotationNext=lookAheadForAnnotation();
switch (annotation) {
case CONSTANT:
if (!jsdocBuilder.recordConstancy()) {
parser.addParserWarning("String_Node_Str",stream.getLineno(),stream.getCharno());
}
break;
case DEFINE:
if (!jsdocBuilder.recordDefineType(type)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case PRIVATE:
if (!jsdocBuilder.recordVisibility(Visibility.PRIVATE)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case PACKAGE:
if (!jsdocBuilder.recordVisibility(Visibility.PACKAGE)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case PROTECTED:
if (!jsdocBuilder.recordVisibility(Visibility.PROTECTED)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case PUBLIC:
if (!jsdocBuilder.recordVisibility(Visibility.PUBLIC)) {
parser.addParserWarning("String_Node_Str",lineno,charno);
}
if (!isAnnotationNext) {
return recordDescription(token);
}
break;
case RETURN:
if (type == null) {
type=createJSTypeExpression(newNode(Token.QMARK));
}
if (!jsdocBuilder.recordReturnType(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
break;
}
if (jsdocBuilder.shouldParseDocumentation() && !isAnnotationNext) {
ExtractionInfo returnDescriptionInfo=extractMultilineTextualBlock(token);
String returnDescription=returnDescriptionInfo.string;
if (returnDescription.length() > 0) {
jsdocBuilder.recordReturnDescription(returnDescription);
}
token=returnDescriptionInfo.token;
}
 else {
token=eatUntilEOLIfNotAnnotation();
}
return token;
case THIS:
if (!jsdocBuilder.recordThisType(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
break;
case TYPEDEF:
if (!jsdocBuilder.recordTypedef(type)) {
parser.addTypeWarning("String_Node_Str",lineno,charno);
}
break;
}
}
return eatUntilEOLIfNotAnnotation();
}
}
return next();
}