221560
--- sun/tools/javazic/Mappings.java.orig	2015-04-13 12:44:10.000000000 -0400
221560
+++ sun/tools/javazic/Mappings.java	2015-04-13 12:45:28.000000000 -0400
221560
@@ -1,5 +1,5 @@
221560
 /*
221560
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
221560
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
221560
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
221560
  *
221560
  * This code is free software; you can redistribute it and/or modify it
221560
@@ -26,6 +26,7 @@
221560
 package sun.tools.javazic;
221560
 
221560
 import	java.util.ArrayList;
221560
+import java.util.HashMap;
221560
 import	java.util.LinkedList;
221560
 import	java.util.List;
221560
 import	java.util.Map;
221560
@@ -162,6 +163,20 @@
221560
 	for (String key : toBeRemoved) {
221560
 	    aliases.remove(key);
221560
 	}
221560
+        // Eliminate any alias-to-alias mappings. For example, if
221560
+        // there are A->B and B->C, A->B is changed to A->C.
221560
+        Map<String, String> newMap = new HashMap<String, String>();
221560
+        for (String key : aliases.keySet()) {
221560
+            String realid = aliases.get(key);
221560
+            String leaf = realid;
221560
+            while (aliases.get(leaf) != null) {
221560
+                leaf = aliases.get(leaf);
221560
+            }
221560
+            if (!realid.equals(leaf)) {
221560
+                newMap.put(key, leaf);
221560
+            }
221560
+        }
221560
+        aliases.putAll(newMap);
221560
     }
221560
 
221560
     Map<String,String> getAliases() {