Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9e8e14b78f00
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b23d4aded49a
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Oct 10, 2016

  1. Copy the full SHA
    0badff8 View commit details

Commits on Nov 8, 2016

  1. Merge pull request #4215 from kares/test-null-eval-type

    do not eagerly set eval-type in a thread-local
    enebo authored Nov 8, 2016
    Copy the full SHA
    b23d4ad View commit details
Showing with 7 additions and 4 deletions.
  1. +7 −4 core/src/main/java/org/jruby/runtime/IRBlockBody.java
11 changes: 7 additions & 4 deletions core/src/main/java/org/jruby/runtime/IRBlockBody.java
Original file line number Diff line number Diff line change
@@ -11,19 +11,22 @@ public abstract class IRBlockBody extends ContextAwareBlockBody {
protected final String fileName;
protected final int lineNumber;
protected final IRClosure closure;
protected ThreadLocal<EvalType> evalType;
protected ThreadLocal<EvalType> evalType; // null is treated as NONE (@see getEvalType())

public IRBlockBody(IRScope closure, Signature signature) {
super(closure.getStaticScope(), signature);
this.closure = (IRClosure) closure;
this.fileName = closure.getFileName();
this.lineNumber = closure.getLineNumber();
// null (not set) by default to avoid having many thread-local values initialized
// servers such as Tomcat tend to do thread-local checks when un-deploying apps,
// for JRuby leads to 100s of SEVERE warnings for a mid-size (booted) Rails app
this.evalType = new ThreadLocal();
this.evalType.set(EvalType.NONE);
}

public EvalType getEvalType() {
return this.evalType.get();
public final EvalType getEvalType() {
final EvalType type = this.evalType.get();
return type == null ? EvalType.NONE : type;
}

public void setEvalType(EvalType evalType) {