< prev index next >

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

Print this page

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

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