summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-11 12:31:24 +0100
committerSven Gothel <[email protected]>2019-12-11 12:31:24 +0100
commitec14765d6baab247fa37d62845c139adc367af2a (patch)
tree64b9c3d0214fa4ee2fd6c9eadf5372558ba12db6 /src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java
parente1933c74b9c256332cd12c9a1094e4687b535112 (diff)
General Source Cleanup using my Eclipse settings
Change non static accesses to static members using declaring type Change indirect accesses to static members to direct accesses (accesses through subtypes) Add final modifier to private fields Add final modifier to method parameters Add final modifier to local variables Remove unused imports Add missing '@Override' annotations Add missing '@Override' annotations to implementations of interface methods Add missing '@Deprecated' annotations Remove unnecessary casts Remove unnecessary '$NON-NLS$' tags Remove trailing white spaces on all lines
Diffstat (limited to 'src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java')
-rw-r--r--src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java55
1 files changed, 32 insertions, 23 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java
index f0aad67..bc66648 100644
--- a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java
+++ b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java
@@ -1,5 +1,5 @@
/*
- *
+ *
* Copyright 2002-2004 The Ant-Contrib project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,35 +24,35 @@ import net.sf.antcontrib.cpptasks.VersionInfo;
import org.apache.tools.ant.BuildException;
/**
* A configuration for a command line linker
- *
+ *
* @author Curt Arnold
*/
public final class CommandLineLinkerConfiguration
implements
LinkerConfiguration {
private/* final */String[][] args;
- private/* final */String identifier;
+ private final /* final */String identifier;
private String[] libraryNames;
- private/* final */CommandLineLinker linker;
- private/* final */boolean map;
- private/* final */ProcessorParam[] params;
- private/* final */boolean rebuild;
- private boolean debug;
- private String startupObject;
- public CommandLineLinkerConfiguration(CommandLineLinker linker,
- String identifier, String[][] args, ProcessorParam[] params,
- boolean rebuild, boolean map, boolean debug, String[] libraryNames,
- String startupObject) {
+ private final /* final */CommandLineLinker linker;
+ private final /* final */boolean map;
+ private final /* final */ProcessorParam[] params;
+ private final /* final */boolean rebuild;
+ private final boolean debug;
+ private final String startupObject;
+ public CommandLineLinkerConfiguration(final CommandLineLinker linker,
+ final String identifier, final String[][] args, final ProcessorParam[] params,
+ final boolean rebuild, final boolean map, final boolean debug, final String[] libraryNames,
+ final String startupObject) {
if (linker == null) {
throw new NullPointerException("linker");
}
if (args == null) {
throw new NullPointerException("args");
} else {
- this.args = (String[][]) args.clone();
+ this.args = args.clone();
}
this.linker = linker;
- this.params = (ProcessorParam[]) params.clone();
+ this.params = params.clone();
this.rebuild = rebuild;
this.identifier = identifier;
this.map = map;
@@ -60,15 +60,16 @@ public final class CommandLineLinkerConfiguration
if (libraryNames == null) {
this.libraryNames = new String[0];
} else {
- this.libraryNames = (String[]) libraryNames.clone();
+ this.libraryNames = libraryNames.clone();
}
this.startupObject = startupObject;
}
- public int bid(String filename) {
+ @Override
+ public int bid(final String filename) {
return linker.bid(filename);
}
public String[] getEndArguments() {
- String[] clone = (String[]) args[1].clone();
+ final String[] clone = args[1].clone();
return clone;
}
/**
@@ -76,17 +77,19 @@ public final class CommandLineLinkerConfiguration
* canonical so that equivalent configurations will have equivalent string
* representations
*/
+ @Override
public String getIdentifier() {
return identifier;
}
public String[] getLibraryNames() {
- String[] clone = (String[]) libraryNames.clone();
+ final String[] clone = libraryNames.clone();
return clone;
}
public boolean getMap() {
return map;
}
- public String[] getOutputFileNames(String inputFile, VersionInfo versionInfo) {
+ @Override
+ public final String[] getOutputFileNames(final String inputFile, final VersionInfo versionInfo) {
return linker.getOutputFileNames(inputFile, versionInfo);
}
public LinkerParam getParam(String name) {
@@ -96,32 +99,38 @@ public final class CommandLineLinkerConfiguration
}
return null;
}
+ @Override
public ProcessorParam[] getParams() {
return params;
}
public String[] getPreArguments() {
- String[] clone = (String[]) args[0].clone();
+ final String[] clone = args[0].clone();
return clone;
}
+ @Override
public boolean getRebuild() {
return rebuild;
}
public String getStartupObject() {
return startupObject;
}
- public void link(CCTask task, TargetInfo linkTarget) throws BuildException {
+ @Override
+ public void link(final CCTask task, final TargetInfo linkTarget) throws BuildException {
//
// AllSourcePath's include any syslibsets
//
- String[] sourcePaths = linkTarget.getAllSourcePaths();
+ final String[] sourcePaths = linkTarget.getAllSourcePaths();
linker.link(task, linkTarget.getOutput(), sourcePaths, this);
}
+ @Override
public String toString() {
return identifier;
}
+ @Override
public Linker getLinker() {
return linker;
}
+ @Override
public boolean isDebug() {
return debug;
}