Commit Graph

184 Commits

Author SHA1 Message Date
Daniel Chao
d28313bca8 Declare members of http package NonnullByDefault (#471)
* Add a package-info.java with NonnullByDefault annotation
* Make RequestCapturingClient return a response to satisfy the type checker
2024-05-03 09:58:01 -07:00
Islon Scherer
27d8a030b1 Remove hidden modifier from many reflect properties for better equality/rendering (#470) 2024-05-03 11:04:15 +02:00
Philip K.F. Hölzenspies
b5208a2b5b Swap Kotlin/Groovy tab order in documentation (#469)
* Swap Kotlin/Groovy tab order in documentation

* Use Kotlin DSL repository extension function
2024-05-02 15:26:43 +01:00
kuu(Fumiya Kume)
c959888f0b Fix CI to use JDK17 in deployment jobs (#468) 2024-05-01 09:09:36 -07:00
translatenix
ea3e8f115b Improve conditional configuration of native build tasks (#465)
- Move all conditional configuration to the `assembleNative` and `testNative` "root" tasks
- Don't build aarch64 executable on Intel Mac
2024-04-30 15:57:39 -07:00
translatenix
e49a36e318 Make Java classes final if possible
Also add private no-arg constructors for classes that aren't meant to be instantiated.
2024-04-30 15:14:14 -07:00
translatenix
ae69e4776f Fix IntelliJ warnings in Java code
Fix all IntelliJ warnings in Java production code except for
bogus spelling warnings and warnings about unused public methods.
Also fix some warnings emitted by Code->Inspect Code.

Changes made:
- use text block instead of string concatenation
- extract method to avoid code duplication
- use switch expression
- fix Javadoc syntax and spelling
- fix spelling in comment
- increase class visibility to match visibility of use site
- delete overriding method with same implementation
- use String.isEmpty() and StringBuilder.isEmpty()
- add @Serial annotation
- make field final
- remove unused field
- remove unused private method
- remove exceptions that aren't thrown from throws clause
- insert non-null assertion
- annotate overriding method with @Nonnull
- suppress warning
- delete unused class (WriteAuxiliarySlotNode)
- add final modifier
- remove unused error message
- repeat @Nullable modifier in overriding method
- remove never thrown exception from throws clause
- remove redundant suppression
2024-04-30 15:14:14 -07:00
translatenix
5feaa2aaf7 Remove remnants of Alpine Linux workaround (#466) 2024-04-30 15:12:30 -07:00
Daniel Chao
ed1b317801 Fix formatting error (#463) 2024-04-30 07:33:36 -07:00
Daniel Chao
0d3400fb59 Don't install GraalVM for an architecture that can't be built (#452)
This fixes an issue where the build native tasks will try
to install GraalVM for an architecture that it can't build.
2024-04-29 15:36:27 -07:00
translatenix
fd1c294146 Remove obsolete Alpine Linux workaround (#457)
The bug necessitating this workaround was fixed in October 2022.

For details: https://github.com/oracle/graal/issues/3398
2024-04-29 11:13:01 -07:00
Mark Robinson
c3a99f8ae6 Fix error handler to use new message 2024-04-29 14:52:29 +02:00
Mark Robinson
b433500e04 Update pkl-core/src/main/resources/org/pkl/core/errorMessages.properties
Co-authored-by: Philip K.F. Hölzenspies <holzensp@gmail.com>
2024-04-29 14:52:29 +02:00
Mark Robinson
f857223511 Update pkl-core/src/main/resources/org/pkl/core/errorMessages.properties
Co-authored-by: Philip K.F. Hölzenspies <holzensp@gmail.com>
2024-04-29 14:52:29 +02:00
Mark Robinson
c331dede3c Adjust wording in error 2024-04-29 14:52:29 +02:00
Mark Robinson
b9e94b94ae Fix handling of other http error codes when creating packages 2024-04-29 14:52:29 +02:00
Daniel Chao
e28d747418 JDK version bump cleaups, bump minimum Gradle version to 8.1 (#454)
* Bump JDK when running simple gradle CI jobs
* Bump minimum Gradle version to 8.1
* Fix docs, and fix minimum version checker
2024-04-26 07:42:39 -07:00
translatenix
a7c7e51180 Leverage basic Java 17 features (#451)
- Refactor code to use the following basic Java 17 features:
  - pattern matching for instanceof
  - @Serial annotation
  - switch expressions
  - enhanced switch statements
  - StringBuilder.isEmpty()
- Replace two switch statements with simpler if statements.
- Rename a few local variables.
2024-04-25 12:52:28 -07:00
Daniel Chao
3ab9e4184e Drop java 11, bump GraalVM to 23.0 (#439)
* Remove unnecessary strictfp modifier
* Add annotations to address Truffle DSL warnings (@Idempotent, @Exclusive)
* Adjust build logic to allow building cross-arch on macOS
* Add warning suppression for specialization limit (left this one as a TODO)
2024-04-24 16:17:19 -07:00
Mitch Capper
583dfc6927 Windows installation notes 2024-04-24 12:37:11 +02:00
translatenix
3a31188cc1 Improve method.isConst() check in InvokeSuperMethodNode
Check const-ness every time a method is resolved instead of every time it is called.
2024-04-19 15:35:57 -07:00
translatenix
5de90d5868 Improve method.isConst() checks in InvokeMethodVirtualNode
- Check `method.isConst()` every time a method is resolved
  instead of once per node instance (`isConstChecked`).
  Given that `needsConst` only happens in very specific circumstances,
  I'm not entirely sure if every resolved method needs to be checked.
  However, it's a cleaner solution in any case, and `method.isConst()`
  is a fast check that also never happens on the `evalCached` fast path.
- Do not check for const-ness of `FunctionN.apply` methods.
  This check seems unnecessary and would always fail if triggered.
  (According to `base.pkl`, none of the `FunctionN.apply` methods is const.)
- Remove unnecessary Truffle boundaries for modifier checks,
  which are just bitwise operations.
- Improve const/import docs.
2024-04-19 15:35:57 -07:00
Lily Ballard
76f1b92039 Enable useCustomStringDelimiters for pkl test example output (#416)
This makes the `<file>-expected.pcf` file a bit easier to read when examples contain quotes or
backslashes.
2024-04-18 12:58:05 -07:00
Stefano Baghino
81bfdb7cbd Enable caching of native image building and test tasks (#409)
Enable caching for the native image building task and improves the caching effectiveness of some of the test tasks in the project.
2024-04-18 08:28:56 -07:00
Kushal Pisavadia
31917d1556 Suppress warnings for System.getProperty("line.separator") (#432)
`class System` gets initialized at build time through `native-image`
and added to the heap. We initialize everything at build time via the
`--initialize-at-build-time=` flag.
2024-04-17 21:23:24 -07:00
Phillip
ccf95d2af1 Correct spelling and grammar issues in Language Reference (#435)
Changes include:
1. Spelling correction addressing #401
2. Grammer and punctuation corrections.
3. Rephrasing of some harder-to-read sentences. Most are simple one or two-word additions to make reading less jarring.
4. Changed hyphenation occurrences that included &ndash; rather than a regular hyphen-dash.
2024-04-17 16:44:19 -07:00
translatenix
5510bf12d2 Eliminate redundant map lookup (#433) 2024-04-17 16:37:55 -07:00
translatenix
52ce6815d1 Fix IntelliJ scope definition (#434) 2024-04-17 13:38:09 -07:00
Takumi Muraishi
5fa598f636 Fix typos (#436) 2024-04-17 13:37:59 -07:00
translatenix
e688b4d4e1 Fix typo (#437) 2024-04-17 13:37:45 -07:00
luuvish
2f0436ff2f Cannot assign property with fixed/const in spread (#428)
When using spread syntax with typed object, properties that are fixed
or const cannot be assigned or amended.
This should be checked in the checkTypedProperty() function.
2024-04-16 14:45:33 -07:00
Daniel Chao
6e2ea07986 Fix documentation about ValueRenderer converters (#422)
* Class-based converters are covariant, not invariant.
* The most specific class-based converter wins
* The first declared path-based converter that matches wins
2024-04-16 10:28:05 -07:00
translatenix
90b461aa58 Support building with JDK 21 (#234)
- Update google-java-format to a version compatible with JDK 21 and run "gw spotlessApply".
- Fix wrong test assumption
  JavaCodeGenerator writes a properties file using java.util.Properties,
  which doesn't guarantee order of entries.
- Fix most deprecation warnings
- Add CI job for JDK 21
2024-04-12 13:38:31 -07:00
Lily Ballard
f71323024c Fix pkl.reflect#typedType to mirror the right type (#426) 2024-04-12 13:35:35 -07:00
Lily Ballard
889e64586a Fix member links custom link text examples in language reference (#427) 2024-04-12 13:35:08 -07:00
translatenix
af66532377 Lock JLine to previous version (3.23.0) (#424)
JLine 3.25.1 does not work with native image.
2024-04-11 21:55:38 -07:00
Stefan M
033db30b04 Convert CODE_OF_CONDUCT to Markdown (#417) 2024-04-11 21:25:53 -07:00
translatenix
bba5387f17 Update dependencies (#350)
* Update various dependencies
* Freeze kotlinx.html and kotlinx.serialization versions until Kotlin itself is updated.
2024-04-11 20:54:01 -07:00
Philip K.F. Hölzenspies
309e3ff4f6 Update expected test outcome 2024-04-10 14:02:36 +01:00
luuvish
375b88f53e Fix the sequence length in the YAML parser
The initialSize in EconomicsMaps.create() is not the actual stored size,
hence the accurate size is not determined until ObjectMembers are added
after addMembers() called.

Since the size set during the creation of VmListing cannot be changed
afterwards, the size of node.getValue() is used instead of members'
size.
2024-04-10 14:02:36 +01:00
translatenix
3c6df1fe34 Turn EvalTask into a tracked Gradle task
Rationale: "Output file names are known only after execution"
isn't a legitimate reason to make this task untracked
because the output directory is known in this case.
This is no different from (say) the `JavaCompile` task,
where only the class file output directory is known upfront.
Forum discussion didn't reveal another reason why this task
should be untracked.
2024-04-05 15:04:48 +01:00
translatenix
2392a3c22f Add quick link to standard library docs
Motivation:
The standard library docs are some of the most important docs
but currently very hard to find. I've noticed that even advanced
users have never heard of them and complain about "zero docs".
2024-04-05 12:38:55 +01:00
Jungwoo
0f9ef53126 fix: add test 2024-04-05 11:18:02 +01:00
Jungwoo Yang
35490dc559 Fix MergeSort.java 2024-04-05 11:18:02 +01:00
translatenix
d916345d2c Use Files.newInputStream()/newOutputStream() where appropriate (#383)
Use `Files.newInputStream(path)` instead of `new FileInputStream(path.toFile())`
and `Files.newOutputStream(path)` instead of `new FileOutputStream(path.toFile())`.
2024-04-04 16:04:14 -07:00
translatenix
57f45c80c6 Update to Gradle 8.7 (#396)
Update Gradle by running the following command:
gw wrapper --gradle-version latest --gradle-distribution-sha256-sum
544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d

Manually verify wrapper JAR according to:
https://docs.gradle.org/current/userguide/gradle_wrapper.html#manually_verifying_the_gradle_wrapper_jar
2024-04-04 16:02:22 -07:00
Daniel Chao
58ed8242af Fix links for downloading snapshot executables (#391)
Also, quote the URLs for better shell compatibility
2024-04-04 07:43:42 -07:00
translatenix
3bd91b92ee Fix "amends declaration vs. expression" mistakes in language reference 2024-04-03 19:06:54 +01:00
Daniel Chao
28448b5512 Ensure owner and receiver are reset after executing alias (#373)
This fixes an issue where the frame's owner/receiver are not reset
if a type test on a typealias fails.
2024-03-28 07:58:22 -07:00
Daniel Chao
759d4806c0 Fix java/kotlin usage examples (#372)
Co-authored-by: Fruxz <28064149+TheFruxz@users.noreply.github.com>
2024-03-28 07:57:28 -07:00