[ https://issues.apache.org/jira/browse/KYLIN-3587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628613#comment-16628613 ]
ASF GitHub Bot commented on KYLIN-3587: --------------------------------------- shaofengshi closed pull request #256: KYLIN-3587 Including tableID in IllegalStateException messages URL: https://github.com/apache/kylin/pull/256 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java b/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java index bad9773929..77bad37acb 100644 --- a/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java +++ b/core-metadata/src/main/java/org/apache/kylin/metadata/project/ProjectManager.java @@ -303,7 +303,7 @@ public ProjectInstance addTableDescToProject(String[] tableIdentities, String pr for (String tableId : tableIdentities) { TableDesc table = metaMgr.getTableDesc(tableId, projectName); if (table == null) { - throw new IllegalStateException("Cannot find table '" + table + "' in metadata manager"); + throw new IllegalStateException("Cannot find table '" + tableId + "' in metadata manager"); } projectInstance.addTable(table.getIdentity()); } @@ -312,13 +312,13 @@ public ProjectInstance addTableDescToProject(String[] tableIdentities, String pr } } - public void removeTableDescFromProject(String tableIdentities, String projectName) throws IOException { + public void removeTableDescFromProject(String tableId, String projectName) throws IOException { try (AutoLock lock = prjMapLock.lockForWrite()) { TableMetadataManager metaMgr = getTableManager(); ProjectInstance projectInstance = getProject(projectName); - TableDesc table = metaMgr.getTableDesc(tableIdentities, projectName); + TableDesc table = metaMgr.getTableDesc(tableId, projectName); if (table == null) { - throw new IllegalStateException("Cannot find table '" + table + "' in metadata manager"); + throw new IllegalStateException("Cannot find table '" + tableId + "' in metadata manager"); } projectInstance.removeTable(table.getIdentity()); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Null value is used in IllegalStateException message > --------------------------------------------------- > > Key: KYLIN-3587 > URL: https://issues.apache.org/jira/browse/KYLIN-3587 > Project: Kylin > Issue Type: Bug > Reporter: Ted Yu > Assignee: Yichen Zhou > Priority: Minor > > In ProjectManager : > {code} > TableDesc table = metaMgr.getTableDesc(tableId, projectName); > if (table == null) { > throw new IllegalStateException("Cannot find table '" + > table + "' in metadata manager"); > {code} > Since table is null, the exception message is not helpful. > It seems including tableId in the message is better. -- This message was sent by Atlassian JIRA (v7.6.3#76005)