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

Removed system line separator change from eclipse-base config #1058

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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