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: 0fafe84517fc
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bf361d9a40dd
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jan 15, 2015

  1. Copy the full SHA
    3143319 View commit details
  2. Copy the full SHA
    bf361d9 View commit details
Showing with 5 additions and 2 deletions.
  1. +5 −2 core/src/main/java/org/jruby/truffle/runtime/core/StringFormatter.java
Original file line number Diff line number Diff line change
@@ -151,13 +151,15 @@ public static void format(RubyContext context, PrintStream stream, String format
break;
}

case 'x':
case 'X':
case 'd': {
if (lengthModifier != 0) {
formatBuilder.append(" ");
formatBuilder.append(lengthModifier);
}

formatBuilder.append("d");
formatBuilder.append(type);
final Object value = values.get(v);
final long longValue;
if (value instanceof Integer) {
@@ -167,6 +169,7 @@ public static void format(RubyContext context, PrintStream stream, String format
} else {
throw new UnsupportedOperationException();
}

stream.printf(formatBuilder.toString(), longValue);
break;
}
@@ -181,7 +184,7 @@ public static void format(RubyContext context, PrintStream stream, String format
}

default:
throw new RuntimeException("Kernel#sprintf error " + type);
throw new RuntimeException("Kernel#sprintf error -- unknown format: " + type);
}

v++;