aboutsummaryrefslogtreecommitdiff
path: root/javatests
AgeCommit message (Collapse)Author
2023-07-04Only emit package-info's if the source file's path is 'package-info.java'Liam Miller-Cushon
To avoid emitting duplicate symbols when there are other files that contain no classes, and to match javac's behaviour. PiperOrigin-RevId: 545473342
2023-06-26Write `package-info`s even if the package info doesn't contain any annotationsLiam Miller-Cushon
Similar to javac's `-Xpkginfo:always` PiperOrigin-RevId: 543487269
2023-05-31Add a debug option to enable emitting private fieldsLiam Miller-Cushon
By default, turbine doesn't emit private fields in class files, because they don't affect downstream compilations. This makes it possible to emit private fields by setting a javac debug flag. PiperOrigin-RevId: 536836786
2023-05-08Handle synthetic method parameters entries that don't have namesLiam Miller-Cushon
> If the value of the name_index item is zero, then this parameters element indicates a formal parameter with no name. https://docs.oracle.com/javase/specs/jvms/se20/html/jvms-4.html#jvms-4.7.24 PiperOrigin-RevId: 530356139
2023-04-07Use `java.util.function.Function` instead of `com.google.common.base.Function`.Éamonn McManus
Also rewrite some cases of `new Function<...>() {...}` to use lambdas or method references. PiperOrigin-RevId: 522676112
2023-01-23Check interface and non-interface types in `extends` and `implements` listsLiam Miller-Cushon
PiperOrigin-RevId: 504078954
2023-01-23Don't crash on duplicate type parameter declarationsLiam Miller-Cushon
PiperOrigin-RevId: 504070824
2023-01-19Fix handling of implicit record constructorsLiam Miller-Cushon
A record has to have a primary constructor with parameters that correspond to the component types. https://github.com/bazelbuild/bazel/issues/17250 PiperOrigin-RevId: 503164403
2023-01-12Don't emit duplicate `toString`, `equals`, and `hashCode` methods in recordsLiam Miller-Cushon
These methods are only emitted if they don't already exist, per JLS 8.10.3. https://github.com/bazelbuild/bazel/issues/17181 PiperOrigin-RevId: 501618070
2023-01-05Fix a bug with javadoc comments followed by unicode escapesLiam Miller-Cushon
The lexer was advancing to the next character and then reading the string contents of the javadoc comment. It assumed that the next token corresponded to exactly one character in the input stream, which isn't true of unicode escapes. PiperOrigin-RevId: 499989979
2022-12-16Update ASM API levelLiam Miller-Cushon
PiperOrigin-RevId: 495922973
2022-11-30turbine: attach javadoc to enum membersJavac Team
PiperOrigin-RevId: 491951825
2022-11-08Improve implementation of `asMemberOf`Liam Miller-Cushon
PiperOrigin-RevId: 487077153
2022-10-25Update Error Prone versionLiam Miller-Cushon
PiperOrigin-RevId: 483696374
2022-10-25Default to `SourceVersion.latestSupported()` if an unrecognized source ↵Liam Miller-Cushon
version shows up PiperOrigin-RevId: 483693422
2022-09-06Fix a CCELiam Miller-Cushon
PiperOrigin-RevId: 472497302
2022-08-18Update string representation of annotated typesLiam Miller-Cushon
to match https://bugs.openjdk.org/browse/JDK-8281238, and only run the tests on JDK 19. Fixes e.g. ``` expected: DECLARED java.util.@p.Test4.A List<java.lang.@p.Test4.B Integer> but was : DECLARED @p.Test4.A java.util.List<@p.Test4.B java.lang.Integer> ``` PiperOrigin-RevId: 468587631
2022-08-15Use `InputStream#readAllBytes` instead of `ByteStreams#toByteArray`Liam Miller-Cushon
PiperOrigin-RevId: 467718127
2022-06-15Automatic code cleanup.Kurt Alfred Kluever
PiperOrigin-RevId: 455184757
2022-05-31Handle `sealed` psuedo-modifier on nested classesLiam Miller-Cushon
PiperOrigin-RevId: 452115286
2022-04-30Use well-formed URIs for `FileObject#toURI`Liam Miller-Cushon
The implementation doesn't support converting `URI`s for `FileObject`s to `Path`s and doing IO on them, but this at least makes them well-formed, and avoids errors like: ``` jshell> Paths.get(URI.create("file://foo")) | Exception java.lang.IllegalArgumentException: URI has an authority component | at UnixUriUtils.fromUri (UnixUriUtils.java:54) | at UnixFileSystemProvider.getPath (UnixFileSystemProvider.java:102) | at Path.of (Path.java:203) | at Paths.get (Paths.java:98) | at (#8:1) ``` https://github.com/micronaut-projects/micronaut-core/issues/7257 PiperOrigin-RevId: 445683352
2022-04-07Support zip64 extensible data sectorsLiam Miller-Cushon
PiperOrigin-RevId: 440187167
2022-03-23Initial support for text blocksLiam Miller-Cushon
PiperOrigin-RevId: 436825379
2022-03-15Add test case for https://github.com/bazelbuild/bazel/issues/15053Gunnar Wagenknecht
Test case for reproducing the parser problem reported in https://github.com/bazelbuild/bazel/issues/15053 Fixes #221 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/turbine/pull/221 from guw:main 300e8bf5abb556e96281f1b7d8ae50c0a813a855 PiperOrigin-RevId: 434827555
2022-03-15Fix parsing of qualified names in array literalsLiam Miller-Cushon
https://github.com/bazelbuild/bazel/issues/15053 PiperOrigin-RevId: 434815430
2022-03-10Fix handling of type variable bounds in `isSameSignature`Liam Miller-Cushon
PiperOrigin-RevId: 433891768
2022-02-10Don't crash on missing annotation argumentsLiam Miller-Cushon
If turbine creates annotation proxies for annotations missing required elements, they crash if the element is accessed. This should be an unrecoverable error that aborts annotation processing. PiperOrigin-RevId: 427775703
2022-02-01Automatic code cleanup.Kurt Alfred Kluever
PiperOrigin-RevId: 425631296
2022-01-27Automatic code cleanup.Liam Miller-Cushon
PiperOrigin-RevId: 424714767
2022-01-11Don't crash on `module-info.java`s is we can't load `java.base`Liam Miller-Cushon
This can happen when compiling a module declaration against a non-modular bootclasspath. The lookup of `java.base` is only used to get its version, which we can skip. PiperOrigin-RevId: 421040147
2021-12-23Remove uses of reflection now that we're testing on JDK 11+Liam Miller-Cushon
PiperOrigin-RevId: 418038103
2021-12-07Don't crash on constant dynamic constant pool entriesLiam Miller-Cushon
PiperOrigin-RevId: 414898023
2021-11-10Handle compact record constructorsLiam Miller-Cushon
https://github.com/bazelbuild/bazel/issues/14249 PiperOrigin-RevId: 408952084
2021-10-25Add support for `Elements#hides` to turbineLiam Miller-Cushon
Hiding for fields, classes, and methods is defined in https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html https://github.com/bazelbuild/bazel/issues/14142 PiperOrigin-RevId: 405438970
2021-10-04Fix `TypeElement.getSuperclass` for recordsLiam Miller-Cushon
PiperOrigin-RevId: 400768241
2021-10-01Initial support for sealed classesLiam Miller-Cushon
PiperOrigin-RevId: 400303125
2021-09-28Initial support for records in annotation processingLiam Miller-Cushon
including modeling record components distinctly from parameter declarations, since the annotation processing API cares about the distinction. PiperOrigin-RevId: 399603892
2021-09-27Initial support for recordsLiam Miller-Cushon
PiperOrigin-RevId: 399302681
2021-09-27Use Java 8 bytecode at minimumLiam Miller-Cushon
Follow-up to https://github.com/google/turbine/commit/006a74b6cd7565221a2d7fe9593c103bdd83584c. Supporting `-source 7 -target 7` regresses support for type annotations, since turbine continues to emit the attributes but they aren't recognized in v51 class files. PiperOrigin-RevId: 399244322
2021-09-23Improve major version handlingLiam Miller-Cushon
Parse -source/-target/--release flags from provided javacopts, and use them to set the major version of the classfile outputs, instead of trying to use the lowest possible version that supported the features in the output. PiperOrigin-RevId: 398583014
2021-09-21Normalize records and nestsLiam Miller-Cushon
Sort attributes, and remove unused nest members attributes (e.g. for local or anonymous classes, which don't show up in the API). PiperOrigin-RevId: 398031642
2021-09-21Clean up accidentally duplicated codeLiam Miller-Cushon
PiperOrigin-RevId: 398029001
2021-09-17Add parser support for recordsLiam Miller-Cushon
PiperOrigin-RevId: 397417470
2021-09-17Add class writing support for record and nest attributesLiam Miller-Cushon
* https://docs.oracle.com/javase/specs/jvms/se16/html/jvms-4.html#jvms-4.7.28 * https://docs.oracle.com/javase/specs/jvms/se16/html/jvms-4.html#jvms-4.7.29 * https://docs.oracle.com/javase/specs/jvms/se16/html/jvms-4.html#jvms-4.7.30 PiperOrigin-RevId: 397416507
2021-09-17Fix position of type annotationsLiam Miller-Cushon
PiperOrigin-RevId: 397354545
2021-09-16Fix an infinite loop in pretty-printingLiam Miller-Cushon
PiperOrigin-RevId: 397232971
2021-09-16Finish migrating to JSpecify annotationsLiam Miller-Cushon
PiperOrigin-RevId: 397209445
2021-09-02Explicitly represent parenthesized expressions in the ASTLiam Miller-Cushon
to fix order of operations when flattening binary trees. Follow-up to https://github.com/google/turbine/commit/fd0a45de2e1c39a2cb774d59c59904caa7040221 PiperOrigin-RevId: 394561504
2021-08-27Flatten `BinaryTree`s to avoid recursing into themLiam Miller-Cushon
This avoids creating very deeply nested binary trees for constant string literals (e.g. `a + b + c + d` parses as `(((a + b) + c) + d)`) which can cause turbine to run out of stack evaluating constant expressions. This replaces the accessors for the left and right children of a binary tree with a method that flattens any nested binary trees with the same operator kind, and returns the children as a list. PiperOrigin-RevId: 393450281
2021-08-23Fix an NPELiam Miller-Cushon
PiperOrigin-RevId: 392546577