From 95533dd7e3e01e111c081aca4d455a2ed1499c50 Mon Sep 17 00:00:00 2001 From: Frank Vennemeyer Date: Fri, 31 Dec 2021 12:23:37 +0100 Subject: [PATCH] Remove system line separator change from eclipse-base config - changeSystemLineSeparator no longer part of default configuration - Added annotations due to spotbugs version bump --- _ext/eclipse-base/CHANGES.md | 2 ++ .../extra/eclipse/base/SpotlessEclipseServiceConfig.java | 4 +--- .../spotless/extra/eclipse/base/osgi/ResourceAccessor.java | 3 ++- .../extra/eclipse/base/service/TemporaryLocation.java | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/_ext/eclipse-base/CHANGES.md b/_ext/eclipse-base/CHANGES.md index 796ed584fd..212b08b75a 100644 --- a/_ext/eclipse-base/CHANGES.md +++ b/_ext/eclipse-base/CHANGES.md @@ -3,6 +3,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.2.1`). ## [Unreleased] +### Changed +* **BREAKING** `changeSystemLineSeparator` is no longer part of default configuration (see [#1049](https://github.com/diffplug/spotless/issues/1049)). ## [3.5.2] - 2021-10-23 ### Fixed diff --git a/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/SpotlessEclipseServiceConfig.java b/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/SpotlessEclipseServiceConfig.java index f0b9a97cc4..f677db7fed 100644 --- a/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/SpotlessEclipseServiceConfig.java +++ b/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/SpotlessEclipseServiceConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 DiffPlug + * Copyright 2016-2021 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -114,7 +114,6 @@ default public void useTemporaryLocations() throws ServiceException { * system property. * Change the system default to the UNIX line separator as required * by Spotless. - * @throws ServiceException in case service has already been configured */ default public void changeSystemLineSeparator() throws ServiceException { System.setProperty("line.separator", LINE_DELIMITER); @@ -149,6 +148,5 @@ default public void applyDefault() throws ServiceException { disableDebugging(); ignoreUnsupportedPreferences(); useTemporaryLocations(); - changeSystemLineSeparator(); } } diff --git a/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/osgi/ResourceAccessor.java b/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/osgi/ResourceAccessor.java index b75a2835ac..3d62da5c84 100644 --- a/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/osgi/ResourceAccessor.java +++ b/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/osgi/ResourceAccessor.java @@ -85,12 +85,13 @@ private static BundleFile getBundlFile(Class clazz) throws BundleException { } } + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "DCN_NULLPOINTER_EXCEPTION", justification = "Null-checking costs higher than benefit.") private static URI getBundleUri(Class clazz) throws BundleException { try { URL objUrl = clazz.getProtectionDomain().getCodeSource().getLocation(); return objUrl.toURI(); } catch (NullPointerException e) { - //No bunlde should be used for RT classes lookup. See also org.eclipse.core.runtime.PerformanceStats. + //No bundle should be used for RT classes lookup. See also org.eclipse.core.runtime.PerformanceStats. throw new BundleException(String.format("No code source can be located for class '%s'. Class is probably not within a bundle, but part of the RT.", clazz.getName()), BundleException.READ_ERROR, e); } catch (SecurityException e) { throw new BundleException(String.format("Access to class '%s' is denied.", clazz.getName()), BundleException.READ_ERROR, e); diff --git a/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/service/TemporaryLocation.java b/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/service/TemporaryLocation.java index 2999014d23..f0188382c6 100644 --- a/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/service/TemporaryLocation.java +++ b/_ext/eclipse-base/src/main/java/com/diffplug/spotless/extra/eclipse/base/service/TemporaryLocation.java @@ -128,6 +128,7 @@ public URL getDataArea(String path) throws IOException { } @Override + @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE", justification = "At shutdown everything is just done on best-efforts basis") public void close() throws Exception { try { Path path = Path.of(location.toURI());