Skip to content

Commit

Permalink
Integrate dtd-parser 1.5.1
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <[email protected]>
  • Loading branch information
lukasj committed Oct 20, 2023
1 parent 1551e75 commit 8aed67b
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 29 deletions.
2 changes: 1 addition & 1 deletion jaxb-ri/boms/bom-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<properties>
<codemodel.version>${project.version}</codemodel.version>
<dtd-parser.version>1.5.0</dtd-parser.version>
<dtd-parser.version>1.5.1</dtd-parser.version>
<relaxng.version>${project.version}</relaxng.version>
<xsom.version>${project.version}</xsom.version>
<ant.version>1.10.14</ant.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@
<title>Changelog</title>

<para>The &binding.impl.name; 4.x meets the requirements of the Jakarta XML Binding 4.x specifications.</para>
<section xml:id="a-4-0-4">
<section xml:id="a-4-0-5">
<title>Changes between 4.0.4 and 4.0.5</title>
<itemizedlist>
<listitem><para>Bug fixes:
<itemizedlist>
<listitem><para>
<link xlink:href="https://github.com/eclipse-ee4j/jaxb-dtd-parser/issues/39">dtd-parser #39</link>: Parser parses #IMPLIED use attributes as NORMAL (and vice versa)
</para></listitem>
<listitem><para>
<link xlink:href="https://github.com/eclipse-ee4j/jaxb-dtd-parser/issues/40">dtd-parser #40</link>: Occurrence constants are misspelled
</para></listitem>
</itemizedlist>
</para></listitem>
</itemizedlist>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. 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 All @@ -15,14 +15,14 @@


/**
* represents a possible number of occurence.
* represents a possible number of occurrence.
*
* Usually, denoted by a pair of integers like (1,1) or (5,10).
* A special value "unbounded" is allowed as the upper bound.
*
* <p>
* For example, (0,unbounded) corresponds to the '*' occurence of DTD.
* (0,1) corresponds to the '?' occurence of DTD.
* For example, (0,unbounded) corresponds to the '*' occurrence of DTD.
* (0,1) corresponds to the '?' occurrence of DTD.
*
* @author
* <a href="mailto:[email protected]">Kohsuke KAWAGUCHI</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. 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 @@ -42,7 +42,7 @@ public final class RawTypeSet {
public final Mode canBeTypeRefs;

/**
* The occurence of the whole references.
* The occurrence of the whole references.
*/
public final Multiplicity mul;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. 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 All @@ -18,27 +18,27 @@
/**
* @author Kohsuke Kawaguchi
*/
final class Occurence extends Term {
final class Occurrence extends Term {
final Term term;
final boolean isOptional;
final boolean isRepeated;

Occurence(Term term, boolean optional, boolean repeated) {
Occurrence(Term term, boolean optional, boolean repeated) {
this.term = term;
isOptional = optional;
isRepeated = repeated;
}

static Term wrap( Term t, int occurence ) {
switch(occurence) {
case DTDEventListener.OCCURENCE_ONCE:
static Term wrap( Term t, int occurrence ) {
switch(occurrence) {
case DTDEventListener.OCCURRENCE_ONCE:
return t;
case DTDEventListener.OCCURENCE_ONE_OR_MORE:
return new Occurence(t,false,true);
case DTDEventListener.OCCURENCE_ZERO_OR_MORE:
return new Occurence(t,true,true);
case DTDEventListener.OCCURENCE_ZERO_OR_ONE:
return new Occurence(t,true,false);
case DTDEventListener.OCCURRENCE_ONE_OR_MORE:
return new Occurrence(t,false,true);
case DTDEventListener.OCCURRENCE_ZERO_OR_MORE:
return new Occurrence(t,true,true);
case DTDEventListener.OCCURRENCE_ZERO_OR_ONE:
return new Occurrence(t,true,false);
default:
throw new IllegalArgumentException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
* @author
* <a href="mailto:[email protected]">Kohsuke KAWAGUCHI</a>
*/
public class TDTDReader extends DTDHandlerBase
{
public class TDTDReader extends DTDHandlerBase {

/**
* Parses DTD grammar and a binding information into BGM.
*
Expand Down Expand Up @@ -361,8 +361,8 @@ public void startModelGroup() throws SAXException {
}

@Override
public void endModelGroup(short occurence) throws SAXException {
Term t = Occurence.wrap( modelGroups.pop().wrapUp(), occurence );
public void endModelGroup(short occurrence) throws SAXException {
Term t = Occurrence.wrap( modelGroups.pop().wrapUp(), occurrence );
modelGroups.peek().addTerm(t);
}

Expand All @@ -375,9 +375,9 @@ public void connector(short connectorType) throws SAXException {
// and treat it as (A,B,C,....)

@Override
public void childElement(String elementName, short occurence) throws SAXException {
public void childElement(String elementName, short occurrence) throws SAXException {
Element child = getOrCreateElement(elementName);
modelGroups.peek().addTerm( Occurence.wrap( child, occurence ) );
modelGroups.peek().addTerm( Occurrence.wrap( child, occurrence ) );
child.isReferenced = true;
}

Expand All @@ -389,7 +389,7 @@ public void childElement(String elementName, short occurence) throws SAXExceptio
* Mutable {@link Locator} instance that points to
* the current source line.
* <p>
* Use {@link #copyLocator()} to get a immutable clone.
* Use {@link #copyLocator()} to get an immutable clone.
*/
private Locator locator;

Expand Down
4 changes: 2 additions & 2 deletions jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/XSComponent.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. 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 @@ -66,7 +66,7 @@ public interface XSComponent
* Gets the foreign attribute of the given name, or null if not found.
*
* <p>
* If multiple occurences of the same attribute is found,
* If multiple occurrences of the same attribute is found,
* this method returns the first one.
*
* @see #getForeignAttributes()
Expand Down

0 comments on commit 8aed67b

Please sign in to comment.