From 5e9272a5fd059a38780bc9b7994fee6f5db566ed Mon Sep 17 00:00:00 2001 From: "nikolce.mihajlovski" Date: Sat, 24 Jan 2015 18:00:33 +0100 Subject: [PATCH] Renamed and restructured utilities in U class. --- .../org/rapidoid/html/impl/TagRenderer.java | 2 +- .../java/org/rapidoid/http/HttpParser.java | 6 +- .../java/org/rapidoid/http/HttpProtocol.java | 4 +- .../org/rapidoid/net/impl/RapidoidWorker.java | 2 +- .../org/rapidoid/widget/BootstrapWidgets.java | 2 +- .../pojo/impl/PojoDispatcherImpl.java | 2 +- .../src/main/java/org/rapidoid/util/U.java | 168 ++++++++++-------- .../test/java/org/rapidoid/util/UTest.java | 46 ++--- .../src/main/java/org/rapidoid/util/Bufs.java | 2 +- .../src/main/java/org/rapidoid/util/Cls.java | 6 +- .../src/main/java/org/rapidoid/util/IO.java | 2 +- .../src/main/java/org/rapidoid/util/Rnd.java | 2 +- .../org/rapidoid/var/impl/AbstractVar.java | 2 +- 13 files changed, 129 insertions(+), 117 deletions(-) diff --git a/rapidoid-html/src/main/java/org/rapidoid/html/impl/TagRenderer.java b/rapidoid-html/src/main/java/org/rapidoid/html/impl/TagRenderer.java index e89c86999b..f409fd8bf5 100644 --- a/rapidoid-html/src/main/java/org/rapidoid/html/impl/TagRenderer.java +++ b/rapidoid-html/src/main/java/org/rapidoid/html/impl/TagRenderer.java @@ -91,7 +91,7 @@ public void str(TagContext ctx, Object content, int level, boolean inline, Objec } indent(out, level, inline); - write(out, HTML.escape(U.text(content))); + write(out, HTML.escape(U.readable(content))); } protected void join(TagContext ctx, Collection items, int level, boolean inline, Object extra, OutputStream out) { diff --git a/rapidoid-http/src/main/java/org/rapidoid/http/HttpParser.java b/rapidoid-http/src/main/java/org/rapidoid/http/HttpParser.java index 9ad196a259..2eb931ae78 100644 --- a/rapidoid-http/src/main/java/org/rapidoid/http/HttpParser.java +++ b/rapidoid-http/src/main/java/org/rapidoid/http/HttpParser.java @@ -242,7 +242,7 @@ public void parseBody(Buf src, KeyValueRanges headers, Range body, KeyValueRange src.get(multipartBoundary, helper.bytes, 2); - U.failIf(multipartBoundary.isEmpty(), "Invalid multi-part HTTP request!"); + U.rteIf(multipartBoundary.isEmpty(), "Invalid multi-part HTTP request!"); parseMultiParts(src, body, data, files, multipartBoundary, helper); } else { @@ -334,7 +334,7 @@ private void parseMultiPart(Buf src, Range body, KeyValueRanges data, KeyValueRa charset.strip(CHARSET_EQ.length, 0); BytesUtil.trim(src.bytes(), charset); - U.failIf(!BytesUtil.matches(src.bytes(), charset, _UTF_8, false), "Only the UTF-8 charset is supported!"); + U.rteIf(!BytesUtil.matches(src.bytes(), charset, _UTF_8, false), "Only the UTF-8 charset is supported!"); } } @@ -345,7 +345,7 @@ private void parseMultiPart(Buf src, Range body, KeyValueRanges data, KeyValueRa boolean validEncoding = BytesUtil.matches(src.bytes(), encoding, _7BIT, false) || BytesUtil.matches(src.bytes(), encoding, _8BIT, false) || BytesUtil.matches(src.bytes(), encoding, BINARY, false); - U.failIf(!validEncoding, "Invalid Content-transfer-encoding header value!"); + U.rteIf(!validEncoding, "Invalid Content-transfer-encoding header value!"); } if (filename.isEmpty()) { diff --git a/rapidoid-http/src/main/java/org/rapidoid/http/HttpProtocol.java b/rapidoid-http/src/main/java/org/rapidoid/http/HttpProtocol.java index 8fcc5a1f8a..2a140be881 100644 --- a/rapidoid-http/src/main/java/org/rapidoid/http/HttpProtocol.java +++ b/rapidoid-http/src/main/java/org/rapidoid/http/HttpProtocol.java @@ -62,8 +62,8 @@ protected void process(Channel ctx, HttpExchangeImpl x) { parser.parse(x.input(), x.isGet, x.isKeepAlive, x.body, x.verb, x.uri, x.path, x.query, x.protocol, x.headers, x.helper()); - U.failIf(x.verb.isEmpty() || x.uri.isEmpty(), "Invalid HTTP request!"); - U.failIf(x.isGet.value && !x.body.isEmpty(), "Body is NOT allowed in HTTP GET requests!"); + U.rteIf(x.verb.isEmpty() || x.uri.isEmpty(), "Invalid HTTP request!"); + U.rteIf(x.isGet.value && !x.body.isEmpty(), "Body is NOT allowed in HTTP GET requests!"); processRequest(x); } diff --git a/rapidoid-net/src/main/java/org/rapidoid/net/impl/RapidoidWorker.java b/rapidoid-net/src/main/java/org/rapidoid/net/impl/RapidoidWorker.java index 8a994c928c..646b1f2667 100644 --- a/rapidoid-net/src/main/java/org/rapidoid/net/impl/RapidoidWorker.java +++ b/rapidoid-net/src/main/java/org/rapidoid/net/impl/RapidoidWorker.java @@ -140,7 +140,7 @@ protected void connectOP(SelectionKey key) throws IOException { boolean ready; try { ready = socketChannel.finishConnect(); - U.failIf(!ready, "Expected an established connection!"); + U.rteIf(!ready, "Expected an established connection!"); connected.add(new RapidoidChannel(socketChannel, true)); } catch (ConnectException e) { retryConnecting(target); diff --git a/rapidoid-pages/src/main/java/org/rapidoid/widget/BootstrapWidgets.java b/rapidoid-pages/src/main/java/org/rapidoid/widget/BootstrapWidgets.java index e9b9da1aa9..73a26949f8 100644 --- a/rapidoid-pages/src/main/java/org/rapidoid/widget/BootstrapWidgets.java +++ b/rapidoid-pages/src/main/java/org/rapidoid/widget/BootstrapWidgets.java @@ -489,7 +489,7 @@ public static Var localVar(String name, int defaultValue, int min, int Var var = sessionVar(name + ":" + Pages.viewId(x), defaultValue); // TODO put the constraints into the variable implementation - Integer pageN = U.limit(min, var.get(), max); + Integer pageN = U.limited(min, var.get(), max); var.set(pageN); return var; diff --git a/rapidoid-pojo/src/main/java/org/rapidoid/pojo/impl/PojoDispatcherImpl.java b/rapidoid-pojo/src/main/java/org/rapidoid/pojo/impl/PojoDispatcherImpl.java index 3b7e2f89fa..80e559364e 100644 --- a/rapidoid-pojo/src/main/java/org/rapidoid/pojo/impl/PojoDispatcherImpl.java +++ b/rapidoid-pojo/src/main/java/org/rapidoid/pojo/impl/PojoDispatcherImpl.java @@ -286,7 +286,7 @@ private static void setBeanProperties(Object instance, Map param } private static PojoDispatchException error(Throwable cause, String msg, Object... args) { - return new PojoDispatchException(U.readable(msg, args), cause); + return new PojoDispatchException(U.nice(msg, args), cause); } private static PojoHandlerNotFoundException notFound() { diff --git a/rapidoid-u/src/main/java/org/rapidoid/util/U.java b/rapidoid-u/src/main/java/org/rapidoid/util/U.java index b5f71f84b0..70cdc4d7d2 100644 --- a/rapidoid-u/src/main/java/org/rapidoid/util/U.java +++ b/rapidoid-u/src/main/java/org/rapidoid/util/U.java @@ -41,7 +41,7 @@ public class U { private U() { } - public static String text(Object obj) { + public static String readable(Object obj) { if (obj == null) { return "null"; } else if (obj instanceof byte[]) { @@ -61,13 +61,13 @@ public static String text(Object obj) { } else if (obj instanceof char[]) { return Arrays.toString((char[]) obj); } else if (obj instanceof Object[]) { - return text((Object[]) obj); + return readable((Object[]) obj); } else { return String.valueOf(obj); } } - public static String text(Object[] objs) { + public static String readable(Object[] objs) { StringBuilder sb = new StringBuilder(); sb.append("["); @@ -75,7 +75,7 @@ public static String text(Object[] objs) { if (i > 0) { sb.append(", "); } - sb.append(text(objs[i])); + sb.append(readable(objs[i])); } sb.append("]"); @@ -83,44 +83,19 @@ public static String text(Object[] objs) { return sb.toString(); } - public static RuntimeException rte(String message, Object... args) { - return new RuntimeException(readable(message, args)); - } - - public static RuntimeException rte(Throwable cause) { - return new RuntimeException(cause); - } - - public static RuntimeException rte(String message) { - return new RuntimeException(message); - } - - public static RuntimeException notExpected() { - return rte("This operation is not expected to be called!"); - } - - public static IllegalArgumentException illegalArg(String message) { - return new IllegalArgumentException(message); - } - - public static T or(T value, T fallback) { - return value != null ? value : fallback; - } - public static String format(String s, Object... args) { return String.format(s, args); } - public static String readable(String format, Object... args) { - + public static String nice(String format, Object... args) { for (int i = 0; i < args.length; i++) { - args[i] = text(args[i]); + args[i] = readable(args[i]); } return String.format(format, args); } - public static String text(Collection coll) { + public static String readable(Iterable coll) { StringBuilder sb = new StringBuilder(); sb.append("["); @@ -131,7 +106,7 @@ public static String text(Collection coll) { sb.append(", "); } - sb.append(text(obj)); + sb.append(readable(obj)); first = false; } @@ -139,7 +114,7 @@ public static String text(Collection coll) { return sb.toString(); } - public static String text(Iterator it) { + public static String readable(Iterator it) { StringBuilder sb = new StringBuilder(); sb.append("["); @@ -151,7 +126,7 @@ public static String text(Iterator it) { first = false; } - sb.append(text(it.next())); + sb.append(readable(it.next())); } sb.append("]"); @@ -159,7 +134,7 @@ public static String text(Iterator it) { return sb.toString(); } - public static String textln(Object[] objs) { + public static String readableln(Object[] objs) { StringBuilder sb = new StringBuilder(); sb.append("["); @@ -168,7 +143,7 @@ public static String textln(Object[] objs) { sb.append(","); } sb.append("\n "); - sb.append(text(objs[i])); + sb.append(readable(objs[i])); } sb.append("\n]"); @@ -211,7 +186,7 @@ public static String render(Object[] items, String itemFormat, String sep) { if (i > 0) { sb.append(sep); } - sb.append(readable(itemFormat, items[i])); + sb.append(nice(itemFormat, items[i])); } return sb.toString(); @@ -228,24 +203,28 @@ public static String render(Iterable items, String itemFormat, String sep) { sb.append(sep); } - sb.append(readable(itemFormat, item)); + sb.append(nice(itemFormat, item)); i++; } return sb.toString(); } - public static T[] array(T... items) { - return items; - } - public static Iterator iterator(T[] arr) { return Arrays.asList(arr).iterator(); } - public static Set set(Collection coll) { + public static T[] array(T... items) { + return items; + } + + public static Set set(Iterable values) { Set set = new LinkedHashSet(); - set.addAll(coll); + + for (T val : values) { + set.add(val); + } + return set; } @@ -259,9 +238,13 @@ public static Set set(T... values) { return set; } - public static List list(Collection coll) { + public static List list(Iterable values) { List list = new ArrayList(); - list.addAll(coll); + + for (T item : values) { + list.add(item); + } + return list; } @@ -388,6 +371,10 @@ public static Queue queue(int maxSize) { return maxSize > 0 ? new ArrayBlockingQueue(maxSize) : new ConcurrentLinkedQueue(); } + public static T or(T value, T fallback) { + return value != null ? value : fallback; + } + public static long time() { return System.currentTimeMillis(); } @@ -408,15 +395,29 @@ public static boolean eq(Object a, Object b) { return a.equals(b); } - public static void failIf(boolean failureCondition, String msg) { - if (failureCondition) { - throw rte(msg); - } + public static RuntimeException rte(String message, Object... args) { + return new RuntimeException(nice(message, args)); + } + + public static RuntimeException rte(Throwable cause) { + return new RuntimeException(cause); + } + + public static RuntimeException rte(String message) { + return new RuntimeException(message); + } + + public static RuntimeException notExpected() { + return rte("This operation is not expected to be called!"); } - public static void failIf(boolean failureCondition, String msg, Object... args) { + public static IllegalArgumentException illegalArg(String message) { + return new IllegalArgumentException(message); + } + + public static void rteIf(boolean failureCondition, String msg) { if (failureCondition) { - throw rte(msg, args); + throw rte(msg); } } @@ -427,18 +428,8 @@ public static boolean must(boolean expectedCondition, String message) { return true; } - public static String copyNtimes(String s, int n) { - StringBuffer sb = new StringBuffer(); - - for (int i = 0; i < n; i++) { - sb.append(s); - } - - return sb.toString(); - } - public static RuntimeException rte(String message, Throwable cause, Object... args) { - return new RuntimeException(readable(message, args), cause); + return new RuntimeException(nice(message, args), cause); } public static RuntimeException rte(String message, Throwable cause) { @@ -461,21 +452,21 @@ public static boolean must(boolean expectedCondition, String message, long arg) public static boolean must(boolean expectedCondition, String message, Object arg) { if (!expectedCondition) { - throw rte(message, text(arg)); + throw rte(message, readable(arg)); } return true; } public static boolean must(boolean expectedCondition, String message, Object arg1, Object arg2) { if (!expectedCondition) { - throw rte(message, text(arg1), text(arg2)); + throw rte(message, readable(arg1), readable(arg2)); } return true; } public static boolean must(boolean expectedCondition, String message, Object arg1, Object arg2, Object arg3) { if (!expectedCondition) { - throw rte(message, text(arg1), text(arg2), text(arg3)); + throw rte(message, readable(arg1), readable(arg2), readable(arg3)); } return true; } @@ -488,13 +479,13 @@ public static void secure(boolean condition, String msg) { public static void secure(boolean condition, String msg, Object arg) { if (!condition) { - throw new SecurityException(readable(msg, arg)); + throw new SecurityException(nice(msg, arg)); } } public static void secure(boolean condition, String msg, Object arg1, Object arg2) { if (!condition) { - throw new SecurityException(readable(msg, arg1, arg2)); + throw new SecurityException(nice(msg, arg1, arg2)); } } @@ -512,7 +503,7 @@ public static void notNullAll(Object... items) { public static T notNull(T value, String desc, Object... descArgs) { if (value == null) { - throw rte("%s must NOT be null!", readable(desc, descArgs)); + throw rte("%s must NOT be null!", nice(desc, descArgs)); } return value; @@ -527,7 +518,7 @@ public static RuntimeException notSupported() { } public static void show(Object... values) { - String text = values.length == 1 ? text(values[0]) : text(values); + String text = values.length == 1 ? readable(values[0]) : readable(values); System.out.println(">" + text + "<"); } @@ -543,6 +534,10 @@ public static boolean isEmpty(Collection coll) { return coll == null || coll.isEmpty(); } + public static boolean isEmpty(Iterable iter) { + return iter.iterator().hasNext(); + } + public static boolean isEmpty(Map map) { return map == null || map.isEmpty(); } @@ -558,6 +553,8 @@ public static boolean isEmpty(Object value) { return isEmpty((Collection) value); } else if (value instanceof Map) { return isEmpty((Map) value); + } else if (value instanceof Iterable) { + return isEmpty((Iterable) value); } return false; } @@ -570,6 +567,16 @@ public static String uncapitalized(String s) { return s.isEmpty() ? s : s.substring(0, 1).toLowerCase() + s.substring(1); } + public static String copyNtimes(String s, int n) { + StringBuffer sb = new StringBuffer(); + + for (int i = 0; i < n; i++) { + sb.append(s); + } + + return sb.toString(); + } + public static String mid(String s, int beginIndex, int endIndex) { if (endIndex < 0) { endIndex = s.length() + endIndex; @@ -581,18 +588,23 @@ public static int num(String s) { return Integer.parseInt(s); } - public static int limit(int min, int value, int max) { + public static int limited(int min, int value, int max) { return Math.min(Math.max(min, value), max); } - public static T single(Collection coll) { - must(coll.size() == 1, "Expected exactly 1 items, but found: %s!", coll.size()); - return coll.iterator().next(); + public static T single(Iterable coll) { + Iterator it = coll.iterator(); + must(it.hasNext(), "Expected exactly 1 item, but didn't find any!"); + T item = it.next(); + must(!it.hasNext(), "Expected exactly 1 item, but found more than 1!"); + return item; } - public static T singleOrNone(Collection coll) { - must(coll.size() <= 1, "Expected 0 or 1 items, but found: %s!", coll.size()); - return !coll.isEmpty() ? coll.iterator().next() : null; + public static T singleOrNone(Iterable coll) { + Iterator it = coll.iterator(); + T item = it.hasNext() ? it.next() : null; + must(!it.hasNext(), "Expected 0 or 1 items, but found more than 1!"); + return item; } @SuppressWarnings("unchecked") diff --git a/rapidoid-u/src/test/java/org/rapidoid/util/UTest.java b/rapidoid-u/src/test/java/org/rapidoid/util/UTest.java index ccf3c55d89..1482c3866f 100644 --- a/rapidoid-u/src/test/java/org/rapidoid/util/UTest.java +++ b/rapidoid-u/src/test/java/org/rapidoid/util/UTest.java @@ -33,7 +33,7 @@ public class UTest extends TestCommons { @Test public void testTextCollectionOfObject() { - eq(U.text(new ArrayList()), "[]"); + eq(U.readable(new ArrayList()), "[]"); List lst = new ArrayList(); @@ -41,47 +41,47 @@ public void testTextCollectionOfObject() { lst.add("c"); lst.add("c++"); - eq(U.text(lst), "[java, c, c++]"); + eq(U.readable(lst), "[java, c, c++]"); } @Test public void testTextObject() { - eq(U.text((Object) null), "null"); + eq(U.readable((Object) null), "null"); - eq(U.text(123), "123"); - eq(U.text(1.23), "1.23"); + eq(U.readable(123), "123"); + eq(U.readable(1.23), "1.23"); - eq(U.text(true), "true"); - eq(U.text(false), "false"); + eq(U.readable(true), "true"); + eq(U.readable(false), "false"); - eq(U.text(""), ""); - eq(U.text("abc"), "abc"); + eq(U.readable(""), ""); + eq(U.readable("abc"), "abc"); - eq(U.text(new byte[] { -50, 0, 9 }), "[-50, 0, 9]"); - eq(U.text(new short[] { -500, 0, 9 }), "[-500, 0, 9]"); - eq(U.text(new int[] { 300000000, 70, 100 }), "[300000000, 70, 100]"); - eq(U.text(new long[] { 3000000000000000000L, 1, -8900000000000000000L }), + eq(U.readable(new byte[] { -50, 0, 9 }), "[-50, 0, 9]"); + eq(U.readable(new short[] { -500, 0, 9 }), "[-500, 0, 9]"); + eq(U.readable(new int[] { 300000000, 70, 100 }), "[300000000, 70, 100]"); + eq(U.readable(new long[] { 3000000000000000000L, 1, -8900000000000000000L }), "[3000000000000000000, 1, -8900000000000000000]"); - eq(U.text(new float[] { -30.40000000f, -1.587f, 89.3f }), "[-30.4, -1.587, 89.3]"); - eq(U.text(new double[] { -9987.1, -1.5, 8.3 }), "[-9987.1, -1.5, 8.3]"); + eq(U.readable(new float[] { -30.40000000f, -1.587f, 89.3f }), "[-30.4, -1.587, 89.3]"); + eq(U.readable(new double[] { -9987.1, -1.5, 8.3 }), "[-9987.1, -1.5, 8.3]"); - eq(U.text(new boolean[] { true }), "[true]"); + eq(U.readable(new boolean[] { true }), "[true]"); - eq(U.text(new char[] { 'k', 'o', 'h' }), "[k, o, h]"); - eq(U.text(new char[] { '-', '.', '+' }), "[-, ., +]"); + eq(U.readable(new char[] { 'k', 'o', 'h' }), "[k, o, h]"); + eq(U.readable(new char[] { '-', '.', '+' }), "[-, ., +]"); } @Test public void testTextObjectArray() { - eq(U.text(new Object[] {}), "[]"); - eq(U.text(new Object[] { 1, new boolean[] { true, false }, 3 }), "[1, [true, false], 3]"); - eq(U.text(new Object[] { new double[] { -9987.1 }, new char[] { 'a', '.' }, new int[] { 300, 70, 100 } }), + eq(U.readable(new Object[] {}), "[]"); + eq(U.readable(new Object[] { 1, new boolean[] { true, false }, 3 }), "[1, [true, false], 3]"); + eq(U.readable(new Object[] { new double[] { -9987.1 }, new char[] { 'a', '.' }, new int[] { 300, 70, 100 } }), "[[-9987.1], [a, .], [300, 70, 100]]"); - eq(U.text(new int[][] { { 1, 2 }, { 3, 4, 5 } }), "[[1, 2], [3, 4, 5]]"); + eq(U.readable(new int[][] { { 1, 2 }, { 3, 4, 5 } }), "[[1, 2], [3, 4, 5]]"); - eq(U.text(new String[][][] { { { "a" }, { "r" } }, { { "m" } } }), "[[[a], [r]], [[m]]]"); + eq(U.readable(new String[][][] { { { "a" }, { "r" } }, { { "m" } } }), "[[[a], [r]], [[m]]]"); } @Test diff --git a/rapidoid-utils/src/main/java/org/rapidoid/util/Bufs.java b/rapidoid-utils/src/main/java/org/rapidoid/util/Bufs.java index 24d68f05f1..65a522ae34 100644 --- a/rapidoid-utils/src/main/java/org/rapidoid/util/Bufs.java +++ b/rapidoid-utils/src/main/java/org/rapidoid/util/Bufs.java @@ -2,7 +2,7 @@ /* * #%L - * rapidoid-u + * rapidoid-utils * %% * Copyright (C) 2014 - 2015 Nikolche Mihajlovski * %% diff --git a/rapidoid-utils/src/main/java/org/rapidoid/util/Cls.java b/rapidoid-utils/src/main/java/org/rapidoid/util/Cls.java index 31e2b7f664..f6e323bca5 100644 --- a/rapidoid-utils/src/main/java/org/rapidoid/util/Cls.java +++ b/rapidoid-utils/src/main/java/org/rapidoid/util/Cls.java @@ -480,7 +480,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl } public static T implement(InvocationHandler handler, Class... classes) { - return implement(new InterceptorProxy(U.text(classes)), handler, classes); + return implement(new InterceptorProxy(U.readable(classes)), handler, classes); } public static T implementInterfaces(Object target, InvocationHandler handler) { @@ -679,7 +679,7 @@ public static T convert(Object value, Class toType) { if (value instanceof Date) { return (T) Dates.str((Date) value); } else { - return (T) U.text(value); + return (T) U.readable(value); } case OBJECT: @@ -828,7 +828,7 @@ public static T newInstance(Class clazz, Object... args) { } } - throw U.rte("Cannot find appropriate constructor for %s with args %s!", clazz, U.text(args)); + throw U.rte("Cannot find appropriate constructor for %s with args %s!", clazz, U.readable(args)); } public static T customizable(Class clazz, Object... args) { diff --git a/rapidoid-utils/src/main/java/org/rapidoid/util/IO.java b/rapidoid-utils/src/main/java/org/rapidoid/util/IO.java index 7232e3062b..e073c9486c 100644 --- a/rapidoid-utils/src/main/java/org/rapidoid/util/IO.java +++ b/rapidoid-utils/src/main/java/org/rapidoid/util/IO.java @@ -2,7 +2,7 @@ /* * #%L - * rapidoid-u + * rapidoid-utils * %% * Copyright (C) 2014 - 2015 Nikolche Mihajlovski * %% diff --git a/rapidoid-utils/src/main/java/org/rapidoid/util/Rnd.java b/rapidoid-utils/src/main/java/org/rapidoid/util/Rnd.java index 9d6c8678e0..5c29208d83 100644 --- a/rapidoid-utils/src/main/java/org/rapidoid/util/Rnd.java +++ b/rapidoid-utils/src/main/java/org/rapidoid/util/Rnd.java @@ -2,7 +2,7 @@ /* * #%L - * rapidoid-u + * rapidoid-utils * %% * Copyright (C) 2014 - 2015 Nikolche Mihajlovski * %% diff --git a/rapidoid-utils/src/main/java/org/rapidoid/var/impl/AbstractVar.java b/rapidoid-utils/src/main/java/org/rapidoid/var/impl/AbstractVar.java index b0ed51076f..2457c275af 100644 --- a/rapidoid-utils/src/main/java/org/rapidoid/var/impl/AbstractVar.java +++ b/rapidoid-utils/src/main/java/org/rapidoid/var/impl/AbstractVar.java @@ -29,7 +29,7 @@ public abstract class AbstractVar implements Var { @Override public String toString() { - return U.text(get()); + return U.readable(get()); } }