Skip to content

Commit

Permalink
moved to Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
clausnagel committed Dec 10, 2023
1 parent 12bcd99 commit 26d902f
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 44 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ plugins {
}

group 'org.xmlobjects.xal'
version '1.0.4'
version '1.1.0-SNAPSHOT'
description 'A Java mapping for the OASIS eXtensible Address Language (xAL)'
ext.date = new Date()

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
languageVersion = JavaLanguageVersion.of(17)
}
withJavadocJar()
withSourcesJar()
Expand All @@ -33,8 +33,8 @@ repositories {
}

dependencies {
api 'org.xmlobjects:xml-objects:1.0.4'
annotationProcessor 'org.xmlobjects:xml-objects:1.0.4'
api 'org.xmlobjects:xml-objects:1.1.0-SNAPSHOT'
annotationProcessor 'org.xmlobjects:xml-objects:1.1.0-SNAPSHOT'
}

javadoc {
Expand All @@ -49,6 +49,7 @@ javadoc {
Claus Nagel <[email protected]>
""".replaceAll("[\r|\n]+", "")
addStringOption('doctitle', project.name + ' - ' + project.description)
addStringOption('Xdoclint:none', '-quiet')
}

doFirst {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class AdministrativeAreaAdapter extends AddressObjectAdapter<Administrati
@Override
public AdministrativeArea createObject(QName name, Object parent) throws ObjectBuildException {
AdministrativeArea object = new AdministrativeArea();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public class CountryAdapter extends AddressObjectAdapter<Country> {
@Override
public Country createObject(QName name, Object parent) throws ObjectBuildException {
Country object = new Country();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public class DepartmentAdapter extends AddressObjectAdapter<SubPremises> {
@Override
public SubPremises createObject(QName name, Object parent) throws ObjectBuildException {
SubPremises object = new SubPremises();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class DependentLocalityAdapter extends AddressObjectAdapter<SubLocality>
@Override
public SubLocality createObject(QName name, Object parent) throws ObjectBuildException {
SubLocality object = new SubLocality();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public class DependentThoroughfareAdapter extends AddressObjectAdapter<SubThorou
@Override
public SubThoroughfare createObject(QName name, Object parent) throws ObjectBuildException {
SubThoroughfare object = new SubThoroughfare();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class FirmAdapter extends AddressObjectAdapter<Premises> {
@Override
public Premises createObject(QName name, Object parent) throws ObjectBuildException {
Premises object = new Premises();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public class LargeMailUserAdapter extends AddressObjectAdapter<Premises> {
@Override
public Premises createObject(QName name, Object parent) throws ObjectBuildException {
Premises object = new Premises(PremisesType.LARGE_MAIL_USER);
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public class LocalityAdapter extends AddressObjectAdapter<Locality> {
@Override
public Locality createObject(QName name, Object parent) throws ObjectBuildException {
Locality object = new Locality();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class MailStopAdapter extends AddressObjectAdapter<PostalDeliveryPoint> {
@Override
public PostalDeliveryPoint createObject(QName name, Object parent) throws ObjectBuildException {
PostalDeliveryPoint object = new PostalDeliveryPoint(PostalDeliveryPointType.MAIL_STOP);
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class PostBoxAdapter extends AddressObjectAdapter<PostalDeliveryPoint> {
@Override
public PostalDeliveryPoint createObject(QName name, Object parent) throws ObjectBuildException {
PostalDeliveryPoint object = new PostalDeliveryPoint(PostalDeliveryPointType.PO_BOX);
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class PostOfficeAdapter extends AddressObjectAdapter<PostOffice> {
@Override
public PostOffice createObject(QName name, Object parent) throws ObjectBuildException {
PostOffice object = new PostOffice();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class PostTownAdapter extends AddressObjectAdapter<Locality> {
@Override
public Locality createObject(QName name, Object parent) throws ObjectBuildException {
Locality object = new Locality(LocalityType.POST_TOWN);
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class PostalCodeAdapter extends AddressObjectAdapter<PostCode> {
@Override
public PostCode createObject(QName name, Object parent) throws ObjectBuildException {
PostCode object = new PostCode();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class PostalRouteAdapter extends AddressObjectAdapter<Thoroughfare> {
@Override
public Thoroughfare createObject(QName name, Object parent) throws ObjectBuildException {
Thoroughfare object = new Thoroughfare();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class PremiseAdapter extends AddressObjectAdapter<Premises> {
@Override
public Premises createObject(QName name, Object parent) throws ObjectBuildException {
Premises object = new Premises();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class SubAdministrativeAreaAdapter extends AddressObjectAdapter<SubAdmini
@Override
public SubAdministrativeArea createObject(QName name, Object parent) throws ObjectBuildException {
SubAdministrativeArea object = new SubAdministrativeArea();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class SubPremiseAdapter extends AddressObjectAdapter<SubPremises> {
@Override
public SubPremises createObject(QName name, Object parent) throws ObjectBuildException {
SubPremises object = new SubPremises();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class ThoroughfareAdapter extends AddressObjectAdapter<Thoroughfare> {
@Override
public Thoroughfare createObject(QName name, Object parent) throws ObjectBuildException {
Thoroughfare object = new Thoroughfare();
if (parent instanceof Child)
object.setParent((Child) parent);
if (parent instanceof Child child)
object.setParent(child);

return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class PremiseNumberRangeAdapter implements ObjectBuilder<ChildList<Premis

@Override
public ChildList<PremisesNameOrNumber> createObject(QName name, Object parent) throws ObjectBuildException {
return new ChildList<>(parent instanceof Child ? (Child) parent : null);
return new ChildList<>(parent instanceof Child child ? child : null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class ThoroughfareNumberRangeAdapter implements ObjectBuilder<ChildList<T

@Override
public ChildList<ThoroughfareNameOrNumber> createObject(QName name, Object parent) throws ObjectBuildException {
ChildList<ThoroughfareNameOrNumber> object = new ChildList<>(parent instanceof Child ? (Child) parent : null);
ChildList<ThoroughfareNameOrNumber> object = new ChildList<>(parent instanceof Child child ? child : null);
separator = null;
return object;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/xmlobjects/xal/model/XALObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ protected final <T extends Child> T asChild(T child) {
}

protected final <T extends Child> List<T> asChild(List<T> child) {
if (child instanceof ChildList) {
((ChildList<T>) child).setParent(this);
if (child instanceof ChildList<T> childList) {
childList.setParent(this);
return child;
} else
return child != null ? new ChildList<>(child, this) : null;
Expand Down

0 comments on commit 26d902f

Please sign in to comment.