h2/src/main/org/h2/mvstore/MVStore.java
/**
     * Rename a map.
     *
     * @param map the map
     * @param newName the new name
     */
Rename a map.
@param map the map
@param newName the new name
Rename a map . @param map the map @param newName the new name
public synchronized void renameMap(MVMap<?, ?> map, String newName) {
        checkOpen();
        DataUtils.checkArgument(map != meta,
                "Renaming the meta map is not allowed");
        int id = map.getId();
        String oldName = getMapName(id);
        if (oldName.equals(newName)) {
            return;
        }
        DataUtils.checkArgument(
                !meta.containsKey("name." + newName),
                "A map named {0} already exists", newName);
        markMetaChanged();
        meta.remove("name." + oldName);
        meta.put("map." + id, map.asString(newName));
        meta.put("name." + newName, Integer.toString(id));
    }
public synchronized void renameMap ( MVMap < ? , ? > map , String newName ) { checkOpen ( ) ; DataUtils . checkArgument ( map != meta , "Renaming the meta map is not allowed" ) ; int id = map . getId ( ) ; String oldName = getMapName ( id ) ; if ( oldName . equals ( newName ) ) { return ; } DataUtils . checkArgument ( ! meta . containsKey ( "name." + newName ) , "A map named {0} already exists" , newName ) ; markMetaChanged ( ) ; meta . remove ( "name." + oldName ) ; meta . put ( "map." + id , map . asString ( newName ) ) ; meta . put ( "name." + newName , Integer . toString ( id ) ) ; }
Rename a map.
Rename a map .