Repository navigation
Conversation
Contributor
|
Nice. I'd very much like to have forEach read more like a conventional loop... |
This was referenced Oct 1, 2026
Closed
This was referenced Oct 31, 2026
bric3
force-pushed
the
bdu/use-prince-of-space
branch
from
November 1, 2026 15:36
2c7ea9f to
d929fef
Compare
bric3
force-pushed
the
bdu/use-prince-of-space
branch
from
November 1, 2026 19:44
d929fef to
374c313
Compare
bric3
force-pushed
the
bdu/use-prince-of-space
branch
from
November 2, 2026 10:52
374c313 to
933e5b6
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Switches all five Spotless Java configurations from google-java-format 1.36.1 to Prince of Space 2.3.1.
It keeps two-space indentation, a 100-character line width, Java 25 syntax and Prince's default closing-parenthesis placement, and updates the contributor and agent guides.
Spotless remains at 8.10.4 and TableTest formatter at 1.1.2; the native integration loads the explicitly pinned Prince version.
Representative Formatting Changes
Each diff compares google-java-format 1.36.1 on master
3ab1b20503with Prince of Space 2.3.1 on2931a8d7dc. Lambda and anonymous-class excerpts include their closing braces and parentheses.Lambda Pipelines
PluginApplication.java
Fluent Calls
AdviceGeneratorImpl.java
Nested Callbacks
CoreTracer.java
Nested Lambda Pipelines
AssertBuilder.java
protected Set<Class<?>> getSpi(ClassOrInterfaceDeclaration type) { - return type.getAnnotationByName("AutoService") - .<Set<Class<?>>>map( - annotation -> - annotation.asNormalAnnotationExpr().getPairs().stream() - .filter(pair -> pair.getNameAsString().equals("value")) - .flatMap( - pair -> - pair.getValue().asArrayInitializerExpr().getValues().stream() - .map( - value -> - value - .asClassExpr() - .getType() - .resolve() - .asReferenceType() - .getTypeDeclaration() - .get() - .getQualifiedName())) - .map(AssertBuilder::loadClass) - .collect(Collectors.toSet())) - .orElse(Collections.emptySet()); + return type + .getAnnotationByName("AutoService") + .<Set<Class<?>>>map(annotation -> annotation + .asNormalAnnotationExpr() + .getPairs() + .stream() + .filter(pair -> pair.getNameAsString().equals("value")) + .flatMap(pair -> pair + .getValue() + .asArrayInitializerExpr() + .getValues() + .stream() + .map(value -> value + .asClassExpr() + .getType() + .resolve() + .asReferenceType() + .getTypeDeclaration() + .get() + .getQualifiedName())) + .map(AssertBuilder::loadClass) + .collect(Collectors.toSet())) + .orElse(Collections.emptySet()); }Balanced Parameter Wrapping
PluginApplication.java
The configuration uses two-space indentation, a 100-character line width, balanced wrapping and Prince's default
closingParenOnNewLine(true).Lambda in an HTTP Builder Chain
SharedCommunicationObjects.java
Before (google-java-format 1.36.1):
After (Prince of Space 2.3.1):
Anonymous Classes in Method Calls
PluginApplication.java
Ternary Expressions
SharedCommunicationObjects.java
Mandatory Braces
CoreTracer.javaJavadoc Normalisation
CoreTracer.javaImport Separation
PluginApplication.javaimport static datadog.trace.plugin.csi.impl.CallSiteFactory.typeResolver; - import datadog.trace.plugin.csi.AdviceGenerator.CallSiteResult;Motivation
Refresh the formatter experiment with Prince of Space 2.3.1, including its surrogate, NUL escape and trailing-array-comment fixes.
Additional Notes
This is the configuration base of the two-PR draft experiment. The regenerated Java output is in #12445.
Both branches were rebuilt from freshly fetched master at
3ab1b2050365377e42f546710cfdc314639476b0.Caution
The Prince of Space 2.3.1 / TableTest formatter 1.1.2 pipeline still requires 129 file exclusions:
These files retain their exact content from master. The exclusions are listed in
gradle/spotless.gradle.Prince 2.3.1 preserves the surrogate char literals in both
TraceGeneratorfixtures and the escaped NUL inPatchUtil, so these three files are re-enabled. The exclusions decrease from 132 to 129.ClientIpAddressResolvernow formats its IPv4 range array without the added fence: its range comments appear once and in order.TagInterceptorTestkeeps two narrowspotless:off/spotless:onfences for long TableTest arrays; their comments now identify the TableTest formatter as the component that corrupts concatenated rows.Direct API checks reproduce the TableTest failure independently of Prince. The three targeted Prince reproductions pass with 2.3.1. Other comment duplication remains: Prince 2.3.1 prints the "All bits set" field comment in
DD64bTraceIdtwice, without Spotless or the TableTest formatter.The included sources pass the preservation audit and a forced second Java formatting pass. The audit checks parsed structure, identifiers, decoded literals and constant strings, TableTest data, comment content and order, and exact fenced regions. It permits added control-flow braces, conventional comment layout and import organisation. Inline comments can move to a preceding line.
The uncached repository-wide reformat used an 8 GB Gradle daemon heap after the 4 GB run exhausted its heap. Both final passes disable the build cache following a Spotless cached-output file-move failure.
A forced rerun of all Spotless formats stalled in
:dd-smoke-tests:java9-modules:spotlessGroovyGradleand was stopped. The forced stability check therefore targets Java formatting tasks.Focused core tests use a temporary external init script to omit an unrelated private container-image lookup; test caching is disabled for that run. Full-suite tests and performance benchmarks were not run.
The Palantir experiments are #12421 and #12422. The Google Java Format 2 experiments are #13144 and #13145.
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue