1 /* |
1 /* |
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2012, 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 |
97 JavacElements elemUtils = processingEnv.getElementUtils(); |
97 JavacElements elemUtils = processingEnv.getElementUtils(); |
98 Pair<JCTree, JCCompilationUnit> treeTop = elemUtils.getTreeAndTopLevel(e, a, v); |
98 Pair<JCTree, JCCompilationUnit> treeTop = elemUtils.getTreeAndTopLevel(e, a, v); |
99 if (treeTop != null) { |
99 if (treeTop != null) { |
100 newSource = treeTop.snd.sourcefile; |
100 newSource = treeTop.snd.sourcefile; |
101 if (newSource != null) { |
101 if (newSource != null) { |
|
102 // save the old version and reinstate it later |
102 oldSource = log.useSource(newSource); |
103 oldSource = log.useSource(newSource); |
103 pos = treeTop.fst.pos(); |
104 pos = treeTop.fst.pos(); |
104 } |
105 } |
105 } |
106 } |
106 try { |
107 try { |