Skip to content

Commit

Permalink
Merge commit '5d4d2b705aed2fd61de4d5416beb6ba0fbff3e7f' into BETA_JAVA22
Browse files Browse the repository at this point in the history
  • Loading branch information
jarthana committed Mar 7, 2024
2 parents 22ce911 + 5d4d2b7 commit 872ac11
Show file tree
Hide file tree
Showing 161 changed files with 1,725 additions and 1,478 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* Provides access to the annotation processor factory path for a Java project.
* This class should not be instantiated or subclassed.
*
* The factory path is an ordered Map<FactoryContainer, FactoryPath.Attributes>.
* The factory path is an ordered {@code Map<FactoryContainer, FactoryPath.Attributes>}.
* Containers are things like jar files or plugins, that contain one or more
* annotation processor factories. In the context of a particular project,
* processors are given precedence according to the order of their container on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ private static String getContents(InputStream in) throws IOException {
/**
* Stores a string into an Eclipse file in UTF8 format. The file
* will be created if it does not already exist.
* @throws IOException, CoreException
* @throws IOException
* @throws CoreException
*/
public static void writeStringToIFile(IFile file, String contents) throws IOException, CoreException {
byte[] data = contents.getBytes("UTF8"); //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import java.util.Set;

/**
* Manage a Map<T1, Set<T2>>, with reverse links so that it is possible to
* Manage a {@code Map<T1, Set<T2>>}, with reverse links so that it is possible to
* efficiently find all T1s that have a particular T2 associated with them.
* Access to the map is synchronized, so that it is possible to read and
* write simultaneously from multiple threads. Set semantics are preserved
* in both directions, so there is no distinction between calling this a
* Map<T1, Set<T2>> versus a Map<T2, Set<T1>>. It is symmetric.
* {@code Map<T1, Set<T2>> versus a Map<T2, Set<T1>>}. It is symmetric.
* <p>
* The map permits the null value for keys and for value elements.
* <p>
Expand All @@ -38,6 +38,7 @@
* <li> If a value exists, it has at least one key associated with it; that is,
* for all v such that null != containsValue(v), getKeys(v) returns a non-empty
* set.</li>
* </ul>
*/
public class ManyToMany<T1, T2> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public class IdeAnnotationProcessorManager extends BaseAnnotationProcessorManage
* Initialize the processor manager for a particular project. It is an error
* to initialize a manager more than once.
*
* @param abstractImageBuilder must be an instanceof AbstractImageBuilder.
* (But it can't be prototyped that way because the abstract base class must
* compile without Eclipse platform code.)
*
* @param javaProject must be an instanceof IJavaProject. (But it can't be
* prototyped that way because the abstract base class must compile without
* Eclipse platform code.)
Expand Down Expand Up @@ -126,7 +122,7 @@ public ICompilationUnit findCompilationUnit(IFile file) {
* then we can avoid doing the work of walking the ASTs to search for annotations. We still
* need to clean up no-longer-generated files when the factory path is changed, but the best
* way to do that is to force a clean build.
* @see BaseAnnotationProcessorManager#processAnnotations(CompilationUnitDeclaration[], boolean)
* @see BaseAnnotationProcessorManager#processAnnotations(CompilationUnitDeclaration[], ReferenceBinding[], boolean)
*/
@Override
public void processAnnotations(CompilationUnitDeclaration[] units, ReferenceBinding[] referenceBindings, boolean isLastRound) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class IdeOutputNonSourceFileObject extends IdeOutputFileObject
/**
* Create a new IdeOutputFileObject for writing. The file will not actually be written until the Writer or OutputStream is closed.
* @param env among other roles, the ProcessingEnvironment tracks what files have been generated in a given build.
* @param location must be an output location (see {@link Location#isOutputLocation()}).
* @param file must be an output location (see {@link Location#isOutputLocation()}).
* @see javax.tools.StandardLocation
*/
public IdeOutputNonSourceFileObject(IdeProcessingEnvImpl env, IFile file, Set<IFile> parentFiles) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void testMethodType() throws Throwable {
/**
* Test whether problems with severity Info are flagged accordingly.
*
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=83548
* see https://bugs.eclipse.org/bugs/show_bug.cgi?id=83548
*/
public void testInfoProblems() throws Throwable {
ProcessorTestStatus.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,6 @@ protected IMarker[] getAllAPTMarkers(IPath path){
/**
* Verifies that the given element has specifics problems and
* only the given problems.
* @see Tests#expectingOnlySpecificProblemsFor(IPath, Problem[]), and
* @see Tests#expectingSpecificProblemsFor(IPath, Problem[], boolean).
* Unfortunately this variant isn't implemented there.
*/
protected void expectingOnlySpecificProblemsFor(IPath root, ExpectedProblem[] expectedProblems) {
if (DEBUG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void testGeneratedFileInBuilder() throws Exception
}

/**
* Regresses Buzilla 103745 & 95661
* Regresses Buzilla 103745 and 95661
*/

public void testGeneratedFileInBuilder_ProjectRootAsSourceDir() throws Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void testGeneratedFileInBuilder() throws Exception
}

/**
* Regresses Buzilla 103745 & 95661
* Regresses Buzilla 103745 and 95661
*/

public void testGeneratedFileInBuilder_ProjectRootAsSourceDir() throws Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public static java.io.File getFileInPlugin(Plugin plugin, IPath path)
* Could use File.renameTo(File) but it's platform dependant.
*
* @param from - The file to move
* @param path - The path to move it to
* @param toPath - The path to move it to
*/
public static void moveFile(File from , String toPath)
throws FileNotFoundException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
* Preference pane for most APT (Java annotation processing) settings.
* see org.eclipse.jdt.ui.internal.preferences.TodoTaskConfigurationBlock
* for the conceptual source of some of this code.
* <p>
*/
public class AptConfigurationBlock extends BaseConfigurationBlock {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public static void compileTreeAndProcessBinaries(JavaCompiler compiler, List<Str
* @param compiler the system compiler or Eclipse compiler
* @param options will be passed to the compiler
* @param targetFolder the folder to compile
* @param errors a StringWriter into which compiler output will be written
* @param diagnosticListener a DiagnosticListener into which compiler output will be written
* @return true if the compilation was successful
*/
public static boolean compileTreeWithErrors(
Expand Down Expand Up @@ -391,8 +391,8 @@ public static boolean compileTreeWithErrors(
/**
* Recursively collect all the files under some root. Ignore directories named "CVS".
* Used when compiling multiple source files.
* @param files a List<File> to which all the files found will be added
* @return the set of Files under a root folder.
* @param rootFolder a {@code List<File>} to which all the files found will be added
* @param files the set of Files under a root folder to return.
*/
public static void findFilesUnder(File rootFolder, List<File> files) {
for (File child : rootFolder.listFiles()) {
Expand Down Expand Up @@ -585,7 +585,7 @@ public static boolean shouldConvertToIndependentLineDelimiter(File file) {
*
* @param src
* the full path to the resource location.
* @param destFolder
* @param dest
* the full path to the destination location.
*/
public static void copyResource(File src, File dest) throws IOException {
Expand Down Expand Up @@ -653,7 +653,7 @@ public static File copyResource(String resourcePath, File targetFolder) throws I
* named "CVS" will be ignored.
* @param resourceFolderName the name of the source folder, relative to
* <code>[plugin-root]/resources</code>
* @param the absolute path of the destination folder
* @param destFolder the absolute path of the destination folder
*/
public static void copyResources(String resourceFolderName, File destFolder) throws IOException {
File resDir = new File(getPluginDirectoryPath(), RESOURCES_DIR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.eclipse.jdt.internal.compiler.env.*;
import org.eclipse.jdt.internal.compiler.impl.*;
import org.eclipse.jdt.internal.compiler.lookup.TagBits;
import org.eclipse.jdt.internal.compiler.util.CharDeduplication;
import org.eclipse.jdt.internal.compiler.util.Util;

public class AnnotationInfo extends ClassFileStruct implements IBinaryAnnotation {
Expand Down Expand Up @@ -57,7 +58,7 @@ public class AnnotationInfo extends ClassFileStruct implements IBinaryAnnotation
private void decodeAnnotation() {
this.readOffset = 0;
int utf8Offset = this.constantPoolOffsets[u2At(0)] - this.structOffset;
this.typename = utf8At(utf8Offset + 3, u2At(utf8Offset + 1));
this.typename = CharDeduplication.intern(utf8At(utf8Offset + 3, u2At(utf8Offset + 1)));
int numberOfPairs = u2At(2);
// u2 type_index + u2 num_member_value_pair
this.readOffset += 4;
Expand Down

0 comments on commit 872ac11

Please sign in to comment.