Skip to content

Commit d8dd342

Browse files
committed
[chore] Drop/rename long-deprecated methods from Java API
1 parent acb1f54 commit d8dd342

17 files changed

+22
-203
lines changed

History.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
- Drop deprecated `jruby.rack.ignore.env` property, replaced long ago by `jruby.runtime.env` and optional `jruby.runtime.env.rubyopt`
1313
- Drop deprecated `JRuby::Rack::RailsFileSystemLayout` alias for `JRuby::Rack::FileSystemLayout`
1414
- Drop deprecated `JRuby::Rack::Errors` alias for `JRuby::Rack::ErrorApp`
15+
- Drop deprecated `org.jruby.rack.RackInput` alias for `org.jruby.rack.ext.Input` class
16+
- Drop/rename deprecated `RackConfig` and `ServletRackEnvironment` API methods per their earlier comments
1517
- Change context listener to throw, in case of an exception during initialization, by default
1618
- Change rails context listener to assume a thread-safe application by default
17-
- update (bundled) rack to 2.2.17
18-
- Fix Rails 7.1 CSRF protection when working with `JavaServletStore` sessions
1919

20-
## 1.2.4 (UNRELEASED)
20+
## 1.2.4
2121

2222
- update (bundled) rack to 2.2.17
2323
- Fix Rails 7.1 CSRF protection when working with `JavaServletStore` sessions

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

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public final void doFilter(
6262
// NOTE: should be moved bellow, just before getDispatcher().process(...)
6363
RackResponseEnvironment responseEnv = new ServletRackResponseEnvironment(httpResponse);
6464

65-
if (isDoDispatch(requestCapture, responseCapture, chain, env, responseEnv)) {
65+
if (isDoDispatch(requestCapture, responseCapture, chain, env)) {
6666
getDispatcher().process(env, responseEnv);
6767
}
6868

@@ -99,26 +99,6 @@ protected boolean isDoDispatch(
9999
return true;
100100
}
101101

102-
/**
103-
* @deprecated use {@link #isDoDispatch(RequestCapture, ResponseCapture, FilterChain, RackEnvironment)}
104-
* @param request the request
105-
* @param response the response
106-
* @param chain the FilterChain
107-
* @param env the RackEnvironent
108-
* @param responseEnv the RackResponseEnvironment
109-
* @return isDoDispatch
110-
* @throws IOException if there's an IO exception
111-
* @throws ServletException if there's a servlet exception
112-
*/
113-
@Deprecated
114-
protected boolean isDoDispatch(
115-
RequestCapture request, ResponseCapture response,
116-
FilterChain chain, RackEnvironment env,
117-
RackResponseEnvironment responseEnv)
118-
throws IOException, ServletException {
119-
return isDoDispatch(request, response, chain, env);
120-
}
121-
122102
/**
123103
* Extension point if you'll need to customize {@link RequestCapture}
124104
* @param request the request

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
* @see System#getProperty(String)
2929
* @see RackConfig
3030
*/
31-
@SuppressWarnings("deprecation")
3231
public class DefaultRackConfig implements RackConfig {
3332

3433
private RackLogger logger;
@@ -85,7 +84,7 @@ public String getRackupPath() {
8584
}
8685

8786
@Override
88-
public Integer getRuntimeTimeoutSeconds() {
87+
public Integer getRuntimeAcquireTimeout() {
8988
return getPositiveInteger("jruby.runtime.acquire.timeout");
9089
}
9190

@@ -96,7 +95,7 @@ public String[] getRuntimeArguments() {
9695
}
9796

9897
@Override
99-
public Integer getNumInitializerThreads() {
98+
public Integer getRuntimeInitThreads() {
10099
Number threads = getNumberProperty("jruby.runtime.init.threads");
101100
return threads != null ? threads.intValue() : null;
102101
}
@@ -105,7 +104,7 @@ public Integer getNumInitializerThreads() {
105104
public boolean isSerialInitialization() {
106105
Boolean serial = getBooleanProperty("jruby.runtime.init.serial");
107106
if (serial == null) { // if initializer threads set to <= 0
108-
Integer threads = getNumInitializerThreads();
107+
Integer threads = getRuntimeInitThreads();
109108
serial = threads != null && threads < 0 ? Boolean.TRUE : Boolean.FALSE;
110109
}
111110
return serial;
@@ -174,15 +173,6 @@ protected RackLogger defaultLogger() {
174173
return new StandardOutLogger(getOut());
175174
}
176175

177-
@Override
178-
public boolean isFilterAddsHtml() {
179-
return getBooleanProperty("jruby.rack.filter.adds.html", true);
180-
}
181-
182-
@Override
183-
public boolean isFilterVerifiesResource() {
184-
return getBooleanProperty("jruby.rack.filter.verifies.resource", false);
185-
}
186176

187177
public String getLoggerName() {
188178
return getProperty("jruby.rack.logging.name", "jruby.rack");

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

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ public void setAcquireTimeout(Number acquireTimeout) {
113113
protected void doInit() throws Exception {
114114
super.doInit();
115115
final RackConfig config = getConfig();
116-
// TODO until config.getRuntimeTimeoutSeconds returns an integer :
117-
setAcquireTimeout( config.getNumberProperty("jruby.runtime.acquire.timeout") );
118-
116+
setAcquireTimeout( config.getRuntimeAcquireTimeout() );
119117
setInitialSize( config.getInitialRuntimes() );
120118
setMaximumSize( config.getMaximumRuntimes() );
121119

@@ -264,27 +262,17 @@ public void fillInitialPool() throws RackInitializationException {
264262
permits = maximumSize != null ? new Semaphore(maximumSize, true) : null;
265263
if (initialSize != null) { // otherwise pool filled on demand
266264
Queue<RackApplication> apps = createApplications();
267-
launchInitializerThreads(apps);
265+
launchInitialization(apps);
268266
waitTillPoolReady();
269267
}
270268
}
271269

272-
/**
273-
* @param apps a queue of apps
274-
* @deprecated override {@link #launchInitialization(java.util.Queue)}
275-
*/
276-
@Deprecated
277-
protected void launchInitializerThreads(final Queue<RackApplication> apps) {
278-
launchInitialization(apps);
279-
}
280-
281270
/**
282271
* Launches application initialization.
283272
* @param apps the (initial) instances (for the pool) to be initialized
284273
*/
285274
protected void launchInitialization(final Queue<RackApplication> apps) {
286-
@SuppressWarnings("deprecation")
287-
Integer initThreads = getConfig().getNumInitializerThreads();
275+
Integer initThreads = getConfig().getRuntimeInitThreads();
288276
if ( initThreads == null ) initThreads = 4; // quad-core baby
289277

290278
for (int i = 0; i < initThreads; i++) {

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ public RackApplicationFactory getDelegate() {
5858
return delegate;
5959
}
6060

61-
@Deprecated
62-
public RackApplicationFactory getRealFactory() {
63-
return getDelegate();
64-
}
6561

6662
public RackContext getContext() {
6763
return context;

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

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,14 @@ public interface RackConfig {
8282
*
8383
* @return the amount of time before runtimes acquisition times out
8484
*/
85-
@Deprecated // TODO rename to Float getRuntimeAquireTimeout
86-
Integer getRuntimeTimeoutSeconds();
85+
Integer getRuntimeAcquireTimeout();
8786

8887
/**
8988
* Get the number of initializer threads, or null if unspecified.
9089
*
9190
* @return the number of initializer threads or null
9291
*/
93-
@Deprecated // TODO rename to Integer getRuntimeInitThreads
94-
Integer getNumInitializerThreads();
92+
Integer getRuntimeInitThreads();
9593

9694
/**
9795
* Return true if runtimes should be initialized in serial
@@ -132,29 +130,8 @@ public interface RackConfig {
132130
* @return a logger instance
133131
*/
134132
RackLogger getLogger();
135-
136-
/**
137-
* Return true if passing through the filter should append '.html'
138-
* (or 'index.html') to the path.
139-
*
140-
* @return true if the filter should append .html
141-
* @deprecated configure filter with a nested init-param
142-
* @see RackFilter
143-
*/
144-
@Deprecated
145-
boolean isFilterAddsHtml();
146133

147-
/**
148-
* Return true if filter should verify the resource exists using
149-
* ServletContext#getResource before adding .html on the request.
150-
*
151-
* @return true if the filter should verify the resource
152-
* @deprecated configure filter with a nested init-param
153-
* @see RackFilter
154-
*/
155-
@Deprecated
156-
boolean isFilterVerifiesResource();
157-
/**
134+
/**
158135
* General property retrieval for custom configuration values.
159136
*
160137
* @param key the key

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

Lines changed: 0 additions & 54 deletions
This file was deleted.

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,4 @@ public interface RackResponseEnvironment {
120120
*/
121121
PrintWriter getWriter() throws IOException ;
122122

123-
/**
124-
* @see RackResponse#respond(RackResponseEnvironment)
125-
* @param response the response
126-
* @throws IOException if there's an IO exception
127-
* @deprecated (should) no longer (be) used
128-
*/
129-
@Deprecated
130-
void defaultRespond(RackResponse response) throws IOException ;
131-
132123
}

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ public String getRackupPath() {
161161
// runtime pooling in embedded ENVs not implemented :
162162

163163
@Override
164-
public Integer getRuntimeTimeoutSeconds() {
165-
throw new UnsupportedOperationException("getRuntimeTimeoutSeconds()");
164+
public Integer getRuntimeAcquireTimeout() {
165+
throw new UnsupportedOperationException("getRuntimeAcquireTimeout()");
166166
}
167167

168168
@Override
@@ -181,8 +181,8 @@ public String[] getRuntimeArguments() {
181181
}
182182

183183
@Override
184-
public Integer getNumInitializerThreads() {
185-
throw new UnsupportedOperationException("getNumInitializerThreads()");
184+
public Integer getRuntimeInitThreads() {
185+
throw new UnsupportedOperationException("getRuntimeInitThreads()");
186186
}
187187

188188
@Override
@@ -194,17 +194,4 @@ public boolean isSerialInitialization() {
194194
public Map<String, String> getRuntimeEnvironment() {
195195
throw new UnsupportedOperationException("getRuntimeEnvironment()");
196196
}
197-
198-
// RackFilter aint's used with embed :
199-
200-
@Override
201-
public boolean isFilterAddsHtml() {
202-
throw new UnsupportedOperationException("isFilterAddsHtml()");
203-
}
204-
205-
@Override
206-
public boolean isFilterVerifiesResource() {
207-
throw new UnsupportedOperationException("isFilterVerifiesResource()");
208-
}
209-
210197
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public static void load(final Ruby runtime) {
5353
"Input", _Object, Input.ALLOCATOR
5454
);
5555
_Input.defineAnnotatedMethods(Input.class);
56-
_JRuby.setConstant("RackInput", _Input); // @deprecated backwards-compat
5756

5857
// JRuby::Rack::Logger
5958
final RubyClass _Logger = _JRuby_Rack.defineClassUnder(

0 commit comments

Comments
 (0)