Skip to content

Commit

Permalink
Guess who's back - Java 8 is back again - tell a friend (#307)
Browse files Browse the repository at this point in the history
* java 8 and new bom

* changelog and version

* fix

* fix

* comments

---------

Co-authored-by: Ohad Bitton <[email protected]>
  • Loading branch information
ohadbitt and ohbitton authored Jun 15, 2023
1 parent 66c6584 commit e908bff
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11']
java: ['8']
name: Java ${{ matrix.java }}
steps:
# Uncomment to run locally with "act"
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ on:
jobs:
release:
runs-on: ubuntu-latest
name: Java 11
strategy:
matrix:
java: [ '8' ]
name: Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
- name: Setup java 11
- name: Setup java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Run the Maven verify phase
run: mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn --batch-mode --update-snapshots -Dmaven.test.skip=true verify
Expand Down
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Fixed
* Move back to Java 8
* Update BOM version and msal
* Replace non-ascii characters in headers to be in line with the service.
### Security
* No redirects by default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
public class ClientDetails {

public static final String NONE = "[none]";
private static ConcurrentInitializer<String> defaultApplication = new LazyInitializer<>() {
private static ConcurrentInitializer<String> defaultApplication = new LazyInitializer() {
@Override
protected String initialize() {
return UriUtils.stripFileNameFromCommandLine(System.getProperty("sun.java.command"));
}
};
private static ConcurrentInitializer<String> defaultUser = new LazyInitializer<>() {
private static ConcurrentInitializer<String> defaultUser = new LazyInitializer() {
@Override
protected String initialize() {
String user = System.getProperty("user.name");
Expand All @@ -36,7 +36,7 @@ protected String initialize() {
return StringUtils.isNotBlank(user) ? user : NONE;
}
};
private static ConcurrentInitializer<String> defaultVersion = new LazyInitializer<>() {
private static ConcurrentInitializer<String> defaultVersion = new LazyInitializer() {
@Override
protected String initialize() {
return formatHeader(Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import java.io.File;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;

public class UriUtils {
private UriUtils() {
Expand Down Expand Up @@ -81,7 +81,7 @@ public static String stripFileNameFromCommandLine(String cmdLine) {
String processNameForTracing = cmdLine;

if (processNameForTracing != null) {
processNameForTracing = Path.of(processNameForTracing.trim().split(" ")[0]).getFileName().toString();
processNameForTracing = Paths.get(processNameForTracing.trim().split(" ")[0]).getFileName().toString();
}

return processNameForTracing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -144,7 +144,7 @@ void removeExtensionFromFileName() {
@Test
@DisplayName("Assert file name extracted from some cmd line")
void extractFileNameFromCommandLine() {
String cmdLine = Path.of(" home", "user", "someFile.jar").toString() + " -arg1 val";
String cmdLine = Paths.get(" home", "user", "someFile.jar").toString() + " -arg1 val";
Assertions.assertEquals(UriUtils.stripFileNameFromCommandLine(cmdLine), "someFile.jar");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ThreadLocalRandom;

Expand Down Expand Up @@ -576,7 +573,7 @@ void testSameHttpClientInstance() throws DataClientException, DataServiceExcepti

@Test
void testNoRedirectsCloudFail() {
KustoTrustedEndpoints.addTrustedHosts(List.of(new MatchRule("statusreturner.azurewebsites.net", false)), false);
KustoTrustedEndpoints.addTrustedHosts(Collections.singletonList(new MatchRule("statusreturner.azurewebsites.net", false)), false);
List<Integer> redirectCodes = Arrays.asList(301, 302, 307, 308);
redirectCodes.parallelStream().map(code -> {
try (Client client = ClientFactory.createClient(
Expand All @@ -601,7 +598,7 @@ void testNoRedirectsCloudFail() {

@Test
void testNoRedirectsClientFail() {
KustoTrustedEndpoints.addTrustedHosts(List.of(new MatchRule("statusreturner.azurewebsites.net", false)), false);
KustoTrustedEndpoints.addTrustedHosts(Arrays.asList(new MatchRule("statusreturner.azurewebsites.net", false)), false);
List<Integer> redirectCodes = Arrays.asList(301, 302, 307, 308);
redirectCodes.parallelStream().map(code -> {
try (Client client = ClientFactory.createClient(
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
</developers>

<properties>
<revision>4.0.4</revision> <!-- CHANGE THIS to adjust project version-->
<revision>5.0.0</revision> <!-- CHANGE THIS to adjust project version-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<java.version>1.8</java.version>
<!-- Use 1.0.6 for fasterxml v 2.12.x (good for databricks runtime 2.10.x) -->
<azure-bom-version>1.2.4</azure-bom-version>
<azure-bom-version>1.2.13</azure-bom-version>

<!-- Versions below are for several dependencies we're using in the data & ingest modules -->
<!-- Ideally, versions below should align with latest databricks runtime dependency versions -->
<!-- Compile dependencies -->
<slf4j.version>1.8.0-beta4</slf4j.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-text.version>1.10.0</commons-text.version>
<msal4j.version>1.13.7</msal4j.version>
<msal4j.version>1.9.0</msal4j.version>
<httpclient.version>4.5.14</httpclient.version>
<httpcore.version>4.4.16</httpcore.version>
<fasterxml.jackson.core.version>2.14.2</fasterxml.jackson.core.version>
Expand Down
4 changes: 2 additions & 2 deletions quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
</developers>

<properties>
<revision>4.0.4</revision> <!-- CHANGE THIS to match project version in the root (not technically parent) pom -->
<java.version>11</java.version>
<revision>5.0.0</revision> <!-- CHANGE THIS to match project version in the root (not technically parent) pom -->
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
Expand Down

0 comments on commit e908bff

Please sign in to comment.