diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java index cc246d9b56..e10eb1be88 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java @@ -549,15 +549,11 @@ private static boolean shouldCleanAppLogDir(Path appLogPath, long now, // converts the String to an ApplicationId or null if conversion failed private static ApplicationId parseApplicationId(String appIdStr) { - ApplicationId appId = null; - if (appIdStr.startsWith(ApplicationId.appIdStrPrefix)) { - try { - appId = ApplicationId.fromString(appIdStr); - } catch (IllegalArgumentException e) { - appId = null; - } + try { + return ApplicationId.fromString(appIdStr); + } catch (IllegalArgumentException e) { + return null; } - return appId; } private static ClassLoader createPluginClassLoader(