Skip to content

Commit 19200d1

Browse files
committed
[chore] Add missing override declarations
(cherry picked from commit c5e6b58) # Conflicts: # src/main/java/org/jruby/rack/DefaultErrorApplication.java # src/main/java/org/jruby/rack/embed/Config.java # src/main/java/org/jruby/rack/servlet/RequestCapture.java
1 parent 7562393 commit 19200d1

15 files changed

+89
-58
lines changed

src/main/java/org/jruby/rack/AbstractFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
package org.jruby.rack;
99

1010
import java.io.IOException;
11-
1211
import javax.servlet.Filter;
1312
import javax.servlet.FilterChain;
1413
import javax.servlet.ServletException;
@@ -48,6 +47,7 @@ public abstract class AbstractFilter implements Filter {
4847
* @throws IOException if there's an IO exception
4948
* @throws ServletException if there's a servlet exception
5049
*/
50+
@Override
5151
public final void doFilter(
5252
ServletRequest request, ServletResponse response,
5353
FilterChain chain) throws IOException, ServletException {

src/main/java/org/jruby/rack/AbstractRackDispatcher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public AbstractRackDispatcher(RackContext context) {
2424
this.context = context;
2525
}
2626

27+
@Override
2728
public void process(RackEnvironment request, RackResponseEnvironment response)
2829
throws IOException {
2930

src/main/java/org/jruby/rack/DefaultErrorApplication.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ public Ruby getRuntime() {
6060
throw new UnsupportedOperationException("getRuntime() not supported");
6161
}
6262

63-
public void init() {
64-
// NOOP
65-
}
66-
67-
public void destroy() {
68-
// NOOP
69-
}
70-
7163
@Override
7264
public RackResponse call(RackEnvironment env) throws RackException {
7365
return new Response(env); // backwards compatibility
@@ -92,6 +84,7 @@ private class Response implements RackResponse {
9284

9385
public Response(RackEnvironment env) { this.env = env; }
9486

87+
@Override
9588
public int getStatus() {
9689
return status;
9790
}
@@ -101,6 +94,7 @@ public void setStatus(int status) {
10194
this.status = status;
10295
}
10396

97+
@Override
10498
@SuppressWarnings("rawtypes")
10599
public Map getHeaders() {
106100
return headers;
@@ -111,6 +105,7 @@ public void setHeaders(@SuppressWarnings("rawtypes") Map headers) {
111105
this.headers = headers == null ? Collections.EMPTY_MAP : headers;
112106
}
113107

108+
@Override
114109
public String getBody() {
115110
if ( body == null ) {
116111
try {
@@ -144,6 +139,7 @@ protected String buildErrorBody() {
144139
return stringWriter.toString();
145140
}
146141

142+
@Override
147143
public void respond(RackResponseEnvironment response) {
148144
try {
149145
defaultRespond(this, response);

src/main/java/org/jruby/rack/DefaultRackApplicationFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public void init(final RackContext rackContext) {
101101
@Override
102102
public RackApplication newApplication() {
103103
return createApplication(new ApplicationObjectFactory() {
104+
@Override
104105
public IRubyObject create(Ruby runtime) {
105106
return createApplicationObject(runtime);
106107
}
@@ -212,6 +213,7 @@ public RackApplication newErrorApplication() {
212213
try {
213214
RackApplication app = createErrorApplication(
214215
new ApplicationObjectFactory() {
216+
@Override
215217
public IRubyObject create(Ruby runtime) {
216218
return createErrorApplicationObject(runtime);
217219
}

src/main/java/org/jruby/rack/ErrorApplicationHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ public void setError(Exception error) {
5959
this.error = error;
6060
}
6161

62+
@Override
6263
public RackResponse call(final RackEnvironment env) {
6364
env.setAttribute(RackEnvironment.EXCEPTION, getError());
6465
return getErrorApplication().call(env);
6566
}
6667

68+
@Override
6769
public void init() { getErrorApplication().init(); }
6870

71+
@Override
6972
public void destroy() { getErrorApplication().destroy(); }
7073

74+
@Override
7175
public Ruby getRuntime() {
7276
return getErrorApplication().getRuntime();
7377
}

src/main/java/org/jruby/rack/embed/Config.java

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,6 @@ public String getProperty(String key, String defaultValue) {
6161
};
6262
}
6363

64-
/*
65-
Config(final RackConfig config) {
66-
delegate = new DefaultRackConfig() {
67-
68-
@Override
69-
public String getProperty(String key, String defaultValue) {
70-
String value = config.getProperty(key, null);
71-
if ( value != null ) return value;
72-
73-
value = Config.this.resolveProperty(key);
74-
return value != null ? value : super.getProperty(key, defaultValue);
75-
}
76-
77-
@Override
78-
public RackLogger defaultLogger() { return null; }
79-
80-
};
81-
} */
82-
8364
@SuppressWarnings("unchecked")
8465
public void doInitialize(final Ruby runtime) {
8566
setOut( runtime.getOut() );
@@ -95,34 +76,42 @@ protected String resolveProperty(String key) {
9576
return value;
9677
}
9778

79+
@Override
9880
public final String getProperty(String key) {
9981
return delegate.getProperty(key);
10082
}
10183

84+
@Override
10285
public final String getProperty(String key, String defaultValue) {
10386
return delegate.getProperty(key, defaultValue);
10487
}
10588

89+
@Override
10690
public final Boolean getBooleanProperty(String key) {
10791
return delegate.getBooleanProperty(key);
10892
}
10993

94+
@Override
11095
public final Boolean getBooleanProperty(String key, Boolean defaultValue) {
11196
return delegate.getBooleanProperty(key, defaultValue);
11297
}
11398

99+
@Override
114100
public final Number getNumberProperty(String key) {
115101
return delegate.getNumberProperty(key);
116102
}
117103

104+
@Override
118105
public final Number getNumberProperty(String key, Number defaultValue) {
119106
return delegate.getNumberProperty(key, defaultValue);
120107
}
121108

109+
@Override
122110
public CompatVersion getCompatVersion() {
123111
return compatVersion;
124112
}
125113

114+
@Override
126115
public RackLogger getLogger() {
127116
if (logger == null) {
128117
logger = delegate.getLogger();
@@ -134,6 +123,7 @@ public void setLogger(RackLogger logger) {
134123
this.logger = logger;
135124
}
136125

126+
@Override
137127
public PrintStream getOut() {
138128
return delegate.getOut();
139129
}
@@ -142,6 +132,7 @@ public void setOut(OutputStream out) {
142132
delegate.setOut(out);
143133
}
144134

135+
@Override
145136
public PrintStream getErr() {
146137
return delegate.getErr();
147138
}
@@ -150,76 +141,93 @@ public void setErr(OutputStream err) {
150141
delegate.setErr(err);
151142
}
152143

144+
@Override
153145
public boolean isRewindable() {
154146
return delegate.isRewindable();
155147
}
156148

149+
@Override
157150
public Integer getInitialMemoryBufferSize() {
158151
return delegate.getInitialMemoryBufferSize();
159152
}
160153

154+
@Override
161155
public Integer getMaximumMemoryBufferSize() {
162156
return delegate.getMaximumMemoryBufferSize();
163157
}
164158

159+
@Override
165160
public String getRackup() {
166161
return delegate.getRackup();
167162
}
168163

164+
@Override
169165
public String getRackupPath() {
170166
return delegate.getRackupPath();
171167
}
172168

173169
// runtime pooling in embedded ENVs not implemented :
174170

171+
@Override
175172
public Integer getRuntimeTimeoutSeconds() {
176173
throw new UnsupportedOperationException("getRuntimeTimeoutSeconds()");
177174
}
178175

176+
@Override
179177
public Integer getInitialRuntimes() {
180178
throw new UnsupportedOperationException("getInitialRuntimes()");
181179
}
182180

181+
@Override
183182
public Integer getMaximumRuntimes() {
184183
throw new UnsupportedOperationException("getMaximumRuntimes()");
185184
}
186185

186+
@Override
187187
public String[] getRuntimeArguments() {
188188
throw new UnsupportedOperationException("getRuntimeArguments()");
189189
}
190190

191+
@Override
191192
public Integer getNumInitializerThreads() {
192193
throw new UnsupportedOperationException("getNumInitializerThreads()");
193194
}
194195

196+
@Override
195197
public boolean isSerialInitialization() {
196198
throw new UnsupportedOperationException("isSerialInitialization()");
197199
}
198200

201+
@Override
199202
public boolean isIgnoreEnvironment() {
200203
throw new UnsupportedOperationException("isIgnoreEnvironment()");
201204
}
202205

206+
@Override
203207
public Map<String, String> getRuntimeEnvironment() {
204208
throw new UnsupportedOperationException("getRuntimeEnvironment()");
205209
}
206210

207211
// RackFilter aint's used with embed :
208212

213+
@Override
209214
public boolean isFilterAddsHtml() {
210215
throw new UnsupportedOperationException("isFilterAddsHtml()");
211216
}
212217

218+
@Override
213219
public boolean isFilterVerifiesResource() {
214220
throw new UnsupportedOperationException("isFilterVerifiesResource()");
215221
}
216222

217223
// JMS configuration not used with embed :
218224

225+
@Override
219226
public String getJmsConnectionFactory() {
220227
throw new UnsupportedOperationException("getJmsConnectionFactory()");
221228
}
222229

230+
@Override
223231
public String getJmsJndiProperties() {
224232
throw new UnsupportedOperationException("getJmsJndiProperties()");
225233
}

src/main/java/org/jruby/rack/ext/Input.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@
2323
import org.jruby.RubyString;
2424
import org.jruby.anno.JRubyMethod;
2525
import org.jruby.javasupport.JavaEmbedUtils;
26+
import org.jruby.rack.RackEnvironment;
27+
import org.jruby.rack.servlet.RewindableInputStream;
28+
import org.jruby.rack.util.ExceptionUtils;
2629
import org.jruby.runtime.Block;
2730
import org.jruby.runtime.Helpers;
2831
import org.jruby.runtime.ObjectAllocator;
2932
import org.jruby.runtime.ThreadContext;
3033
import org.jruby.runtime.builtin.IRubyObject;
3134
import org.jruby.util.ByteList;
32-
33-
import org.jruby.rack.RackEnvironment;
34-
import org.jruby.rack.servlet.RewindableInputStream;
35-
import org.jruby.rack.util.ExceptionUtils;
3635
import org.jruby.util.StringSupport;
3736

3837
/**
@@ -63,6 +62,7 @@ public class Input extends RubyObject {
6362
}
6463

6564
static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
65+
@Override
6666
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
6767
return new Input(runtime, klass);
6868
}

src/main/java/org/jruby/rack/ext/Logger.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
public class Logger extends RubyObject { // implements RackLogger
5757

5858
static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
59+
@Override
5960
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
6061
return new Logger(runtime, klass);
6162
}
@@ -542,6 +543,7 @@ public IRubyObject stub(final ThreadContext context) {
542543
public static class ServletLog extends RubyObject {
543544

544545
static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
546+
@Override
545547
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
546548
return new ServletLog(runtime, klass);
547549
}

src/main/java/org/jruby/rack/ext/Response.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public static IRubyObject set_channel_buffer_size(final IRubyObject self, final
210210
}
211211

212212
static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
213+
@Override
213214
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
214215
return new Response(runtime, klass);
215216
}
@@ -274,6 +275,7 @@ public IRubyObject headers(final ThreadContext context) {
274275
* @return the response status
275276
* @see RackResponse#getStatus()
276277
*/
278+
@Override
277279
public int getStatus() {
278280
return this.status;
279281
}
@@ -282,6 +284,7 @@ public int getStatus() {
282284
* @return the headers hash
283285
* @see RackResponse#getHeaders()
284286
*/
287+
@Override
285288
@SuppressWarnings("unchecked")
286289
public Map<String, ?> getHeaders() {
287290
return this.headers;
@@ -291,6 +294,7 @@ public int getStatus() {
291294
* @return the response body (build up as a string)
292295
* @see RackResponse#getBody()
293296
*/
297+
@Override
294298
public String getBody() {
295299
if ( this.body instanceof RubyString ) return this.body.asJavaString();
296300
// body = ""; @body.each { |part| body << part }; body
@@ -324,6 +328,7 @@ public IRubyObject yield(ThreadContext context, IRubyObject part) {
324328
* Respond this response with the given (servlet) response environment.
325329
* @see RackResponse#respond(RackResponseEnvironment)
326330
*/
331+
@Override
327332
public void respond(final RackResponseEnvironment response) throws RackException {
328333
if ( ! response.isCommitted() ) {
329334
try { // NOTE: we're assuming possible overrides are out of our NS

src/main/java/org/jruby/rack/ext/Servlet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
public class Servlet extends RubyObject {
4343

4444
static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
45+
@Override
4546
public IRubyObject allocate(Ruby runtime, RubyClass klass) {
4647
return new Servlet(runtime, klass);
4748
}

0 commit comments

Comments
 (0)