Skip to content

Commit

Permalink
Removed system line separator change from eclipse-base config
Browse files Browse the repository at this point in the history
- changeSystemLineSeparator no longer part of default configuration
- Added annotations due to spotbugs version bump
  • Loading branch information
fvgh committed Dec 31, 2021
1 parent b2b1dfd commit 7bad837
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions _ext/eclipse-base/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -149,6 +148,5 @@ default public void applyDefault() throws ServiceException {
disableDebugging();
ignoreUnsupportedPreferences();
useTemporaryLocations();
changeSystemLineSeparator();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 7bad837

Please sign in to comment.