Skip to content

Commit

Permalink
Merge pull request #32489 from vespa-engine/bratseth/less-warnings
Browse files Browse the repository at this point in the history
Less warnings
  • Loading branch information
gjoranv authored Sep 30, 2024
2 parents 1d739a2 + dc6e315 commit a2ab633
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,15 @@ public String getConfigClass(String className) {
}

private String getHeader() {
return "/**\n" + //
" * This file is generated from a config definition file.\n" + //
" * ------------ D O N O T E D I T ! ------------\n" + //
" */\n" + //
"\n" + //
"package " + javaPackage + ";\n" + //
"\n" + //
"import java.util.*;\n" + //
"import java.io.File;\n" + //
"import java.nio.file.Path;\n" + //
"import com.yahoo.config.*;";
return "// ------------ D O N O T E D I T ! ------------\n" + //
"// This file is generated from a config definition file.\n" + //
"\n" + //
"package " + javaPackage + ";\n" + //
"\n" + //
"import java.util.*;\n" + //
"import java.io.File;\n" + //
"import java.nio.file.Path;\n" + //
"import com.yahoo.config.*;";
}

// TODO: remove the extra comment line " *" if root.getCommentBlock is empty
Expand Down
6 changes: 2 additions & 4 deletions configgen/src/test/resources/allfeatures.reference
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* This file is generated from a config definition file.
* ------------ D O N O T E D I T ! ------------
*/
// ------------ D O N O T E D I T ! ------------
// This file is generated from a config definition file.

package com.yahoo.configgen;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public abstract class AbstractResource implements SharedResource {

private final References references;

@SuppressWarnings("this-escape")
protected AbstractResource() {
DestructableResource destructable = new WrappedResource(this);
if (debug == Debug.STACK) {
Expand Down
2 changes: 2 additions & 0 deletions jdisc_core/src/main/java/com/yahoo/jdisc/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public Request(CurrentContainer current, URI uri, boolean isServerRequest) {
this(current, uri, isServerRequest, -1);
}

@SuppressWarnings("this-escape")
public Request(CurrentContainer current, URI uri, boolean isServerRequest, long creationTime) {
this.parent = null;
this.container = current.newReference(uri, this);
Expand Down Expand Up @@ -121,6 +122,7 @@ public Request(CurrentContainer current, URI uri, boolean isServerRequest, long
* @param parent The parent Request of this.
* @param uri The identifier of this request.
*/
@SuppressWarnings("this-escape")
public Request(Request parent, URI uri) {
this.parent = parent;
this.container = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class ActiveContainer extends AbstractResource implements CurrentContaine
private final BindingSetSelector bindingSetSelector;
private final TimeoutManagerImpl timeoutMgr;

@SuppressWarnings("this-escape")
public ActiveContainer(ContainerBuilder builder) {
serverProviders = builder.serverProviders().activate();
serverProviders.forEach(resourceReferences::retain);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class ApplicationLoader implements BootstrapLoader, ContainerActivator, C
private Application application;
private ApplicationInUseTracker applicationInUseTracker;

@SuppressWarnings("this-escape")
public ApplicationLoader(OsgiFramework osgiFramework, Iterable<? extends Module> guiceModules) {
LogSetup.initVespaLogging("Container");
this.osgiFramework = osgiFramework;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
public abstract class RequestDispatch implements Future<Response>, ResponseHandler {

private final FutureConjunction completions = new FutureConjunction();

@SuppressWarnings("this-escape")
private final FutureResponse futureResponse = new FutureResponse(this);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class DebugReferencesWithStack implements References {
private final DestructableResource resource;
private final DebugResourceReference initialreference;

@SuppressWarnings("this-escape")
public DebugReferencesWithStack(DestructableResource resource) {
final Throwable referenceStack = new Throwable();
this.activeReferences.put(referenceStack, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
public class ExportPackagesIT {


private static final File expectedExportPackages = new File("src/test/resources" + ExportPackages.PROPERTIES_FILE);

private static final String JAR_PATH = "target/dependency/";
Expand Down
4 changes: 2 additions & 2 deletions jrt/src/com/yahoo/jrt/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ public boolean completeRequest(TieBreaker done) {
return true;
}

///////////////////////////////////////////////////////////////////////////
// -------------------------------------------------------------------------
// Methods defined in the Target superclass
///////////////////////////////////////////////////////////////////////////
// -------------------------------------------------------------------------

public boolean isValid() {
return (state != CLOSED);
Expand Down
1 change: 1 addition & 0 deletions jrt/src/com/yahoo/jrt/Supervisor.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class Supervisor {
*
* @param transport object performing low-level operations for this Supervisor
*/
@SuppressWarnings("this-escape")
public Supervisor(Transport transport) {
this.transport = transport;
new MandatoryMethods(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public abstract class Maintainer implements Runnable {
private final double successFactorBaseline;
private final boolean acquireLock;

@SuppressWarnings("this-escape")
public Maintainer(String name, Duration interval, Clock clock, JobControl jobControl,
JobMetrics jobMetrics, List<String> clusterHostnames, boolean ignoreCollision,
double successFactorBaseline, boolean acquireLock) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public abstract class AbstractByteWriter extends GenericWriter implements Writab
protected final BufferChain buffer;
protected final CharBuffer charBuffer = CharBuffer.allocate(2);

@SuppressWarnings("this-escape")
protected AbstractByteWriter(final CharsetEncoder encoder) {
this.encoder = encoder;
buffer = new BufferChain(this);
Expand Down

0 comments on commit a2ab633

Please sign in to comment.