src/java.base/share/classes/java/lang/ModuleLayer.java
changeset 51703 4ffb0a33f265
parent 51327 a19fda433921
child 54206 003cc64366da
equal deleted inserted replaced
51702:ebd5b1ad971a 51703:4ffb0a33f265
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   788             allLayers.add(layer);
   788             allLayers.add(layer);
   789 
   789 
   790             // push in reverse order
   790             // push in reverse order
   791             for (int i = layer.parents.size() - 1; i >= 0; i--) {
   791             for (int i = layer.parents.size() - 1; i >= 0; i--) {
   792                 ModuleLayer parent = layer.parents.get(i);
   792                 ModuleLayer parent = layer.parents.get(i);
   793                 if (!visited.contains(parent)) {
   793                 if (visited.add(parent)) {
   794                     visited.add(parent);
       
   795                     stack.push(parent);
   794                     stack.push(parent);
   796                 }
   795                 }
   797             }
   796             }
   798         }
   797         }
   799 
   798