Check whether or not a procedure name is acceptible.
@param identifier the identifier to check
@param statement the statement where the identifier is
@return the given identifier unmodified
@throws VoltCompilerException
175575
private String checkProcedureIdentifier(
            final String identifier, final String statement
            ) throws VoltCompilerException {
        String retIdent = checkIdentifierStart(identifier, statement);
        if (retIdent.contains(".")) {
            String msg = String.format(
                "Invalid procedure name containing dots \"%s\" in DDL: \"%s\"",
                identifier, statement.substring(0,statement.length()-1));
            throw m_compiler.new VoltCompilerException(msg);
        }
        return retIdent;
    }
778491
boolean isSimpleName(boolean isStrictSQLNames) {
        if (isStrictSQLNames) {
            return isNonReservedIdentifier() && token.namePrefix == null;
        } else {
            return isNonCoreReservedIdentifier() && token.namePrefix == null;
        }
    }
871624
public static String quoteIdentifier(String identifier, boolean isH2DataBase) {
        if((isH2DataBase && (Constants.H2_RESERVED_WORDS.contains(identifier.toUpperCase())
                        || !H2_SPECIAL_NAME_PATTERN.matcher(identifier).find())) ||
                (!isH2DataBase && (Constants.POSTGIS_RESERVED_WORDS.contains(identifier.toUpperCase())
                        || !POSTGRE_SPECIAL_NAME_PATTERN.matcher(identifier).find()))) {
            return quoteIdentifier(identifier);
        } else {
            return identifier;
        }
    }
69872
public void removeProcedure(String procName, boolean ifExists) throws VoltCompilerException
    {
        assert procName != null && ! procName.trim().isEmpty();

        String shortName = deriveShortProcedureName(procName);

        if( m_procedureMap.containsKey(shortName)) {
            m_procedureMap.remove(shortName);
        }
        else if (!ifExists) {
            throw m_compiler.new VoltCompilerException(String.format(
                    "Dropped Procedure \"%s\" is not defined", procName));
        }
    }
151024
public void updateName(long identifier, StringHolder name) {
        IDrawerItem drawerItem = getDrawerItem(identifier);
        if (drawerItem instanceof Nameable) {
            Nameable pdi = (Nameable) drawerItem;
            pdi.withName(name);
            updateItem((IDrawerItem) pdi);
        }
    }
447584
void executeStatement(String statement) {

		try (Connection conn = getFastConnection(); Statement stm = conn.createStatement()) {
			stm.execute(statement);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

	}
1142935
public int[] executeBatchPreparedStatement(String statement, Collection inParamsBatch) throws SQLException {
		return executeBatchPreparedStatement(statement, inParamsBatch, true);
	}
806765
@NonNull
  public BatchStatementBuilder addStatement(@NonNull BatchableStatement<?> statement) {
    if (statementsCount >= 0xFFFF) {
      throw new IllegalStateException(
          "Batch statement cannot contain more than " + 0xFFFF + " statements.");
    }
    statementsCount += 1;
    statementsBuilder.add(statement);
    return this;
  }
337383
Statement compileAlterTableAddUniqueConstraint(Table table,
            HsqlName name, boolean assumeUnique) {
    /* disable 2 lines ...
    Statement compileAlterTableAddUniqueConstraint(Table table,
            HsqlName name) {
    ... disabled 2 lines */
    // End of VoltDB extension

        if (name == null) {
            name = database.nameManager.newAutoName("CT",
                    table.getSchemaName(), table.getName(),
                    SchemaObject.CONSTRAINT);
        }

        // A VoltDB extension to support indexed expressions.
        java.util.List<Expression> indexExprs = XreadExpressions(null);
        OrderedHashSet set = getSimpleColumnNames(indexExprs);
        int[] cols = getColumnList(set, table);
        if ((indexExprs != null) && (cols == null)) {
            // Not just indexing columns.
            // The meaning of cols shifts here to be
            // the set of unique base columns for the indexed expressions.
            set = getBaseColumnNames(indexExprs);
            cols = getColumnList(set, table);
        }
        /* disable 1 line ...
        int[] cols = this.readColumnList(table, false);
        ... disabled 1 line */
        // End of VoltDB extension
        String   sql  = getLastPart();
        //  and indexed expressions
        Object[] args = new Object[] {
            cols, name, indexExprs,
            Boolean.valueOf(assumeUnique)
        };
        /* disable 3 lines ...
        Object[] args = new Object[] {
            cols, name
        };
        .. disabled 3 lines */
        // End of VoltDB extension

        return new StatementSchema(sql, StatementTypes.ALTER_TABLE, args,
                                   null, table.getName());
    }
696961
void registerExecutionVertex(final ExecutionVertex vertex) {

		if (this.vertexMap.put(vertex.getID(), vertex) != null) {
			throw new IllegalStateException("There is already an execution vertex with ID " + vertex.getID()
				+ " registered");
		}
	}
687078
public static String parseEchoStatement(String statement)
    {
        Matcher matcher = EchoToken.matcher(statement);
        if (matcher.matches()) {
            String commandWordTerminator = matcher.group(1);
            if (OneWhitespace.matcher(commandWordTerminator).matches()) {
                return matcher.group(2);
            }
            return "";
        }
        return null;
    }
770235
public String add(ProcedureDescriptor descriptor) throws VoltCompilerException
    {
        assert descriptor != null;

        String className = descriptor.m_className;
        assert className != null && ! className.trim().isEmpty();

        String shortName = deriveShortProcedureName(className);

        if( m_procedureMap.containsKey(shortName)) {
            throw m_compiler.new VoltCompilerException(String.format(
                    "Procedure \"%s\" is already defined", className));
        }

        m_procedureMap.put(shortName, descriptor);

        return shortName;
    }
699759
private void parameter( ParameterSupportBuilder< ? > statement,
                            boolean requiresType ) throws RecognitionException {
        String type = "Object";
        if ( requiresType ) {
            type = type();
            if ( state.failed ) return;
        }

        int start = input.index();
        match( input,
               DRL5Lexer.ID,
               null,
               null,
               DroolsEditorType.IDENTIFIER );
        if ( state.failed ) return;

        while ( input.LA( 1 ) == DRL5Lexer.LEFT_SQUARE ) {
            match( input,
                   DRL5Lexer.LEFT_SQUARE,
                   null,
                   null,
                   DroolsEditorType.SYMBOL );
            if ( state.failed ) return;

            match( input,
                   DRL5Lexer.RIGHT_SQUARE,
                   null,
                   null,
                   DroolsEditorType.SYMBOL );
            if ( state.failed ) return;
        }
        int end = input.LT( -1 ).getTokenIndex();

        if ( state.backtracking == 0 ) statement.parameter( type,
                                                            input.toString( start,
                                                                            end ) );
    }
471174
public final void qualifiedName() throws RecognitionException {
		int qualifiedName_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 60) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:583:5: ( Identifier ( '.' Identifier )* )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:583:7: Identifier ( '.' Identifier )*
			{
			match(input,Identifier,FOLLOW_Identifier_in_qualifiedName2123); if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:583:18: ( '.' Identifier )*
			loop83:
			while (true) {
				int alt83=2;
				int LA83_0 = input.LA(1);
				if ( (LA83_0==47) ) {
					alt83=1;
				}

				switch (alt83) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:583:19: '.' Identifier
					{
					match(input,47,FOLLOW_47_in_qualifiedName2126); if (state.failed) return;
					match(input,Identifier,FOLLOW_Identifier_in_qualifiedName2128); if (state.failed) return;
					}
					break;

				default :
					break loop83;
				}
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 60, qualifiedName_StartIndex); }

		}
	}
354417
protected Collection<String> getParameters(final CreateSpatialIndexStatement statement) {
      final Collection<String> parameters = new ArrayList<String>();
      if (StringUtils.trimToNull(statement.getGeometryType()) != null) {
         final String gType = getGtype(statement.getGeometryType().trim());
         if (gType != null) {
            parameters.add("layer_gtype=" + gType);
         }
      }
      if (StringUtils.trimToNull(statement.getTablespace()) != null) {
         parameters.add("tablespace=" + statement.getTablespace().trim());
      }
      return parameters;
   }
551224
protected String getUniqueIdentifier(JvmType type) {
		String typeIdentifier = type.getIdentifier();
		if (type instanceof JvmTypeParameter) {
			JvmIdentifiableElement declarator = (JvmIdentifiableElement) ((JvmTypeParameter) type).getDeclarator();
			// may happen in unit tests
			if (declarator != null) {
				typeIdentifier = typeIdentifier + ":" + declarator.getQualifiedName();
			} else {
				typeIdentifier = typeIdentifier + ":";
			}
		}
		return typeIdentifier;
	}
538234
private static String propositionId(Instance extendedProposition) {
        Instance proposition = (Instance) extendedProposition
                .getOwnSlotValue(extendedProposition.getKnowledgeBase()
                .getSlot("proposition"));
        if (proposition.hasType(proposition.getKnowledgeBase().getCls(
                "ConstantParameter"))) {
            throw new IllegalStateException(
                    "Constant parameters are not yet supported as "
                    + "components of a high level abstraction definition.");
        } else {
            return proposition.getName();
        }
    }