Skip to content

Commit abb27b3

Browse files
committed
Fix leading whitespace
1 parent bcc858d commit abb27b3

File tree

6 files changed

+125
-125
lines changed

6 files changed

+125
-125
lines changed

src/main/java/org/scijava/desktop/links/AbstractLinkHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import java.net.URI;
3434

3535
public abstract class AbstractLinkHandler extends AbstractHandlerPlugin<URI>
36-
implements LinkHandler
36+
implements LinkHandler
3737
{
38-
// NB: No implementation needed.
38+
// NB: No implementation needed.
3939
}

src/main/java/org/scijava/desktop/links/LinkHandler.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,30 @@
4141
*/
4242
public interface LinkHandler extends HandlerPlugin<URI> {
4343

44-
/**
45-
* Handles the given URI.
46-
*
47-
* @param uri The URI to handle.
48-
*/
49-
void handle(URI uri);
44+
/**
45+
* Handles the given URI.
46+
*
47+
* @param uri The URI to handle.
48+
*/
49+
void handle(URI uri);
5050

51-
/**
52-
* Gets the URI schemes that this handler supports.
53-
* <p>
54-
* This method is used for registering URI schemes with the operating
55-
* system. Handlers should return a list of scheme names (e.g., "myapp")
56-
* that they can handle. Return an empty list if the handler does not
57-
* require OS-level scheme registration.
58-
* </p>
59-
*
60-
* @return List of URI schemes supported by this handler
61-
*/
62-
default List<String> getSchemes() {
63-
return Collections.emptyList();
64-
}
51+
/**
52+
* Gets the URI schemes that this handler supports.
53+
* <p>
54+
* This method is used for registering URI schemes with the operating
55+
* system. Handlers should return a list of scheme names (e.g., "myapp")
56+
* that they can handle. Return an empty list if the handler does not
57+
* require OS-level scheme registration.
58+
* </p>
59+
*
60+
* @return List of URI schemes supported by this handler
61+
*/
62+
default List<String> getSchemes() {
63+
return Collections.emptyList();
64+
}
6565

66-
@Override
67-
default Class<URI> getType() {
68-
return URI.class;
69-
}
66+
@Override
67+
default Class<URI> getType() {
68+
return URI.class;
69+
}
7070
}

src/main/java/org/scijava/desktop/links/LinkService.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,35 @@
4242
* @see LinkHandler
4343
*/
4444
public interface LinkService extends HandlerService<URI, LinkHandler>,
45-
SciJavaService
45+
SciJavaService
4646
{
4747

48-
default void handle(final URI uri) {
49-
// Find the highest-priority link handler plugin which matches, if any.
50-
final Optional<LinkHandler> match = getInstances().stream() //
51-
.filter(handler -> handler.supports(uri)) //
52-
.findFirst();
53-
if (!match.isPresent()) {
54-
// No appropriate link handler plugin was found.
55-
final Logger log = log();
56-
if (log != null) log.debug("No handler for URI: " + uri);
57-
return; // no handler for this URI
58-
}
59-
// Handle the URI using the matching link handler.
60-
match.get().handle(uri);
61-
}
48+
default void handle(final URI uri) {
49+
// Find the highest-priority link handler plugin which matches, if any.
50+
final Optional<LinkHandler> match = getInstances().stream() //
51+
.filter(handler -> handler.supports(uri)) //
52+
.findFirst();
53+
if (!match.isPresent()) {
54+
// No appropriate link handler plugin was found.
55+
final Logger log = log();
56+
if (log != null) log.debug("No handler for URI: " + uri);
57+
return; // no handler for this URI
58+
}
59+
// Handle the URI using the matching link handler.
60+
match.get().handle(uri);
61+
}
6262

63-
// -- PTService methods --
63+
// -- PTService methods --
6464

65-
@Override
66-
default Class<LinkHandler> getPluginType() {
67-
return LinkHandler.class;
68-
}
65+
@Override
66+
default Class<LinkHandler> getPluginType() {
67+
return LinkHandler.class;
68+
}
6969

70-
// -- Typed methods --
70+
// -- Typed methods --
7171

72-
@Override
73-
default Class<URI> getType() {
74-
return URI.class;
75-
}
72+
@Override
73+
default Class<URI> getType() {
74+
return URI.class;
75+
}
7676
}

src/main/java/org/scijava/desktop/links/Links.java

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -38,46 +38,46 @@
3838
* @author Curtis Rueden
3939
*/
4040
public final class Links {
41-
private Links() {
42-
// NB: Prevent instantiation of utility class.
43-
}
41+
private Links() {
42+
// NB: Prevent instantiation of utility class.
43+
}
4444

45-
public static String path(final URI uri) {
46-
final String path = uri.getPath();
47-
if (path == null) return null;
48-
return path.startsWith("/") ? path.substring(1) : path;
49-
}
45+
public static String path(final URI uri) {
46+
final String path = uri.getPath();
47+
if (path == null) return null;
48+
return path.startsWith("/") ? path.substring(1) : path;
49+
}
5050

51-
public static String operation(final URI uri) {
52-
final String path = path(uri);
53-
if (path == null) return null;
54-
final int slash = path.indexOf("/");
55-
return slash < 0 ? path : path.substring(0, slash);
56-
}
51+
public static String operation(final URI uri) {
52+
final String path = path(uri);
53+
if (path == null) return null;
54+
final int slash = path.indexOf("/");
55+
return slash < 0 ? path : path.substring(0, slash);
56+
}
5757

58-
public static String[] pathFragments(final URI uri) {
59-
final String path = path(uri);
60-
if (path == null) return null;
61-
return path.isEmpty() ? new String[0] : path.split("/");
62-
}
58+
public static String[] pathFragments(final URI uri) {
59+
final String path = path(uri);
60+
if (path == null) return null;
61+
return path.isEmpty() ? new String[0] : path.split("/");
62+
}
6363

64-
public static String subPath(final URI uri) {
65-
final String path = path(uri);
66-
if (path == null) return null;
67-
final int slash = path.indexOf("/");
68-
return slash < 0 ? "" : path.substring(slash + 1);
69-
}
64+
public static String subPath(final URI uri) {
65+
final String path = path(uri);
66+
if (path == null) return null;
67+
final int slash = path.indexOf("/");
68+
return slash < 0 ? "" : path.substring(slash + 1);
69+
}
7070

71-
public static Map<String, String> query(final URI uri) {
72-
final LinkedHashMap<String, String> map = new LinkedHashMap<>();
73-
final String query = uri.getQuery();
74-
final String[] tokens = query == null ? new String[0] : query.split("&");
75-
for (final String token : tokens) {
76-
final String[] kv = token.split("=", 2);
77-
final String k = kv[0];
78-
final String v = kv.length > 1 ? kv[1] : null;
79-
map.put(k, v);
80-
}
81-
return map;
82-
}
71+
public static Map<String, String> query(final URI uri) {
72+
final LinkedHashMap<String, String> map = new LinkedHashMap<>();
73+
final String query = uri.getQuery();
74+
final String[] tokens = query == null ? new String[0] : query.split("&");
75+
for (final String token : tokens) {
76+
final String[] kv = token.split("=", 2);
77+
final String k = kv[0];
78+
final String v = kv.length > 1 ? kv[1] : null;
79+
map.put(k, v);
80+
}
81+
return map;
82+
}
8383
}

src/main/java/org/scijava/desktop/links/console/LinkArgument.java

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -48,43 +48,43 @@
4848
@Plugin(type = ConsoleArgument.class, priority = Priority.VERY_HIGH)
4949
public class LinkArgument extends AbstractConsoleArgument {
5050

51-
@Parameter(required = false)
52-
private LinkService linkService;
51+
@Parameter(required = false)
52+
private LinkService linkService;
5353

54-
// -- ConsoleArgument methods --
54+
// -- ConsoleArgument methods --
5555

56-
@Override
57-
public void handle(final LinkedList<String> args) {
58-
if (linkService == null) return; // no service to handle links
59-
if (args.isEmpty()) return; // no argument to check
60-
final URI uri = link(args.getFirst());
61-
if (uri == null) return; // not a URI
62-
linkService.handle(uri);
63-
}
56+
@Override
57+
public void handle(final LinkedList<String> args) {
58+
if (linkService == null) return; // no service to handle links
59+
if (args.isEmpty()) return; // no argument to check
60+
final URI uri = link(args.getFirst());
61+
if (uri == null) return; // not a URI
62+
linkService.handle(uri);
63+
}
6464

65-
// -- Typed methods --
65+
// -- Typed methods --
6666

67-
@Override
68-
public boolean supports(final LinkedList<String> args) {
69-
return !args.isEmpty() && link(args.getFirst()) != null;
70-
}
67+
@Override
68+
public boolean supports(final LinkedList<String> args) {
69+
return !args.isEmpty() && link(args.getFirst()) != null;
70+
}
7171

72-
/**
73-
* Parses a string into a URI, or null if the string
74-
* does not constitute such a link.
75-
*
76-
* @param s The string to parse.
77-
* @return The URI, or null.
78-
*/
79-
private URI link(final String s) {
80-
try {
81-
URI uri = new URI(s);
82-
return uri.getScheme() == null ? null : uri;
83-
}
84-
catch (final URISyntaxException e) {
85-
final Logger log = log();
86-
if (log != null) log.debug(e);
87-
return null;
88-
}
89-
}
72+
/**
73+
* Parses a string into a URI, or null if the string
74+
* does not constitute such a link.
75+
*
76+
* @param s The string to parse.
77+
* @return The URI, or null.
78+
*/
79+
private URI link(final String s) {
80+
try {
81+
URI uri = new URI(s);
82+
return uri.getScheme() == null ? null : uri;
83+
}
84+
catch (final URISyntaxException e) {
85+
final Logger log = log();
86+
if (log != null) log.debug(e);
87+
return null;
88+
}
89+
}
9090
}

src/main/java/org/scijava/desktop/options/OptionsDesktop.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ private String name(Platform platform) {
144144
}
145145

146146
private void validateSetting(
147-
Function<DesktopIntegrationProvider, Boolean> mutable,
148-
Function<DesktopIntegrationProvider, Boolean> getter,
149-
boolean value, String settingDescription)
147+
Function<DesktopIntegrationProvider, Boolean> mutable,
148+
Function<DesktopIntegrationProvider, Boolean> getter,
149+
boolean value, String settingDescription)
150150
{
151151
boolean toggleable = false;
152152
boolean enabled = false;

0 commit comments

Comments
 (0)