Skip to content

Commit 0a74172

Browse files
committed
Remove dead/commented out code and modifiers
1 parent d633632 commit 0a74172

21 files changed

+40
-192
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.jruby.rack.util.IOHelpers;
2626
import org.jruby.runtime.ThreadContext;
2727
import org.jruby.runtime.builtin.IRubyObject;
28+
import org.jruby.util.cli.OutputStrings;
2829

2930
import static org.jruby.rack.RackLogger.Level.*;
3031
import static org.jruby.rack.DefaultRackConfig.isIgnoreRUBYOPT;
@@ -85,7 +86,7 @@ public void init(final RackContext rackContext) {
8586
this.rackContext = (ServletRackContext) rackContext;
8687
if ( getRackupScript() == null ) resolveRackupScript();
8788
this.runtimeConfig = createRuntimeConfig();
88-
rackContext.log(INFO, runtimeConfig.getVersionString());
89+
rackContext.log(INFO, OutputStrings.getVersionString());
8990
configureDefaults();
9091
}
9192

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ private static Map<String,String> getLoggerTypes() {
416416
loggerTypes.put("clogging", "org.jruby.rack.logging.CommonsLoggingLogger");
417417
loggerTypes.put("slf4j", "org.jruby.rack.logging.Slf4jLogger");
418418
loggerTypes.put("jul", "org.jruby.rack.logging.JulLogger");
419-
//loggerTypes.put("servlet_context", "org.jruby.rack.logging.ServletContextLogger");
420419
return loggerTypes;
421420
}
422421

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void setAcquireTimeout(Number acquireTimeout) {
111111

112112
@Override
113113
protected void doInit() throws Exception {
114-
super.doInit(); // delegate.init(rackContext);
114+
super.doInit();
115115
final RackConfig config = getConfig();
116116
// TODO until config.getRuntimeTimeoutSeconds returns an integer :
117117
Number timeout = config.getNumberProperty("jruby.runtime.acquire.timeout");
@@ -253,16 +253,15 @@ public void destroy() {
253253
synchronized (applicationPool) {
254254
for (RackApplication app : applicationPool) {
255255
getDelegate().finishedWithApplication(app);
256-
// DefaultRackAppFactory: app.destroy();
257256
}
258257
applicationPool.clear();
259258
}
260-
super.destroy(); // delegate.destroy();
259+
super.destroy();
261260
}
262261

263262
/**
264263
* Fills the initial pool with initialized application instances.
265-
*
264+
* <p>
266265
* Application objects are created in foreground threads to avoid
267266
* leakage when the web application is undeployed from the server.
268267
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public interface RackApplication {
2424
* @param env the RackEnvironment
2525
* @return the RackResponse
2626
*/
27-
public RackResponse call(RackEnvironment env);
27+
RackResponse call(RackEnvironment env);
2828

2929
/**
3030
* Get a reference to the underlying runtime that holds the application

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public interface RackApplicationFactory {
6868
*
6969
* @author kares
7070
*/
71-
public static interface Decorator {
71+
interface Decorator {
7272

7373
/**
7474
* @return the delegate factory this decorator wraps

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,7 @@ public interface RackConfig {
135135
* @return the maximum size of the in-memory buffer
136136
*/
137137
Integer getMaximumMemoryBufferSize();
138-
139-
/**
140-
* @return whether we allow the initialization exception to bubble up
141-
*/
142-
//boolean isThrowInitException();
143-
138+
144139
/**
145140
* Create a logger to be used (based on this configuration).
146141
* @return a logger instance

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

Lines changed: 22 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public interface RackEnvironment {
2727
* Environment key that retrieves the exception the {@link RackApplication}
2828
* failed with. Useful when dispatching call to an {@link ErrorApplication}.
2929
*/
30-
final String EXCEPTION = "jruby.rack.exception";
31-
final String DYNAMIC_REQS_ONLY = "jruby.rack.dynamic.requests.only";
30+
String EXCEPTION = "jruby.rack.exception";
31+
String DYNAMIC_REQS_ONLY = "jruby.rack.dynamic.requests.only";
3232

3333
/**
3434
* @return the associated {@link RackContext} for this environment
3535
*/
36-
public RackContext getContext();
36+
RackContext getContext();
3737

3838
// The following methods are specific to the rack environment
3939

@@ -42,160 +42,120 @@ public interface RackEnvironment {
4242
* @return the input as a stream
4343
* @throws IOException if there's an IO exception
4444
*/
45-
public InputStream getInput() throws IOException;
45+
InputStream getInput() throws IOException;
4646

4747
/**
4848
* For servlet-based environment implementations the script name might be
4949
* constructed as the the (servlet) context path + the servlet path.
5050
* @return the script name ("CGI" style)
5151
*/
52-
public String getScriptName();
52+
String getScriptName();
5353

5454
// The following methods are usually inherited from the servlet request
5555

5656
/**
5757
* @see javax.servlet.http.HttpServletRequest#getPathInfo()
5858
* @return the request path info
5959
*/
60-
public String getPathInfo();
60+
String getPathInfo();
6161

6262
/**
6363
* Request URI should include the query string if available.
6464
* @see javax.servlet.http.HttpServletRequest#getRequestURI()
6565
* @return the request URI
6666
*/
67-
public String getRequestURI();
67+
String getRequestURI();
6868

6969
/**
7070
* @see javax.servlet.http.HttpServletRequest#getAttributeNames()
7171
* @return an enumeration of all attribute names
7272
*/
73-
public Enumeration<String> getAttributeNames();
73+
Enumeration<String> getAttributeNames();
7474

7575
/**
7676
* @see javax.servlet.http.HttpServletRequest#getAttribute(String)
7777
* @param key the attribute key
7878
* @return the attribute value
7979
*/
80-
public Object getAttribute(String key);
80+
Object getAttribute(String key);
8181

8282
/**
8383
* @see javax.servlet.http.HttpServletRequest#setAttribute(String, Object)
8484
* @param key the key
8585
* @param value the value
8686
*/
87-
public void setAttribute(String key, Object value);
87+
void setAttribute(String key, Object value);
8888

8989
/**
9090
* @see javax.servlet.http.HttpServletRequest#getHeaderNames()
9191
* @return an enumeration of all header names
9292
*/
93-
public Enumeration<String> getHeaderNames();
93+
Enumeration<String> getHeaderNames();
9494

9595
/**
9696
* @see javax.servlet.http.HttpServletRequest#getHeader(String)
9797
* @param name the header name
9898
* @return the header value
9999
*/
100-
public String getHeader(String name);
100+
String getHeader(String name);
101101

102102
/**
103103
* @see javax.servlet.http.HttpServletRequest#getScheme()
104104
* @return the request scheme
105105
*/
106-
public String getScheme();
106+
String getScheme();
107107

108108
/**
109109
* @see javax.servlet.http.HttpServletRequest#getContentType()
110110
* @return the content type
111111
*/
112-
public String getContentType();
112+
String getContentType();
113113

114114
/**
115115
* @see javax.servlet.http.HttpServletRequest#getContentLength()
116116
* @return the content length
117117
*/
118-
public int getContentLength();
118+
int getContentLength();
119119

120120
/**
121121
* @see javax.servlet.http.HttpServletRequest#getMethod()
122122
* @return the request method
123123
*/
124-
public String getMethod();
124+
String getMethod();
125125

126126
/**
127127
* @see javax.servlet.http.HttpServletRequest#getQueryString()
128128
* @return the query string
129129
*/
130-
public String getQueryString();
130+
String getQueryString();
131131

132132
/**
133133
* @see javax.servlet.http.HttpServletRequest#getServerName()
134134
* @return the server name
135135
*/
136-
public String getServerName();
136+
String getServerName();
137137

138138
/**
139139
* @see javax.servlet.http.HttpServletRequest#getServerPort()
140140
* @return the server port
141141
*/
142-
public int getServerPort();
142+
int getServerPort();
143143

144144
/**
145145
* @see javax.servlet.ServletRequest#getRemoteHost()
146146
* @return the remote host
147147
*/
148-
public String getRemoteHost();
148+
String getRemoteHost();
149149

150150
/**
151151
* @see javax.servlet.ServletRequest#getRemoteAddr()
152152
* @return the remote address
153153
*/
154-
public String getRemoteAddr();
154+
String getRemoteAddr();
155155

156156
/**
157157
* @see javax.servlet.http.HttpServletRequest#getRemoteUser()
158158
* @return the remote user
159159
*/
160-
public String getRemoteUser();
161-
162-
/**
163-
* {@link RackEnvironment} extension to obtain a rack.input IO.
164-
*
165-
* NOTE: This interface will most likely get moved onto the (parent)
166-
* environment interface directly once the deprecated way of maintaining
167-
* backwards compatibility (using jruby/rack/environment.rb) is removed.
168-
*
169-
* @deprecated Was an internal interface and is no longer used.
170-
* @author kares
171-
*/
172-
@Deprecated
173-
interface ToIO {
174-
175-
// TODO move to RackEnvironment once jruby/rack/environment.rb removed
176-
177-
/**
178-
* Convert this environment into a "rack.input" IO.
179-
* Replaces the <code>to_io</code> monkey-patch ...
180-
* @return rack.input
181-
*/
182-
public Input toIO();
183-
184-
/**
185-
* Set the rack.input, this is an optional operation and implementers
186-
* might ignore this call silently if they're capable of constructing
187-
* the rack.input themselves.
188-
* @param io the rack.input instance
189-
*/
190-
void setIO(Input io) ;
191-
192-
}
193-
194-
/**
195-
* Convert this environment into a "rack.input" IO.
196-
* Replaces the <code>to_io</code> monkey-patch ...
197-
* @return rack.input
198-
*/
199-
//public Input toIO() ;
200-
160+
String getRemoteUser();
201161
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ public static RubyClass getClass(Ruby runtime, String name, RubyClass parent,
4343
return runtime.getOrCreateModule("JRuby").getClass(name); // RackInput
4444
}
4545

46-
//private static RubyClass getClass(final Ruby runtime) {
47-
// return (RubyClass) runtime.getModule("JRuby").getConstantAt("RackInput");
48-
//}
49-
5046
public RackInput(Ruby runtime, RubyClass klass) {
5147
super(runtime, klass);
5248
}

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@
1212
* @author nicksieger
1313
*/
1414
public interface RackLogger {
15-
//void debug(String message) ;
16-
//void debug(String message, Throwable e) ;
17-
18-
//void info(String message) ;
19-
//void info(String message, Throwable e) ;
20-
21-
//void warn(String message) ;
22-
//void warn(String message, Throwable e) ;
23-
24-
//void error(String message) ;
25-
//void error(String message, Throwable e) ;
26-
2715
enum Level {
2816
DEBUG, INFO, WARN, ERROR, FATAL
2917
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public SharedRackApplicationFactory(RackApplicationFactory delegate) {
3131

3232
@Override
3333
protected void doInit() throws Exception {
34-
super.doInit(); // delegate.init(rackContext);
34+
super.doInit();
3535
log(INFO, "using a shared (thread-safe) runtime");
3636
application = getDelegate().getApplication();
3737
}
@@ -62,11 +62,10 @@ public void destroy() {
6262
synchronized(this) {
6363
if (application != null) {
6464
getDelegate().finishedWithApplication(application);
65-
// DefaultRackAppFactory: application.destroy();
6665
}
6766
}
6867
}
69-
super.destroy(); // delegate.destroy();
68+
super.destroy();
7069
}
7170

7271
@Override

0 commit comments

Comments
 (0)