|
38 | 38 | import org.eclipse.jdt.core.dom.TextElement; |
39 | 39 |
|
40 | 40 | /** |
41 | | - * |
42 | | - * ASTVisitor > J2SASTVisitor > J2SDependencyVisitor |
43 | | - * |
44 | | - * ASTVisitor > J2SASTVisitor > J2SKeywordVisitor > Java2ScriptLegacyVisitor |
| 41 | + * Superclass for J2SDependencyVisitor and Java2ScriptLegacyVisitor |
45 | 42 | * |
46 | 43 | * @author zhou renjian |
47 | 44 | */ |
48 | 45 | abstract class J2SASTVisitor extends ASTVisitor { |
49 | 46 |
|
50 | | - protected final static String[] preDeclaredPackages = { // |
51 | | - "java.lang", //publicfinal refactoring -- Helpers to inner static classes |
52 | | - "java.lang.ref", // |
53 | | - "java.lang.ref.reflect", // |
54 | | - "java.lang.reflect", // |
55 | | - "java.lang.annotation", // |
56 | | - "java.io", // |
57 | | - "java.util" // |
58 | | - }; |
59 | | - |
60 | 47 | protected Javadoc[] nativeJavadoc = null; |
61 | 48 | protected ASTNode javadocRoot = null; |
62 | 49 |
|
@@ -207,45 +194,6 @@ private static int getPreviousStartPosition(Block node) { |
207 | 194 | return previousStart; |
208 | 195 | } |
209 | 196 |
|
210 | | - /** |
211 | | - * Check for given tag in JavaDoc or annotations. |
212 | | - * |
213 | | - * @param node |
214 | | - * @return |
215 | | - */ |
216 | | - static Object getJ2STag(BodyDeclaration node, String tagName) { |
217 | | - Javadoc javadoc = node.getJavadoc(); |
218 | | - if (javadoc != null) { |
219 | | - List<?> tags = javadoc.tags(); |
220 | | - if (tags.size() != 0) { |
221 | | - for (Iterator<?> iter = tags.iterator(); iter.hasNext();) { |
222 | | - TagElement tagEl = (TagElement) iter.next(); |
223 | | - if (tagName.equals(tagEl.getTagName())) { |
224 | | - return tagEl; |
225 | | - } |
226 | | - } |
227 | | - } |
228 | | - } |
229 | | - List<?> modifiers = node.modifiers(); |
230 | | - String tag = null; |
231 | | - for (Iterator<?> iter = modifiers.iterator(); iter.hasNext();) { |
232 | | - Object obj = iter.next(); |
233 | | - if (obj instanceof Annotation) { |
234 | | - Annotation annotation = (Annotation) obj; |
235 | | - String qName = annotation.getTypeName().getFullyQualifiedName(); |
236 | | - int idx = qName.indexOf("J2S"); |
237 | | - if (idx >= 0) { |
238 | | - if (tag == null) |
239 | | - tag = tagName.substring(4); // drop @j2s |
240 | | - if (qName.indexOf(tag, idx) == idx + 3) { |
241 | | - return annotation; |
242 | | - } |
243 | | - } |
244 | | - } |
245 | | - } |
246 | | - return null; |
247 | | - } |
248 | | - |
249 | 197 | protected void checkJavadocs(ASTNode root) { |
250 | 198 | if (root != javadocRoot) { |
251 | 199 | nativeJavadoc = null; |
@@ -413,6 +361,4 @@ protected boolean writeJ2SSources(BodyDeclaration node, String tagName, String p |
413 | 361 | return existed; |
414 | 362 | } |
415 | 363 |
|
416 | | - |
417 | | - |
418 | 364 | } |
0 commit comments