< prev index next >

test/langtools/tools/javac/failover/CheckAttributedTree.java

Print this page

389 
390                 Field errField = checkFields(tree);
391                 if (errField!=null) {
392                     check(false,
393                             "'null' field '" + errField.getName() + "' found in tree ", self);
394                 }
395 
396                 Info prevEncl = encl;
397                 encl = self;
398                 tree.accept(this);
399                 encl = prevEncl;
400             }
401 
402             private boolean mandatoryType(JCTree that) {
403                 return that instanceof JCTree.JCExpression ||
404                         that.hasTag(VARDEF) ||
405                         that.hasTag(METHODDEF) ||
406                         that.hasTag(CLASSDEF);
407             }
408 
409             private final List<String> excludedFields = Arrays.asList("varargsElement", "targetType");
410 
411             void check(boolean ok, String label, Info self) {
412                 if (!ok) {
413                     if (gui) {
414                         if (viewer == null)
415                             viewer = new Viewer();
416                         viewer.addEntry(sourcefile, label, encl, self);
417                     }
418                     error(label + self.toString() + " encl: " + encl.toString() +
419                             " in file: " + sourcefile + "  " + self.tree);
420                 }
421             }
422 
423             Field checkFields(JCTree t) {
424                 List<Field> fieldsToCheck = treeUtil.getFieldsOfType(t,
425                         excludedFields,
426                         Symbol.class,
427                         Type.class);
428                 for (Field f : fieldsToCheck) {
429                     try {

389 
390                 Field errField = checkFields(tree);
391                 if (errField!=null) {
392                     check(false,
393                             "'null' field '" + errField.getName() + "' found in tree ", self);
394                 }
395 
396                 Info prevEncl = encl;
397                 encl = self;
398                 tree.accept(this);
399                 encl = prevEncl;
400             }
401 
402             private boolean mandatoryType(JCTree that) {
403                 return that instanceof JCTree.JCExpression ||
404                         that.hasTag(VARDEF) ||
405                         that.hasTag(METHODDEF) ||
406                         that.hasTag(CLASSDEF);
407             }
408 
409             private final List<String> excludedFields = Arrays.asList("varargsElement", "targetType", "factoryProduct");
410 
411             void check(boolean ok, String label, Info self) {
412                 if (!ok) {
413                     if (gui) {
414                         if (viewer == null)
415                             viewer = new Viewer();
416                         viewer.addEntry(sourcefile, label, encl, self);
417                     }
418                     error(label + self.toString() + " encl: " + encl.toString() +
419                             " in file: " + sourcefile + "  " + self.tree);
420                 }
421             }
422 
423             Field checkFields(JCTree t) {
424                 List<Field> fieldsToCheck = treeUtil.getFieldsOfType(t,
425                         excludedFields,
426                         Symbol.class,
427                         Type.class);
428                 for (Field f : fieldsToCheck) {
429                     try {
< prev index next >