/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 7021650
* @summary Fix Context issues
* @library ../../lib
* @build JavacTestingAbstractProcessor T7021650
* @run main T7021650
*/
}
/**
* Perform a compilation with custom factories registered in the context,
* and verify that corresponding objects are created in each round.
*/
// Use a custom file manager which creates classloaders for annotation
// processors with a sensible delegation parent, so that all instances
// of test classes come from the same class loader. This is important
// because the test performs class checks on the instances of classes
// found in the context for each round or processing.
return new JavacFileManager(c, true, null) {
}
};
}
});
"-d", ".",
"-XprintRounds",
};
// Expect to create Demo for initial round, then MAX_ROUNDS in which
// GenX files are generated, then standard final round of processing.
// Expect to create MyAttr for same processing rounds as for Demo,
// plus additional context for final compilation.
}
if (rc != 0)
}
+ ": expected " + expect
+ ": found " + found);
}
//---------------
/*
* A custom class unknown to javac but nonetheless registered in the context.
*/
static class Demo {
return new Demo(c);
}
});
}
}
}
}
/**
* A custom version of a standard javac component.
*/
return new MyAttr(c);
}
});
}
super(c);
}
}
static class Counter {
int count;
}
//---------------
round++;
// verify items in context as expected
// For a few rounds, generate new source files, so that we can check whether
// values in the context are correctly handled in subsequent processing rounds
if (round <= MAX_ROUNDS) {
if (round < MAX_ROUNDS)
try {
try {
} finally {
}
} catch (IOException e) {
throw new Error(e);
}
}
return true;
}
if (o == null)
}
}