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

Draft: proof-of-concept for Java 17 API improvements #19

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
java: [ 8, 11 ]
java: [ 17 ]
name: Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11 ]
java: [ 17 ]

steps:
- name: Setup java
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The BSD License

Copyright (c) 2010-2022 RIPE NCC
Copyright (c) 2010-2023 RIPE NCC
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
108 changes: 83 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
<!--

The BSD License

Copyright (c) 2010-2023 RIPE NCC
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the RIPE NCC nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.ripe.ipresource</groupId>
<artifactId>ipresource</artifactId>
<packaging>jar</packaging>
<version>1.53-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>

<parent>
<groupId>org.sonatype.oss</groupId>
Expand Down Expand Up @@ -49,9 +80,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -71,6 +103,21 @@
<version>0.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
</dependency>
</dependencies>

<dependencyManagement>
Expand All @@ -80,20 +127,22 @@
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<version>2.2</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -201,10 +250,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
<source>17</source>
<target>17</target>
<compilerArgument>--enable-preview</compilerArgument>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>

Expand All @@ -214,25 +265,32 @@
<version>2.9</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<argLine>--enable-preview</argLine>
</configuration>
</plugin>

<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
<version>1.9.0</version>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.1</version>
<configuration>
<strictCheck>true</strictCheck>
<header>LICENSE.txt</header>
<excludes>
<exclude>.idea/**</exclude>
<exclude>.m2/**</exclude>
<exclude>**/*.txt</exclude>
<exclude>.gitignore</exclude>
<exclude>.idea/**/*.*</exclude>
<exclude>.gitlab-ci.yml</exclude>
<exclude>ci_settings.xml</exclude>
</excludes>
<properties>
<owner>Mycila</owner>
<email>[email protected]</email>
</properties>
<licenseSets>
<licenseSet>
<header>LICENSE.txt</header>
<excludes>
<exclude>.idea/**</exclude>
<exclude>.m2/**</exclude>
<exclude>**/*.txt</exclude>
<exclude>.gitignore</exclude>
<exclude>.idea/**/*.*</exclude>
<exclude>.gitlab-ci.yml</exclude>
<exclude>ci_settings.xml</exclude> </excludes>
</licenseSet>
</licenseSets>
</configuration>
<executions>
<execution>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/Asn.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/ImmutableResourceSet.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/IpAddress.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/IpRange.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/IpResource.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/IpResourceRange.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/net/ripe/ipresource/IpResourceSet.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -286,4 +286,8 @@ private void readObject(java.io.ObjectInputStream in) throws IOException, ClassN
}
}
}

public int size() {
return resourcesByEndPoint.size();
}
}
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/IpResourceType.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/Ipv4Address.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/Ipv6Address.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/PackedIpRange.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/UniqueIpResource.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/etree/ChildNodeMap.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/etree/ChildNodeTreeMap.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/etree/InternalNode.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/etree/IntervalMap.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/ipresource/etree/IntervalStrategy.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
/*
* The BSD License
*
* Copyright (c) 2010-2022 RIPE NCC
* Copyright (c) 2010-2023 RIPE NCC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Loading