Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8285932 Implementation of JEP 430 String Templates (Preview) #10889

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
32381da
Initial merge of string templates
JimLaskey Oct 17, 2022
af87554
Merge branch 'master' into 8285932
JimLaskey Oct 18, 2022
cf9a060
Add MakeConcatWithTemplate and StringConcatItem tests
JimLaskey Oct 18, 2022
7356bb2
Merge branch 'master' into 8285932
JimLaskey Oct 19, 2022
95c9820
Clean up tests
JimLaskey Oct 19, 2022
97b72de
Rename TemplateProcessor
JimLaskey Oct 20, 2022
beb3975
Javadoc mistakes
JimLaskey Oct 21, 2022
e29719e
Rename to ValidatingProcessor
JimLaskey Oct 21, 2022
c9748b3
Merge branch 'master' into 8285932
JimLaskey Oct 21, 2022
b62f9b8
Added RAW template processor
JimLaskey Oct 24, 2022
a4469ec
Add valueGetters method
JimLaskey Oct 27, 2022
0cfd07f
Correct implNote
JimLaskey Oct 27, 2022
da07f3a
Force processor before template string expression
JimLaskey Oct 27, 2022
7b2011a
Tabs to spaces
JimLaskey Oct 27, 2022
2648596
Move StringConcatItem to FormatConcatItem
JimLaskey Oct 28, 2022
20f54de
Update TemplateRuntime::combine
JimLaskey Oct 28, 2022
347df71
Remove .orig file
JimLaskey Oct 28, 2022
15e32a7
Requested changes
JimLaskey Oct 28, 2022
d30e6ef
Requested changes #2
JimLaskey Oct 31, 2022
75fcc49
Move template bootstrap
JimLaskey Oct 31, 2022
6d1d902
Add @SafeVarargs declarations
JimLaskey Oct 31, 2022
6cea084
Merge branch 'master' into 8285932
JimLaskey Nov 2, 2022
c81d0d2
Requested changes #3
JimLaskey Nov 2, 2022
7610dd0
Requested changes #4
JimLaskey Nov 2, 2022
2cf00ca
Internalize TemplateSupport
JimLaskey Nov 2, 2022
7f3d652
Requested changes #5
JimLaskey Nov 3, 2022
b35ed66
Internalize FormatConcatItem
JimLaskey Nov 3, 2022
c8412eb
Merge branch 'master' into 8285932
JimLaskey Nov 9, 2022
1af7dc1
Switch from anonymous classes to carrier based StringTemplate implem…
JimLaskey Nov 9, 2022
39c63c0
Clean up new StringTemplate creation
JimLaskey Nov 10, 2022
ac5402e
Requested changes #5
JimLaskey Nov 10, 2022
2dc2cad
Requested changes #7
JimLaskey Nov 14, 2022
c15142a
Merge branch 'master' into 8285932
JimLaskey Nov 14, 2022
59d7037
Wrong line separator
JimLaskey Nov 14, 2022
e4812ee
Wrong line separator
JimLaskey Nov 14, 2022
dcceb67
Requested changes #8
JimLaskey Nov 16, 2022
9fdd999
Update StringTemplate javadoc
JimLaskey Nov 16, 2022
2edc792
Requested changes #8
JimLaskey Nov 16, 2022
89f9ac0
Requested changes #9
JimLaskey Nov 17, 2022
fc67965
Requested changes #10
JimLaskey Nov 18, 2022
c51f88c
Typo
JimLaskey Nov 18, 2022
f2562ab
Requested changes #11
JimLaskey Nov 21, 2022
da3ea20
Seal Digits
JimLaskey Nov 21, 2022
e9f52f2
Requested changes #12
JimLaskey Nov 23, 2022
09f1ac0
Update @since
JimLaskey Nov 23, 2022
69efbb4
FormatProcessor changes
JimLaskey Nov 24, 2022
581e0f7
Merge branch 'master' into 8285932
JimLaskey Dec 2, 2022
098467f
Merge branch 'master' into 8285932
JimLaskey Jan 5, 2023
57638f9
Update to JDK 21
JimLaskey Jan 11, 2023
264120a
Merge branch 'master' into 8285932
JimLaskey Feb 10, 2023
665cded
Bring up to date
JimLaskey Feb 10, 2023
8f5ad0a
CSR review
JimLaskey Feb 10, 2023
5fab46c
Merge branch 'master' into 8285932
JimLaskey Feb 10, 2023
5a031bd
Minor correction to javadoc
JimLaskey Feb 10, 2023
95d219a
Merge branch 'master' into 8285932
JimLaskey Feb 11, 2023
89806d4
Merge branch 'master' into 8285932
JimLaskey Feb 23, 2023
85cc7ef
Tighten up reporting of string template errors (fewer messages)
JimLaskey Feb 27, 2023
67c77e0
Javadoc corrections and bug fix for StringTemplate::combine
JimLaskey Mar 6, 2023
5d79f65
Merge branch 'master' into 8285932
JimLaskey Mar 6, 2023
e104926
Merge branch 'master' into 8285932
JimLaskey Mar 10, 2023
50456b3
Correction
JimLaskey Mar 10, 2023
d6947fd
Merge branch 'master' into 8285932
JimLaskey Mar 16, 2023
ead4342
Rename StringTemplate classes
JimLaskey Mar 16, 2023
9ba6400
Tidy javadoc
JimLaskey Mar 17, 2023
6f95d95
Review recommended changes
JimLaskey Mar 23, 2023
96752c6
Clean up list construction
JimLaskey Mar 23, 2023
58eeb31
Requested review changes.
JimLaskey Mar 27, 2023
c9696c2
Update StringTemplate.combine javadoc
JimLaskey Mar 28, 2023
3e1cc74
Merge branch 'master' into 8285932
JimLaskey Mar 29, 2023
67ffbcc
Update combine example
JimLaskey Mar 29, 2023
6274eb3
RuntimeException is the only exception type that can is deduced from …
JimLaskey Apr 4, 2023
4c6d70d
Recommended changes
JimLaskey Apr 4, 2023
62eadb8
Clean up Error handling
JimLaskey Apr 8, 2023
6016deb
Change MAX_INDY_CONCAT_ARG_SLOTS to be updatable.
JimLaskey Apr 8, 2023
f1b187a
Merge branch 'master' into 8285932
JimLaskey Apr 12, 2023
5e0dfce
Recommended changes
JimLaskey Apr 13, 2023
69f49bd
Remove preview feature on package private java.util.Digits
JimLaskey Apr 13, 2023
961a541
HexDigits -> OctalDigits
JimLaskey Apr 13, 2023
f27ad70
Typo
JimLaskey Apr 13, 2023
70c215c
Remove @PeviewFeature(feature=PreviewFeature.Feature.STRING_TEMPLATES…
JimLaskey Apr 13, 2023
2e3f2ce
Tidy up
JimLaskey Apr 17, 2023
c6d943c
Spacing
JimLaskey Apr 18, 2023
5c18223
Merge branch 'master' into 8285932
JimLaskey Apr 27, 2023
fb406d2
CSR recommendations
JimLaskey Apr 27, 2023
53f6280
Requested changes
JimLaskey May 8, 2023
8e83e10
Recommended changes
JimLaskey May 9, 2023
2ac6252
Dangling <p>
JimLaskey May 9, 2023
f4f2661
Merge branch 'master' into 8285932
JimLaskey May 9, 2023
6b09d2e
Update TestJavacTaskScanner.java
JimLaskey May 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -33,7 +33,11 @@
import java.lang.template.ProcessorLinkage;
import java.lang.template.StringTemplate;
import java.lang.template.ValidatingProcessor;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import jdk.internal.access.JavaTemplateAccess;
import jdk.internal.access.SharedSecrets;
Expand Down
Expand Up @@ -47,8 +47,11 @@
@PreviewFeature(feature=PreviewFeature.Feature.STRING_TEMPLATES)
public sealed interface ProcessorLinkage permits FormatProcessor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be exposed? FormatProcessor is the only permitted type, so javac could detect that (or have an internal list of supported optimized processors).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth changing at this point. The plan is to replace with TemplateProcessorFactories.

/**
* Construct a {@link MethodHandle} that constructs a result based on the
* bootstrap method information.
* This method creates a {@link MethodHandle} that when invoked with arguments of
* those specified in {@code type} returns a result that equals that returned by
* the template processor's process method. The difference being that this method
* can preview the template's fragments and value types in advance of usage and
* thereby has the opportunity to produce a specialized implementation.
*
* @param fragments string template fragments
* @param type method type
Expand Down
Expand Up @@ -47,4 +47,6 @@
*/
@PreviewFeature(feature=PreviewFeature.Feature.STRING_TEMPLATES)
@FunctionalInterface
public interface TemplateProcessor<R> extends ValidatingProcessor<R, RuntimeException> {}
public interface TemplateProcessor<R> extends ValidatingProcessor<R, RuntimeException> {

}