Skip to content

[#1841] Escaping curly braces in MessageBundle #1842

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DEFAULT_GETTER_LIST_JAVADOC = \
<p>This accessor method returns a reference to the live list,\n\
not a snapshot. Therefore any modification you make to the\n\
returned list will be present inside the Jakarta XML Binding object.\n\
This is why there is not a {@code set} method for the {0} property.</p>\n\n\
This is why there is not a '{'@code set'}' method for the {0} property.</p>\n\n\
<p>\n\
For example, to add a new item, do as follows:\n\
</p>\n\
Expand Down
21 changes: 21 additions & 0 deletions jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/XjcDtdPluginTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2025 Contributors to the Eclipse Foundation. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand Down Expand Up @@ -81,4 +82,24 @@ public void postProcessModel(Model model, ErrorHandler errorHandler) {
wasPostProcessModelHookCalled[0]
);
}

@Test
public void testIssue_cannotRenderJavadocForLists() throws Exception {
final OptionsEx opt = new OptionsEx();
opt.setSchemaLanguage(Language.DTD);
opt.compatibilityMode = Options.EXTENSION;

opt.addGrammar(
new InputSource(
new ByteArrayInputStream("<!ELEMENT AnElement1 (#PCDATA)>\n<!ELEMENT AnElement2 (#PCDATA)>\n<!ELEMENT AnElement (AnElement1 | AnElement2)>".getBytes())
)
);

Model model = ModelLoader.load(
opt,
new JCodeModel(),
null
);
model.generateCode(opt, null);
}
}