Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit d32bc65

Browse files
committed
Fix classloader usage across assets processor
1 parent 7b0247f commit d32bc65

File tree

22 files changed

+84
-115
lines changed

22 files changed

+84
-115
lines changed

modules/jooby-assets-autoprefixer/src/main/java/org/jooby/assets/AutoPrefixer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ public boolean matches(final MediaType type) {
289289
}
290290

291291
@Override
292-
public String process(final String filename, final String source, final Config conf)
293-
throws Exception {
292+
public String process(final String filename, final String source, final Config conf,
293+
final ClassLoader loader) throws Exception {
294294
return engine(V8Engine.class)
295295
.execute("auto-prefixer.js", source, options(), filename);
296296
}

modules/jooby-assets-babel/src/main/java/org/jooby/assets/Babel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ public boolean matches(final MediaType type) {
264264
}
265265

266266
@Override
267-
public String process(final String filename, final String source, final Config conf)
268-
throws Exception {
267+
public String process(final String filename, final String source, final Config conf,
268+
final ClassLoader loader) throws Exception {
269269
return engine(V8Engine.class)
270270
.execute("babel.js", source, options(), filename);
271271
}

modules/jooby-assets-clean-css/src/main/java/org/jooby/assets/CleanCss.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ public boolean matches(final MediaType type) {
257257
}
258258

259259
@Override
260-
public String process(final String filename, final String source, final Config conf)
261-
throws Exception {
260+
public String process(final String filename, final String source, final Config conf,
261+
final ClassLoader loader) throws Exception {
262262
return engine(V8Engine.class)
263263
.execute("clean-css.js", source, options(), filename);
264264
}

modules/jooby-assets-closure-compiler/src/main/java/org/jooby/assets/ClosureCompiler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ public boolean matches(final MediaType type) {
280280
}
281281

282282
@Override
283-
public String process(final String filename, final String source, final Config conf)
284-
throws Exception {
283+
public String process(final String filename, final String source, final Config conf,
284+
final ClassLoader loader) throws Exception {
285285
final CompilerOptions copts = new CompilerOptions();
286286
copts.setCodingConvention(new ClosureCodingConvention());
287287
copts.setOutputCharset(StandardCharsets.UTF_8);

modules/jooby-assets-csslint/src/main/java/org/jooby/assets/Csslint.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
import org.jooby.MediaType;
207207

208208
import com.typesafe.config.Config;
209+
209210
/**
210211
* <h1>csslint</h1>
211212
* <p>
@@ -238,8 +239,8 @@ public boolean matches(final MediaType type) {
238239
}
239240

240241
@Override
241-
public String process(final String filename, final String source, final Config conf)
242-
throws Exception {
242+
public String process(final String filename, final String source, final Config conf,
243+
final ClassLoader loader) throws Exception {
243244
return engine(V8Engine.class)
244245
.execute("csslint.js", source, options(), filename);
245246
}

modules/jooby-assets-jscs/src/main/java/org/jooby/assets/Jscs.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,14 @@
252252
*/
253253
public class Jscs extends AssetProcessor {
254254

255-
public Jscs() {
256-
}
257-
258255
@Override
259256
public boolean matches(final MediaType type) {
260257
return MediaType.js.matches(type);
261258
}
262259

263260
@Override
264-
public String process(final String filename, final String source, final Config conf)
265-
throws Exception {
261+
public String process(final String filename, final String source, final Config conf,
262+
final ClassLoader loader) throws Exception {
266263
return engine(V8Engine.class, "global")
267264
.execute("jscs.js", source, options(), filename);
268265
}

modules/jooby-assets-jshint/src/main/java/org/jooby/assets/Jshint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ public boolean matches(final MediaType type) {
284284

285285
@SuppressWarnings("unchecked")
286286
@Override
287-
public String process(final String filename, final String source, final Config conf)
288-
throws Exception {
287+
public String process(final String filename, final String source, final Config conf,
288+
final ClassLoader loader) throws Exception {
289289
Map<String, Object> options = new LinkedHashMap<>(options());
290290
Map<String, Object> predef = (Map<String, Object>) options.remove("predef");
291291
options.remove("excludes");

modules/jooby-assets-less/src/main/java/org/jooby/assets/Less.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ public boolean matches(final MediaType type) {
264264
}
265265

266266
@Override
267-
public String process(final String filename, final String source, final Config conf)
268-
throws Exception {
269-
return engine(V8Engine.class)
270-
.execute("less.js", source, options(), filename);
271-
}
267+
public String process(final String filename, final String source, final Config conf,
268+
final ClassLoader loader) throws Exception {
269+
return engine(V8Engine.class)
270+
.execute("less.js", source, options(), filename);
271+
}
272272

273-
}
273+
}

modules/jooby-assets-less4j/src/main/java/org/jooby/assets/Less.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,6 @@
203203
*/
204204
package org.jooby.assets;
205205

206-
import java.util.List;
207-
import java.util.Map;
208-
import java.util.stream.Collectors;
209-
210-
import org.jooby.MediaType;
211-
import org.slf4j.Logger;
212-
import org.slf4j.LoggerFactory;
213-
214206
import com.github.sommeri.less4j.Less4jException;
215207
import com.github.sommeri.less4j.LessCompiler;
216208
import com.github.sommeri.less4j.LessCompiler.CompilationResult;
@@ -219,6 +211,13 @@
219211
import com.github.sommeri.less4j.LessSource;
220212
import com.github.sommeri.less4j.core.ThreadUnsafeLessCompiler;
221213
import com.typesafe.config.Config;
214+
import org.jooby.MediaType;
215+
import org.slf4j.Logger;
216+
import org.slf4j.LoggerFactory;
217+
218+
import java.util.List;
219+
import java.util.Map;
220+
import java.util.stream.Collectors;
222221

223222
/**
224223
* <h1>less4j</h1>
@@ -285,8 +284,8 @@ public boolean matches(final MediaType type) {
285284
}
286285

287286
@Override
288-
public String process(final String filename, final String source, final Config conf)
289-
throws Exception {
287+
public String process(final String filename, final String source, final Config conf,
288+
final ClassLoader loader) throws Exception {
290289
String path = filename;
291290
try {
292291
LessCompiler compiler = new ThreadUnsafeLessCompiler();

modules/jooby-assets-ng-annotate/src/main/java/org/jooby/assets/NgAnnotate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ public boolean matches(final MediaType type) {
256256
}
257257

258258
@Override
259-
public String process(final String filename, final String source, final Config conf)
260-
throws Exception {
259+
public String process(final String filename, final String source, final Config conf,
260+
final ClassLoader loader) throws Exception {
261261
return engine(V8Engine.class)
262262
.execute("ng-annotate.js", source, options(), filename);
263263
}

0 commit comments

Comments
 (0)