modules/ballerina-core/src/main/java/org/ballerinalang/util/semantics/SemanticAnalyzer.java
private void defineAnnotations(AnnotationDef[] annotationDefs) {
        for (AnnotationDef annotationDef : annotationDefs) {
            SymbolName symbolName = new SymbolName(annotationDef.getName());

            // Check whether this annotation is already defined.
            if (currentScope.resolve(symbolName) != null) {
                BLangExceptionHelper.throwSemanticError(annotationDef,
                        SemanticErrors.REDECLARED_SYMBOL, annotationDef.getSymbolName().getName());
            }
            
            currentScope.define(symbolName, annotationDef);
        }
    }
/**
     * Add the annotation definitions to the current scope.
     * 
     * @param annotationDefs Annotations definitions list
     */
Add the annotation definitions to the current scope.

@param annotationDefs Annotations definitions list
Add the annotation definitions to the current scope . @param annotationDefs Annotations definitions list
private void defineAnnotations(AnnotationDef[] annotationDefs) {
        for (AnnotationDef annotationDef : annotationDefs) {
            SymbolName symbolName = new SymbolName(annotationDef.getName());
            if (currentScope.resolve(symbolName) != null) {
                BLangExceptionHelper.throwSemanticError(annotationDef,
                        SemanticErrors.REDECLARED_SYMBOL, annotationDef.getSymbolName().getName());
            }
            currentScope.define(symbolName, annotationDef);
        }
    }
private void defineAnnotations ( AnnotationDef [ ] annotationDefs ) { for ( AnnotationDef annotationDef : annotationDefs ) { SymbolName symbolName = new SymbolName ( annotationDef . getName ( ) ) ; if ( currentScope . resolve ( symbolName ) != null ) { BLangExceptionHelper . throwSemanticError ( annotationDef , SemanticErrors . REDECLARED_SYMBOL , annotationDef . getSymbolName ( ) . getName ( ) ) ; } currentScope . define ( symbolName , annotationDef ) ; } }
Add the annotation definitions to the current scope.
Add the annotation definitions to the current scope .
// Check whether this annotation is already defined.