Skip to content

Commit 1bab81f

Browse files
author
Nicolas Laurent
committed
reformat
1 parent 8887042 commit 1bab81f

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

src/main/java/org/truffleruby/core/exception/ExceptionNodes.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ protected Object backtrace(
152152
if (hasCustomBacktraceProfile.profile(customBacktrace != null)) {
153153
return customBacktrace;
154154
} else if (hasBacktraceProfile.profile(Layouts.EXCEPTION.getBacktrace(exception) != null)) {
155-
Backtrace backtrace = Layouts.EXCEPTION.getBacktrace(exception);
156155
DynamicObject backtraceStringArray = Layouts.EXCEPTION.getBacktraceStringArray(exception);
157156
if (backtraceStringArray == null) {
158157
backtraceStringArray = getContext().getUserBacktraceFormatter().formatBacktraceAsRubyStringArray(
@@ -182,7 +181,7 @@ public abstract static class BacktraceLocationsNode extends CoreMethodArrayArgum
182181

183182
@Specialization
184183
protected Object backtraceLocations(DynamicObject exception,
185-
@Cached("createBinaryProfile()") ConditionProfile hasBacktraceProfile,
184+
@Cached("createBinaryProfile()") ConditionProfile hasBacktraceProfile,
186185
@Cached("createBinaryProfile()") ConditionProfile hasLocationsProfile) {
187186
if (hasBacktraceProfile.profile(Layouts.EXCEPTION.getBacktrace(exception) != null)) {
188187
DynamicObject backtraceLocations = Layouts.EXCEPTION.getBacktraceLocations(exception);

src/main/java/org/truffleruby/core/kernel/KernelNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ private DynamicObject innerCallerLocations(int omit, int length) {
321321

322322
// We can't set an effective limit when dealing with negative range endings.
323323
final int limit = length < 0
324-
? GetBacktraceException.UNLIMITED
325-
: omitted + length;
324+
? GetBacktraceException.UNLIMITED
325+
: omitted + length;
326326

327327
// Fill in the stack trace.
328328
backtrace.getActivations(new GetBacktraceException(this, limit));

src/main/java/org/truffleruby/core/thread/ThreadNodes.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ private DynamicObject backtraceLocationsInternal(DynamicObject rubyThread, int o
157157

158158
// We can't set an effective limit when dealing with negative range endings.
159159
final int stackTraceElementsLimit = length < 0
160-
? GetBacktraceException.UNLIMITED
161-
: omit + length;
160+
? GetBacktraceException.UNLIMITED
161+
: omit + length;
162162

163163
final SafepointAction safepointAction = (thread1, currentNode) -> {
164164
final Backtrace backtrace = getContext().getCallStack().getBacktrace(this, omit);
@@ -167,8 +167,9 @@ private DynamicObject backtraceLocationsInternal(DynamicObject rubyThread, int o
167167
backtrace.getActivations(new GetBacktraceException(this, stackTraceElementsLimit));
168168
};
169169

170-
getContext().getSafepointManager()
171-
.pauseRubyThreadAndExecute(rubyThread, this, safepointAction);
170+
getContext()
171+
.getSafepointManager()
172+
.pauseRubyThreadAndExecute(rubyThread, this, safepointAction);
172173

173174
// If the thread is dead or aborting the SafepointAction will not run.
174175
if (backtraceMemo.get() == null) {

src/main/java/org/truffleruby/language/backtrace/Backtrace.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public DynamicObject getBacktraceLocations(int length) {
185185
final int activationsLength = getActivations().length;
186186

187187
// TODO(norswap, 24 Dec 2019)
188-
// This is an ugly stopgap solution this doesn't seem solvable without refactoring #getActivations.
188+
// This is an ugly stopgap solution - this doesn't seem solvable without refactoring #getActivations.
189189
// The issue is that omitting more locations than are available should return nil, while
190190
// omitting exactly the number of available locations should return an empty array.
191191
// This isn't even entirely correct: if we should ignore some frames from the stack trace,
@@ -203,14 +203,16 @@ public DynamicObject getBacktraceLocations(int length) {
203203
// always respect TruffleException#getStackTraceElementLimit(), so we need to use Math#min.
204204
// Haven't yet investigated why.
205205
final int locationsLength = length < 0
206-
? activationsLength + 1 + length
207-
: Math.min(activationsLength, length);
206+
? activationsLength + 1 + length
207+
: Math.min(activationsLength, length);
208208

209209
final Object[] locations = new Object[locationsLength];
210210
final DynamicObjectFactory factory = context.getCoreLibrary().threadBacktraceLocationFactory;
211211
for (int i = 0; i < locationsLength; i++) {
212212
locations[i] = Layouts.THREAD_BACKTRACE_LOCATION.createThreadBacktraceLocation(
213-
factory, this, i);
213+
factory,
214+
this,
215+
i);
214216
}
215217
return ArrayHelpers.createArray(context, locations, locations.length);
216218
}

0 commit comments

Comments
 (0)