You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/12/04 23:30:58 UTC

[28/47] ISIS-188: normalizing file endings throughout

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringBuilderUtils.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringBuilderUtils.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringBuilderUtils.java
index 1824128..4f73f87 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringBuilderUtils.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringBuilderUtils.java
@@ -1,36 +1,36 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.commons.lang;
-
-public class StringBuilderUtils {
-
-    public static void appendBuf(final StringBuilder buf, final String formatString, final Object... args) {
-        buf.append(String.format(formatString, args));
-    }
-
-    /**
-     * @deprecated - use a {@link StringBuilder} instead!
-     */
-    @Deprecated
-    public static void appendBuf(final StringBuffer buf, final String formatString, final Object... args) {
-        buf.append(String.format(formatString, args));
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.commons.lang;
+
+public class StringBuilderUtils {
+
+    public static void appendBuf(final StringBuilder buf, final String formatString, final Object... args) {
+        buf.append(String.format(formatString, args));
+    }
+
+    /**
+     * @deprecated - use a {@link StringBuilder} instead!
+     */
+    @Deprecated
+    public static void appendBuf(final StringBuffer buf, final String formatString, final Object... args) {
+        buf.append(String.format(formatString, args));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java
index 1d81921..185425b 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/StringUtils.java
@@ -1,374 +1,374 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.commons.lang;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import com.google.common.collect.Lists;
-
-import org.apache.isis.applib.util.Enums;
-
-public final class StringUtils {
-    private StringUtils() {
-    }
-
-    // ////////////////////////////////////////////////////////////
-    // naturalName, naturalize, simpleName, camel, memberIdFor
-    // ////////////////////////////////////////////////////////////
-
-    public static String naturalName(final String name) {
-
-        int pos = 0;
-
-        // find first upper case character
-        while ((pos < name.length()) && Character.isLowerCase(name.charAt(pos))) {
-            pos++;
-        }
-
-        if (pos == name.length()) {
-            return "invalid name";
-        }
-        return naturalize(name, pos);
-    }
-
-    public static String naturalize(final String name) {
-        return naturalize(name, 0);
-    }
-
-    private static String naturalize(final String name, final int startingPosition) {
-        if (name.length() <= startingPosition) {
-            throw new IllegalArgumentException("string shorter than starting position provided");
-        }
-        final StringBuffer s = new StringBuffer(name.length() - startingPosition);
-        for (int j = startingPosition; j < name.length(); j++) { // process
-                                                                 // english name
-                                                                 // - add spaces
-            if ((j > startingPosition) && isStartOfNewWord(name.charAt(j), name.charAt(j - 1))) {
-                s.append(' ');
-            }
-            if (j == startingPosition) {
-                s.append(Character.toUpperCase(name.charAt(j)));
-            } else {
-                s.append(name.charAt(j));
-            }
-        }
-        final String str = s.toString();
-        return str;
-    }
-
-    private static boolean isStartOfNewWord(final char c, final char previousChar) {
-        return Character.isUpperCase(c) || Character.isDigit(c) && !Character.isDigit(previousChar);
-    }
-
-    public static String simpleName(final String str) {
-        final int lastDot = str.lastIndexOf('.');
-        if (lastDot == -1) {
-            return str;
-        }
-        if (lastDot == str.length() - 1) {
-            throw new IllegalArgumentException("Name cannot end in '.'");
-        }
-        return str.substring(lastDot + 1);
-    }
-
-    public static String camel(final String name) {
-        final StringBuffer b = new StringBuffer(name.length());
-        final StringTokenizer t = new StringTokenizer(name);
-        b.append(t.nextToken());
-        while (t.hasMoreTokens()) {
-            final String token = t.nextToken();
-            b.append(token.substring(0, 1).toUpperCase()); // replace spaces
-                                                           // with
-            // camelCase
-            b.append(token.substring(1));
-        }
-        return b.toString();
-    }
-
-    // TODO: combine with camel
-    public static String camelLowerFirst(final String name) {
-        final StringBuffer b = new StringBuffer(name.length());
-        final StringTokenizer t = new StringTokenizer(name);
-        b.append(lowerFirst(t.nextToken()));
-        while (t.hasMoreTokens()) {
-            final String token = t.nextToken();
-            b.append(token.substring(0, 1).toUpperCase()); // replace spaces
-                                                           // with camelCase
-            b.append(token.substring(1).toLowerCase());
-        }
-        return b.toString();
-    }
-
-    public static String toLowerDashed(String name) {
-        return name.toLowerCase().replaceAll("\\s+", "-");
-    }
-
-    public static String pascal(final String name) {
-        return capitalize(camel(name));
-    }
-
-    public static String memberIdFor(final String member) {
-        return lowerLeading(camel(member));
-    }
-
-    // ////////////////////////////////////////////////////////////
-    // capitalize, lowerFirst, firstWord
-    // ////////////////////////////////////////////////////////////
-
-    public static String capitalize(final String str) {
-        if (str == null || str.length() == 0) {
-            return str;
-        }
-        if (str.length() == 1) {
-            return str.toUpperCase();
-        }
-        return Character.toUpperCase(str.charAt(0)) + str.substring(1);
-    }
-
-    /**
-     * Simply forces first char to be lower case.
-     */
-    public static String lowerFirst(final String str) {
-        if (isNullOrEmpty(str)) {
-            return str;
-        }
-        if (str.length() == 1) {
-            return str.toLowerCase();
-        }
-        return str.substring(0, 1).toLowerCase() + str.substring(1);
-    }
-
-    public static String lowerLeading(final String str) {
-        return lowerFirst(str);
-    }
-
-    public static String firstWord(final String line) {
-        final String[] split = line.split(" ");
-        return split[0];
-    }
-
-    // ////////////////////////////////////////////////////////////
-    // isNullOrEmpty, nullSafeEquals
-    // ////////////////////////////////////////////////////////////
-
-    public static boolean isNullOrEmpty(final String str) {
-        return str == null || str.isEmpty();
-    }
-
-    public static boolean nullSafeEquals(final String str1, final String str2) {
-        if (str1 == null || str2 == null) {
-            return false;
-        }
-        return str1.equals(str2);
-    }
-
-    // ////////////////////////////////////////////////////////////
-    // in, combine, combinePaths, splitOnCommas
-    // ////////////////////////////////////////////////////////////
-
-    public static boolean in(final String str, final String[] strings) {
-        for (final String strCandidate : strings) {
-            if (strCandidate.equals(str)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static String combine(final List<String> list) {
-        final StringBuffer buf = new StringBuffer();
-        for (final String message : list) {
-            if (list.size() > 1) {
-                buf.append("; ");
-            }
-            buf.append(message);
-        }
-        return buf.toString();
-    }
-
-    public static String combinePaths(final String path, final String... furtherPaths) {
-        final StringBuilder buf = new StringBuilder(path);
-        for (final String furtherPath : furtherPaths) {
-            if (buf.charAt(buf.length() - 1) != File.separatorChar) {
-                buf.append(File.separatorChar);
-            }
-            buf.append(furtherPath);
-        }
-        return buf.toString();
-    }
-
-    public static List<String> splitOnCommas(final String commaSeparatedList) {
-        if (commaSeparatedList == null) {
-            return null;
-        }
-        final String removeLeadingWhiteSpace = removeLeadingWhiteSpace(commaSeparatedList);
-        // special handling
-        if (removeLeadingWhiteSpace.length() == 0) {
-            return Collections.emptyList();
-        }
-        final String[] splitAsArray = removeLeadingWhiteSpace.split("\\W*,\\W*");
-        return Arrays.asList(splitAsArray);
-    }
-
-    // ////////////////////////////////////////////////////////////
-    // commaSeparatedClassNames
-    // ////////////////////////////////////////////////////////////
-
-    public static String commaSeparatedClassNames(final List<Object> objects) {
-        final StringBuilder buf = new StringBuilder();
-        int i = 0;
-        for (final Object object : objects) {
-            if (i++ > 0) {
-                buf.append(',');
-            }
-            buf.append(object.getClass().getName());
-        }
-        return buf.toString();
-    }
-
-    private static final char CARRIAGE_RETURN = '\n';
-    private static final char LINE_FEED = '\r';
-
-    /**
-     * Converts any <tt>\n</tt> to <tt>line.separator</tt>
-     * 
-     * @param string
-     * @return
-     */
-    public static String lineSeparated(final String string) {
-        final StringBuilder buf = new StringBuilder();
-        final String lineSeparator = System.getProperty("line.separator");
-        boolean lastWasLineFeed = false;
-        for (final char c : string.toCharArray()) {
-            final boolean isLineFeed = c == LINE_FEED;
-            final boolean isCarriageReturn = c == CARRIAGE_RETURN;
-            if (isCarriageReturn) {
-                buf.append(lineSeparator);
-                lastWasLineFeed = false;
-            } else {
-                if (lastWasLineFeed) {
-                    buf.append(LINE_FEED);
-                }
-                if (isLineFeed) {
-                    lastWasLineFeed = true;
-                } else {
-                    buf.append(c);
-                    lastWasLineFeed = false;
-                }
-            }
-        }
-        if (lastWasLineFeed) {
-            buf.append(LINE_FEED);
-        }
-        return buf.toString();
-    }
-
-    // ////////////////////////////////////////////////////////////
-    // removeTabs, removeLeadingWhiteSpace, stripLeadingSlash, stripNewLines,
-    // normalize
-    // ////////////////////////////////////////////////////////////
-
-    public static String removeTabs(final String text) {
-        // quick return - jvm java should always return here
-        if (text.indexOf('\t') == -1) {
-            return text;
-        }
-        final StringBuffer buf = new StringBuffer();
-        for (int i = 0; i < text.length(); i++) {
-            // a bit clunky to stay with j# api
-            if (text.charAt(i) != '\t') {
-                buf.append(text.charAt(i));
-            }
-        }
-        return buf.toString();
-    }
-
-    public static String removeLeadingWhiteSpace(final String str) {
-        if (str == null) {
-            return null;
-        }
-        return str.replaceAll("^\\W*", "");
-    }
-
-    public static String stripNewLines(final String str) {
-        return str.replaceAll("[\r\n]", "");
-    }
-
-    public static String stripLeadingSlash(final String path) {
-        if (!path.startsWith("/")) {
-            return path;
-        }
-        if (path.length() < 2) {
-            return "";
-        }
-        return path.substring(1);
-    }
-
-    /**
-     * Condenses any whitespace to a single character
-     * 
-     * @param str
-     * @return
-     */
-    public static String normalized(final String str) {
-        if (str == null) {
-            return null;
-        }
-        return str.replaceAll("\\s+", " ");
-    }
-
-    public static String[] normalized(final String... strings) {
-        final List<String> stringList = Lists.newArrayList();
-        for (final String string : strings) {
-            stringList.add(normalized(string));
-        }
-        return stringList.toArray(new String[] {});
-    }
-
-    public static String removePrefix(final String name, final String prefix) {
-        if (name.startsWith(prefix)) {
-            return name.substring(prefix.length());
-        } else {
-            return name;
-        }
-    }
-
-    public static <T> T coalesce(final T... strings) {
-        for (final T str : strings) {
-            if (str != null) {
-                return str;
-            }
-        }
-        return null;
-    }
-
-    public static String enumTitle(String enumName) {
-        return Enums.getFriendlyNameOf(enumName);
-    }
-
-    public static String enumDeTitle(String enumFriendlyName) {
-        return Enums.getEnumNameFromFriendly(enumFriendlyName);
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.commons.lang;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.util.Enums;
+
+public final class StringUtils {
+    private StringUtils() {
+    }
+
+    // ////////////////////////////////////////////////////////////
+    // naturalName, naturalize, simpleName, camel, memberIdFor
+    // ////////////////////////////////////////////////////////////
+
+    public static String naturalName(final String name) {
+
+        int pos = 0;
+
+        // find first upper case character
+        while ((pos < name.length()) && Character.isLowerCase(name.charAt(pos))) {
+            pos++;
+        }
+
+        if (pos == name.length()) {
+            return "invalid name";
+        }
+        return naturalize(name, pos);
+    }
+
+    public static String naturalize(final String name) {
+        return naturalize(name, 0);
+    }
+
+    private static String naturalize(final String name, final int startingPosition) {
+        if (name.length() <= startingPosition) {
+            throw new IllegalArgumentException("string shorter than starting position provided");
+        }
+        final StringBuffer s = new StringBuffer(name.length() - startingPosition);
+        for (int j = startingPosition; j < name.length(); j++) { // process
+                                                                 // english name
+                                                                 // - add spaces
+            if ((j > startingPosition) && isStartOfNewWord(name.charAt(j), name.charAt(j - 1))) {
+                s.append(' ');
+            }
+            if (j == startingPosition) {
+                s.append(Character.toUpperCase(name.charAt(j)));
+            } else {
+                s.append(name.charAt(j));
+            }
+        }
+        final String str = s.toString();
+        return str;
+    }
+
+    private static boolean isStartOfNewWord(final char c, final char previousChar) {
+        return Character.isUpperCase(c) || Character.isDigit(c) && !Character.isDigit(previousChar);
+    }
+
+    public static String simpleName(final String str) {
+        final int lastDot = str.lastIndexOf('.');
+        if (lastDot == -1) {
+            return str;
+        }
+        if (lastDot == str.length() - 1) {
+            throw new IllegalArgumentException("Name cannot end in '.'");
+        }
+        return str.substring(lastDot + 1);
+    }
+
+    public static String camel(final String name) {
+        final StringBuffer b = new StringBuffer(name.length());
+        final StringTokenizer t = new StringTokenizer(name);
+        b.append(t.nextToken());
+        while (t.hasMoreTokens()) {
+            final String token = t.nextToken();
+            b.append(token.substring(0, 1).toUpperCase()); // replace spaces
+                                                           // with
+            // camelCase
+            b.append(token.substring(1));
+        }
+        return b.toString();
+    }
+
+    // TODO: combine with camel
+    public static String camelLowerFirst(final String name) {
+        final StringBuffer b = new StringBuffer(name.length());
+        final StringTokenizer t = new StringTokenizer(name);
+        b.append(lowerFirst(t.nextToken()));
+        while (t.hasMoreTokens()) {
+            final String token = t.nextToken();
+            b.append(token.substring(0, 1).toUpperCase()); // replace spaces
+                                                           // with camelCase
+            b.append(token.substring(1).toLowerCase());
+        }
+        return b.toString();
+    }
+
+    public static String toLowerDashed(String name) {
+        return name.toLowerCase().replaceAll("\\s+", "-");
+    }
+
+    public static String pascal(final String name) {
+        return capitalize(camel(name));
+    }
+
+    public static String memberIdFor(final String member) {
+        return lowerLeading(camel(member));
+    }
+
+    // ////////////////////////////////////////////////////////////
+    // capitalize, lowerFirst, firstWord
+    // ////////////////////////////////////////////////////////////
+
+    public static String capitalize(final String str) {
+        if (str == null || str.length() == 0) {
+            return str;
+        }
+        if (str.length() == 1) {
+            return str.toUpperCase();
+        }
+        return Character.toUpperCase(str.charAt(0)) + str.substring(1);
+    }
+
+    /**
+     * Simply forces first char to be lower case.
+     */
+    public static String lowerFirst(final String str) {
+        if (isNullOrEmpty(str)) {
+            return str;
+        }
+        if (str.length() == 1) {
+            return str.toLowerCase();
+        }
+        return str.substring(0, 1).toLowerCase() + str.substring(1);
+    }
+
+    public static String lowerLeading(final String str) {
+        return lowerFirst(str);
+    }
+
+    public static String firstWord(final String line) {
+        final String[] split = line.split(" ");
+        return split[0];
+    }
+
+    // ////////////////////////////////////////////////////////////
+    // isNullOrEmpty, nullSafeEquals
+    // ////////////////////////////////////////////////////////////
+
+    public static boolean isNullOrEmpty(final String str) {
+        return str == null || str.isEmpty();
+    }
+
+    public static boolean nullSafeEquals(final String str1, final String str2) {
+        if (str1 == null || str2 == null) {
+            return false;
+        }
+        return str1.equals(str2);
+    }
+
+    // ////////////////////////////////////////////////////////////
+    // in, combine, combinePaths, splitOnCommas
+    // ////////////////////////////////////////////////////////////
+
+    public static boolean in(final String str, final String[] strings) {
+        for (final String strCandidate : strings) {
+            if (strCandidate.equals(str)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static String combine(final List<String> list) {
+        final StringBuffer buf = new StringBuffer();
+        for (final String message : list) {
+            if (list.size() > 1) {
+                buf.append("; ");
+            }
+            buf.append(message);
+        }
+        return buf.toString();
+    }
+
+    public static String combinePaths(final String path, final String... furtherPaths) {
+        final StringBuilder buf = new StringBuilder(path);
+        for (final String furtherPath : furtherPaths) {
+            if (buf.charAt(buf.length() - 1) != File.separatorChar) {
+                buf.append(File.separatorChar);
+            }
+            buf.append(furtherPath);
+        }
+        return buf.toString();
+    }
+
+    public static List<String> splitOnCommas(final String commaSeparatedList) {
+        if (commaSeparatedList == null) {
+            return null;
+        }
+        final String removeLeadingWhiteSpace = removeLeadingWhiteSpace(commaSeparatedList);
+        // special handling
+        if (removeLeadingWhiteSpace.length() == 0) {
+            return Collections.emptyList();
+        }
+        final String[] splitAsArray = removeLeadingWhiteSpace.split("\\W*,\\W*");
+        return Arrays.asList(splitAsArray);
+    }
+
+    // ////////////////////////////////////////////////////////////
+    // commaSeparatedClassNames
+    // ////////////////////////////////////////////////////////////
+
+    public static String commaSeparatedClassNames(final List<Object> objects) {
+        final StringBuilder buf = new StringBuilder();
+        int i = 0;
+        for (final Object object : objects) {
+            if (i++ > 0) {
+                buf.append(',');
+            }
+            buf.append(object.getClass().getName());
+        }
+        return buf.toString();
+    }
+
+    private static final char CARRIAGE_RETURN = '\n';
+    private static final char LINE_FEED = '\r';
+
+    /**
+     * Converts any <tt>\n</tt> to <tt>line.separator</tt>
+     * 
+     * @param string
+     * @return
+     */
+    public static String lineSeparated(final String string) {
+        final StringBuilder buf = new StringBuilder();
+        final String lineSeparator = System.getProperty("line.separator");
+        boolean lastWasLineFeed = false;
+        for (final char c : string.toCharArray()) {
+            final boolean isLineFeed = c == LINE_FEED;
+            final boolean isCarriageReturn = c == CARRIAGE_RETURN;
+            if (isCarriageReturn) {
+                buf.append(lineSeparator);
+                lastWasLineFeed = false;
+            } else {
+                if (lastWasLineFeed) {
+                    buf.append(LINE_FEED);
+                }
+                if (isLineFeed) {
+                    lastWasLineFeed = true;
+                } else {
+                    buf.append(c);
+                    lastWasLineFeed = false;
+                }
+            }
+        }
+        if (lastWasLineFeed) {
+            buf.append(LINE_FEED);
+        }
+        return buf.toString();
+    }
+
+    // ////////////////////////////////////////////////////////////
+    // removeTabs, removeLeadingWhiteSpace, stripLeadingSlash, stripNewLines,
+    // normalize
+    // ////////////////////////////////////////////////////////////
+
+    public static String removeTabs(final String text) {
+        // quick return - jvm java should always return here
+        if (text.indexOf('\t') == -1) {
+            return text;
+        }
+        final StringBuffer buf = new StringBuffer();
+        for (int i = 0; i < text.length(); i++) {
+            // a bit clunky to stay with j# api
+            if (text.charAt(i) != '\t') {
+                buf.append(text.charAt(i));
+            }
+        }
+        return buf.toString();
+    }
+
+    public static String removeLeadingWhiteSpace(final String str) {
+        if (str == null) {
+            return null;
+        }
+        return str.replaceAll("^\\W*", "");
+    }
+
+    public static String stripNewLines(final String str) {
+        return str.replaceAll("[\r\n]", "");
+    }
+
+    public static String stripLeadingSlash(final String path) {
+        if (!path.startsWith("/")) {
+            return path;
+        }
+        if (path.length() < 2) {
+            return "";
+        }
+        return path.substring(1);
+    }
+
+    /**
+     * Condenses any whitespace to a single character
+     * 
+     * @param str
+     * @return
+     */
+    public static String normalized(final String str) {
+        if (str == null) {
+            return null;
+        }
+        return str.replaceAll("\\s+", " ");
+    }
+
+    public static String[] normalized(final String... strings) {
+        final List<String> stringList = Lists.newArrayList();
+        for (final String string : strings) {
+            stringList.add(normalized(string));
+        }
+        return stringList.toArray(new String[] {});
+    }
+
+    public static String removePrefix(final String name, final String prefix) {
+        if (name.startsWith(prefix)) {
+            return name.substring(prefix.length());
+        } else {
+            return name;
+        }
+    }
+
+    public static <T> T coalesce(final T... strings) {
+        for (final T str : strings) {
+            if (str != null) {
+                return str;
+            }
+        }
+        return null;
+    }
+
+    public static String enumTitle(String enumName) {
+        return Enums.getFriendlyNameOf(enumName);
+    }
+
+    public static String enumDeTitle(String enumFriendlyName) {
+        return Enums.getEnumNameFromFriendly(enumFriendlyName);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Threads.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Threads.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Threads.java
index d5a039b..9617cbd 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Threads.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Threads.java
@@ -1,33 +1,33 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.commons.lang;
-
-public class Threads {
-
-    private Threads() {
-    }
-
-    public static Thread startThread(final Runnable target, final String name) {
-        final Thread thread = new Thread(target, name);
-        thread.start();
-        return thread;
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.commons.lang;
+
+public class Threads {
+
+    private Threads() {
+    }
+
+    public static Thread startThread(final Runnable target, final String name) {
+        final Thread thread = new Thread(target, name);
+        thread.start();
+        return thread;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ThrowableUtils.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ThrowableUtils.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ThrowableUtils.java
index 711ed4d..42d4743 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ThrowableUtils.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ThrowableUtils.java
@@ -1,43 +1,43 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.commons.lang;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-
-public final class ThrowableUtils {
-
-    public static String stackTraceFor(final Throwable exception) {
-        ByteArrayOutputStream baos = null;
-        try {
-            baos = new ByteArrayOutputStream();
-            exception.printStackTrace(new PrintStream(baos));
-            return baos.toString();
-        } finally {
-            if (baos != null) {
-                try {
-                    baos.close();
-                } catch (final IOException ignore) {
-                }
-            }
-        }
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.commons.lang;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+
+public final class ThrowableUtils {
+
+    public static String stackTraceFor(final Throwable exception) {
+        ByteArrayOutputStream baos = null;
+        try {
+            baos = new ByteArrayOutputStream();
+            exception.printStackTrace(new PrintStream(baos));
+            return baos.toString();
+        } finally {
+            if (baos != null) {
+                try {
+                    baos.close();
+                } catch (final IOException ignore) {
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ToString.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ToString.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ToString.java
index 2ffb1c7..4a7744a 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ToString.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/ToString.java
@@ -1,181 +1,181 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.commons.lang;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-public final class ToString {
-
-    public static String createName(final Object forObject) {
-        final StringBuffer buffer = new StringBuffer();
-        createName(forObject, buffer);
-        return buffer.toString();
-    }
-
-    private static void createName(final Object forObject, final StringBuffer string) {
-        string.append(name(forObject));
-        string.append("@");
-        string.append(Integer.toHexString(forObject.hashCode()));
-    }
-
-    public static String name(final Object forObject) {
-        final String name = forObject.getClass().getName();
-        return name.substring(name.lastIndexOf('.') + 1);
-    }
-
-    public static String timestamp(final Date date) {
-        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd-hhmmssSSS");
-        return date == null ? "" : simpleDateFormat.format(date);
-    }
-
-    public static ToString createWithIdentifier(final Object object) {
-        return new ToString(object);
-    }
-
-    public static ToString createAnonymous(final Object object) {
-        final ToString string = new ToString();
-        string.append(name(object));
-        string.append("[");
-        return string;
-    }
-
-    private boolean addComma = false;
-    private final StringBuffer buf;
-    private boolean useLineBreaks;
-
-    private ToString() {
-        buf = new StringBuffer();
-    }
-
-    public ToString(final Object forObject) {
-        buf = new StringBuffer();
-        createName(forObject, buf);
-        buf.append("[");
-    }
-
-    public ToString(final Object forObject, final int id) {
-        buf = new StringBuffer();
-        buf.append(name(forObject));
-        buf.append("#");
-        buf.append(id);
-        buf.append("[");
-    }
-
-    public ToString(final Object forObject, final String text) {
-        this(forObject);
-        buf.append(text);
-        addComma = text.length() > 0;
-    }
-
-    public ToString append(final String text) {
-        buf.append(text);
-        return this;
-    }
-
-    public ToString append(final String name, final boolean flag) {
-        append(name, flag ? "true" : "false");
-        return this;
-    }
-
-    public ToString append(final String name, final byte number) {
-        append(name, Byte.toString(number));
-        return this;
-    }
-
-    public ToString append(final String name, final double number) {
-        append(name, Double.toString(number));
-        return this;
-    }
-
-    public ToString append(final String name, final float number) {
-        append(name, Float.toString(number));
-        return this;
-    }
-
-    public ToString append(final String name, final int number) {
-        append(name, Integer.toString(number));
-        return this;
-    }
-
-    public ToString append(final String name, final long number) {
-        append(name, Long.toString(number));
-        return this;
-    }
-
-    public ToString append(final String name, final Object object) {
-        append(name, object == null ? "null" : object.toString());
-        return this;
-    }
-
-    public ToString append(final String name, final short number) {
-        append(name, Short.toString(number));
-        return this;
-    }
-
-    public ToString append(final String name, final String string) {
-        if (addComma) {
-            this.buf.append(',');
-            if (useLineBreaks) {
-                this.buf.append("\n\t");
-            }
-        } else {
-            addComma = true;
-        }
-        this.buf.append(name);
-        this.buf.append('=');
-        this.buf.append(string);
-
-        return this;
-    }
-
-    public ToString appendAsHex(final String name, final long number) {
-        append(name, "#" + Long.toHexString(number));
-        return this;
-    }
-
-    public void appendAsTimestamp(final String name, final Date date) {
-        final String dateString = timestamp(date);
-        append(name, dateString);
-    }
-
-    public void appendTruncated(final String name, final String string, final int maxLength) {
-        if (string.length() > maxLength) {
-            append(name, string.substring(0, maxLength));
-            append("...");
-        } else {
-            append(name, string);
-        }
-    }
-
-    public void setAddComma() {
-        this.addComma = true;
-    }
-
-    public void setUseLineBreaks(final boolean useLineBreaks) {
-        this.useLineBreaks = useLineBreaks;
-    }
-
-    @Override
-    public String toString() {
-        buf.append(']');
-        return buf.toString();
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.commons.lang;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public final class ToString {
+
+    public static String createName(final Object forObject) {
+        final StringBuffer buffer = new StringBuffer();
+        createName(forObject, buffer);
+        return buffer.toString();
+    }
+
+    private static void createName(final Object forObject, final StringBuffer string) {
+        string.append(name(forObject));
+        string.append("@");
+        string.append(Integer.toHexString(forObject.hashCode()));
+    }
+
+    public static String name(final Object forObject) {
+        final String name = forObject.getClass().getName();
+        return name.substring(name.lastIndexOf('.') + 1);
+    }
+
+    public static String timestamp(final Date date) {
+        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd-hhmmssSSS");
+        return date == null ? "" : simpleDateFormat.format(date);
+    }
+
+    public static ToString createWithIdentifier(final Object object) {
+        return new ToString(object);
+    }
+
+    public static ToString createAnonymous(final Object object) {
+        final ToString string = new ToString();
+        string.append(name(object));
+        string.append("[");
+        return string;
+    }
+
+    private boolean addComma = false;
+    private final StringBuffer buf;
+    private boolean useLineBreaks;
+
+    private ToString() {
+        buf = new StringBuffer();
+    }
+
+    public ToString(final Object forObject) {
+        buf = new StringBuffer();
+        createName(forObject, buf);
+        buf.append("[");
+    }
+
+    public ToString(final Object forObject, final int id) {
+        buf = new StringBuffer();
+        buf.append(name(forObject));
+        buf.append("#");
+        buf.append(id);
+        buf.append("[");
+    }
+
+    public ToString(final Object forObject, final String text) {
+        this(forObject);
+        buf.append(text);
+        addComma = text.length() > 0;
+    }
+
+    public ToString append(final String text) {
+        buf.append(text);
+        return this;
+    }
+
+    public ToString append(final String name, final boolean flag) {
+        append(name, flag ? "true" : "false");
+        return this;
+    }
+
+    public ToString append(final String name, final byte number) {
+        append(name, Byte.toString(number));
+        return this;
+    }
+
+    public ToString append(final String name, final double number) {
+        append(name, Double.toString(number));
+        return this;
+    }
+
+    public ToString append(final String name, final float number) {
+        append(name, Float.toString(number));
+        return this;
+    }
+
+    public ToString append(final String name, final int number) {
+        append(name, Integer.toString(number));
+        return this;
+    }
+
+    public ToString append(final String name, final long number) {
+        append(name, Long.toString(number));
+        return this;
+    }
+
+    public ToString append(final String name, final Object object) {
+        append(name, object == null ? "null" : object.toString());
+        return this;
+    }
+
+    public ToString append(final String name, final short number) {
+        append(name, Short.toString(number));
+        return this;
+    }
+
+    public ToString append(final String name, final String string) {
+        if (addComma) {
+            this.buf.append(',');
+            if (useLineBreaks) {
+                this.buf.append("\n\t");
+            }
+        } else {
+            addComma = true;
+        }
+        this.buf.append(name);
+        this.buf.append('=');
+        this.buf.append(string);
+
+        return this;
+    }
+
+    public ToString appendAsHex(final String name, final long number) {
+        append(name, "#" + Long.toHexString(number));
+        return this;
+    }
+
+    public void appendAsTimestamp(final String name, final Date date) {
+        final String dateString = timestamp(date);
+        append(name, dateString);
+    }
+
+    public void appendTruncated(final String name, final String string, final int maxLength) {
+        if (string.length() > maxLength) {
+            append(name, string.substring(0, maxLength));
+            append("...");
+        } else {
+            append(name, string);
+        }
+    }
+
+    public void setAddComma() {
+        this.addComma = true;
+    }
+
+    public void setUseLineBreaks(final boolean useLineBreaks) {
+        this.useLineBreaks = useLineBreaks;
+    }
+
+    @Override
+    public String toString() {
+        buf.append(']');
+        return buf.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Types.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Types.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Types.java
index 6949bd5..781cf17 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Types.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/Types.java
@@ -16,43 +16,43 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.core.commons.lang;
-
-import java.util.Collection;
-import java.util.List;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-
-public final class Types {
-    
-    private Types(){}
-
-    public static <T> Collection<T> filtered(final List<Object> candidates, final Class<T> type) {
-        return Collections2.transform(
-                    Collections2.filter(candidates, Types.isOfType(type)),
-                Types.castTo(type));
-    }
-
-    public static final <T> Predicate<Object> isOfType(final Class<T> type) {
-        return new Predicate<Object>() {
-            @Override
-            public boolean apply(Object input) {
-                return type.isAssignableFrom(input.getClass());
-            }
-        };
-    }
-
-    public static <T> Function<Object, T> castTo(final Class<T> type) {
-        return new Function<Object, T>() {
-            @SuppressWarnings("unchecked")
-            @Override
-            public T apply(final Object input) {
-                return (T) input;
-            }
-        };
-    }
-
-
-}
+package org.apache.isis.core.commons.lang;
+
+import java.util.Collection;
+import java.util.List;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+
+public final class Types {
+    
+    private Types(){}
+
+    public static <T> Collection<T> filtered(final List<Object> candidates, final Class<T> type) {
+        return Collections2.transform(
+                    Collections2.filter(candidates, Types.isOfType(type)),
+                Types.castTo(type));
+    }
+
+    public static final <T> Predicate<Object> isOfType(final Class<T> type) {
+        return new Predicate<Object>() {
+            @Override
+            public boolean apply(Object input) {
+                return type.isAssignableFrom(input.getClass());
+            }
+        };
+    }
+
+    public static <T> Function<Object, T> castTo(final Class<T> type) {
+        return new Function<Object, T>() {
+            @SuppressWarnings("unchecked")
+            @Override
+            public T apply(final Object input) {
+                return (T) input;
+            }
+        };
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/WrapperUtils.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/WrapperUtils.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/WrapperUtils.java
index 44614f5..f6a3732 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/WrapperUtils.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/WrapperUtils.java
@@ -1,61 +1,61 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.commons.lang;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public final class WrapperUtils {
-
-    private WrapperUtils() {
-    }
-
-    private static Map<Class<?>, Class<?>> wrapperClasses = new HashMap<Class<?>, Class<?>>();
-
-    static {
-        wrapperClasses.put(boolean.class, Boolean.class);
-        wrapperClasses.put(byte.class, Byte.class);
-        wrapperClasses.put(char.class, Character.class);
-        wrapperClasses.put(short.class, Short.class);
-        wrapperClasses.put(int.class, Integer.class);
-        wrapperClasses.put(long.class, Long.class);
-        wrapperClasses.put(float.class, Float.class);
-        wrapperClasses.put(double.class, Double.class);
-    }
-
-    public static Class<?> wrap(final Class<?> primitiveClass) {
-        return wrapperClasses.get(primitiveClass);
-    }
-
-    public static Class<?>[] wrapAsNecessary(final Class<?>[] classes) {
-        final List<Class<?>> wrappedClasses = new ArrayList<Class<?>>();
-        for (final Class<?> cls : classes) {
-            if (cls.isPrimitive()) {
-                wrappedClasses.add(wrap(cls));
-            } else {
-                wrappedClasses.add(cls);
-            }
-        }
-        return wrappedClasses.toArray(new Class[] {});
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.commons.lang;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public final class WrapperUtils {
+
+    private WrapperUtils() {
+    }
+
+    private static Map<Class<?>, Class<?>> wrapperClasses = new HashMap<Class<?>, Class<?>>();
+
+    static {
+        wrapperClasses.put(boolean.class, Boolean.class);
+        wrapperClasses.put(byte.class, Byte.class);
+        wrapperClasses.put(char.class, Character.class);
+        wrapperClasses.put(short.class, Short.class);
+        wrapperClasses.put(int.class, Integer.class);
+        wrapperClasses.put(long.class, Long.class);
+        wrapperClasses.put(float.class, Float.class);
+        wrapperClasses.put(double.class, Double.class);
+    }
+
+    public static Class<?> wrap(final Class<?> primitiveClass) {
+        return wrapperClasses.get(primitiveClass);
+    }
+
+    public static Class<?>[] wrapAsNecessary(final Class<?>[] classes) {
+        final List<Class<?>> wrappedClasses = new ArrayList<Class<?>>();
+        for (final Class<?> cls : classes) {
+            if (cls.isPrimitive()) {
+                wrappedClasses.add(wrap(cls));
+            } else {
+                wrappedClasses.add(cls);
+            }
+        }
+        return wrappedClasses.toArray(new Class[] {});
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/package-info.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/package-info.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/package-info.java
index a5b8e25..ea099b4 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/package-info.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/lang/package-info.java
@@ -1,27 +1,27 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-/**
- * This package holds a small number of classes to extend the JDK.
- * 
- * <p>
- * These classes should be thought of as being in the same spirit as
- * the google <i>guava</i> library helper classes (and some may be replaced by guava in the future).
- */
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/**
+ * This package holds a small number of classes to extend the JDK.
+ * 
+ * <p>
+ * These classes should be thought of as being in the same spirit as
+ * the google <i>guava</i> library helper classes (and some may be replaced by guava in the future).
+ */
 package org.apache.isis.core.commons.lang;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java
index 252c774..ffda9cf 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/IsisMatchers.java
@@ -1,374 +1,374 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.commons.matchers;
-
-import static org.hamcrest.CoreMatchers.nullValue;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.isis.core.commons.lang.StringUtils;
-import org.hamcrest.CoreMatchers;
-import org.hamcrest.Description;
-import org.hamcrest.Factory;
-import org.hamcrest.Matcher;
-import org.hamcrest.Matchers;
-import org.hamcrest.TypeSafeMatcher;
-import org.hamcrest.core.IsEqual;
-import org.hamcrest.core.StringContains;
-import org.hamcrest.core.StringEndsWith;
-import org.hamcrest.core.StringStartsWith;
-
-/**
- * Hamcrest {@link Matcher} implementations.
- * 
- */
-public final class IsisMatchers {
-
-    private IsisMatchers() {
-    }
-
-    @Factory
-    public static Matcher<String> containsStripNewLines(final String expected) {
-        final String strippedExpected = StringUtils.stripNewLines(expected);
-        return new StringContains(strippedExpected) {
-            @Override
-            public boolean matchesSafely(final String actual) {
-                return super.matchesSafely(StringUtils.stripNewLines(actual));
-            }
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("a string (ignoring new lines) containing").appendValue(strippedExpected);
-            }
-        };
-    }
-
-    @Factory
-    public static Matcher<String> equalToStripNewLines(final String expected) {
-        final String strippedExpected = StringUtils.stripNewLines(expected);
-        return new IsEqual<String>(strippedExpected) {
-            @Override
-            public boolean matches(final Object actualObj) {
-                final String actual = (String) actualObj;
-                return super.matches(StringUtils.stripNewLines(actual));
-            }
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("a string (ignoring new lines) equal to").appendValue(strippedExpected);
-            }
-        };
-    }
-
-    @Factory
-    public static StringStartsWith startsWithStripNewLines(final String expected) {
-        final String strippedExpected = StringUtils.stripNewLines(expected);
-        return new StringStartsWith(strippedExpected) {
-            @Override
-            public boolean matchesSafely(final String actual) {
-                return super.matchesSafely(StringUtils.stripNewLines(actual));
-            }
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("a string (ignoring new lines) starting with").appendValue(strippedExpected);
-            }
-        };
-    }
-
-    @Factory
-    public static Matcher<String> endsWithStripNewLines(final String expected) {
-        final String strippedExpected = StringUtils.stripNewLines(expected);
-        return new StringEndsWith(strippedExpected) {
-            @Override
-            public boolean matchesSafely(final String actual) {
-                return super.matchesSafely(StringUtils.stripNewLines(actual));
-            }
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("a string (ignoring new lines) ending with").appendValue(strippedExpected);
-            }
-        };
-    }
-
-    @Factory
-    public static <T> Matcher<T> anInstanceOf(final Class<T> expected) {
-        return new TypeSafeMatcher<T>() {
-            @Override
-            public boolean matchesSafely(final T actual) {
-                return expected.isAssignableFrom(actual.getClass());
-            }
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("an instance of ").appendValue(expected);
-            }
-        };
-    }
-
-    @Factory
-    public static Matcher<String> nonEmptyString() {
-        return new TypeSafeMatcher<String>() {
-            @Override
-            public boolean matchesSafely(final String str) {
-                return str != null && str.length() > 0;
-            }
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("a non empty string");
-            }
-
-        };
-    }
-
-    @Factory
-    @SuppressWarnings("unchecked")
-    public static Matcher<String> nonEmptyStringOrNull() {
-        return CoreMatchers.anyOf(nullValue(String.class), nonEmptyString());
-    }
-
-    @Factory
-    public static Matcher<List<?>> containsElementThat(final Matcher<?> elementMatcher) {
-        return new TypeSafeMatcher<List<?>>() {
-            @Override
-            public boolean matchesSafely(final List<?> list) {
-                for (final Object o : list) {
-                    if (elementMatcher.matches(o)) {
-                        return true;
-                    }
-                }
-                return false;
-            }
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("contains element that ").appendDescriptionOf(elementMatcher);
-            }
-        };
-    }
-
-    @Factory
-    public static <T extends Comparable<T>> Matcher<T> greaterThan(final T c) {
-        return Matchers.greaterThan(c);
-    }
-
-    @Factory
-    public static Matcher<Class<?>> classEqualTo(final Class<?> operand) {
-
-        class ClassEqualsMatcher extends TypeSafeMatcher<Class<?>> {
-            private final Class<?> clazz;
-
-            public ClassEqualsMatcher(final Class<?> clazz) {
-                this.clazz = clazz;
-            }
-
-            @Override
-            public boolean matchesSafely(final Class<?> arg) {
-                return clazz == arg;
-            }
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendValue(clazz);
-            }
-        }
-
-        return new ClassEqualsMatcher(operand);
-    }
-
-    @Factory
-    public static Matcher<File> existsAndNotEmpty() {
-
-        return new TypeSafeMatcher<File>() {
-
-            @Override
-            public void describeTo(final Description arg0) {
-                arg0.appendText("exists and is not empty");
-            }
-
-            @Override
-            public boolean matchesSafely(final File f) {
-                return f.exists() && f.length() > 0;
-            }
-        };
-    }
-
-    @Factory
-    public static Matcher<String> matches(final String regex) {
-        return new TypeSafeMatcher<String>() {
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("string matching " + regex);
-            }
-
-            @Override
-            public boolean matchesSafely(final String str) {
-                return str.matches(regex);
-            }
-        };
-    }
-
-    @Factory
-    public static <X> Matcher<Class<X>> anySubclassOf(final Class<X> cls) {
-        return new TypeSafeMatcher<Class<X>>() {
-
-            @Override
-            public void describeTo(final Description arg0) {
-                arg0.appendText("is subclass of ").appendText(cls.getName());
-            }
-
-            @Override
-            public boolean matchesSafely(final Class<X> item) {
-                return cls.isAssignableFrom(item);
-            }
-        };
-    }
-
-    @Factory
-    public static <T> Matcher<List<T>> sameContentsAs(final List<T> expected) {
-        return new TypeSafeMatcher<List<T>>() {
-
-            @Override
-            public void describeTo(final Description description) {
-                description.appendText("same sequence as " + expected);
-            }
-
-            @Override
-            public boolean matchesSafely(final List<T> actual) {
-                return actual.containsAll(expected) && expected.containsAll(actual);
-            }
-        };
-    }
-
-    @Factory
-    public static <T> Matcher<List<T>> listContaining(final T t) {
-        return new TypeSafeMatcher<List<T>>() {
-    
-            @Override
-            public void describeTo(Description arg0) {
-                arg0.appendText("list containing ").appendValue(t);
-            }
-    
-            @Override
-            public boolean matchesSafely(List<T> arg0) {
-                return arg0.contains(t);
-            }
-        };
-    }
-
-    @Factory
-    public static <T> Matcher<List<T>> listContainingAll(final T... items) {
-        return new TypeSafeMatcher<List<T>>() {
-
-            @Override
-            public void describeTo(Description arg0) {
-                arg0.appendText("has items ").appendValue(items);
-                
-            }
-
-            @Override
-            public boolean matchesSafely(List<T> arg0) {
-                return arg0.containsAll(Arrays.asList(items));
-            }
-        };
-    }
-
-    @Factory
-    public static Matcher<List<Object>> containsObjectOfType(final Class<?> cls) {
-        return new TypeSafeMatcher<List<Object>>() {
-
-            @Override
-            public void describeTo(final Description desc) {
-                desc.appendText("contains instance of type " + cls.getName());
-            }
-
-            @Override
-            public boolean matchesSafely(final List<Object> items) {
-                for (final Object object : items) {
-                    if (cls.isAssignableFrom(object.getClass())) {
-                        return true;
-                    }
-                }
-                return false;
-            }
-        };
-    }
-
-    @Factory
-    public static Matcher<String> startsWith(final String expected) {
-        return new TypeSafeMatcher<String>() {
-
-            @Override
-            public void describeTo(Description description) {
-                description.appendText(" starts with '" + expected + "'");
-            }
-
-            @Override
-            public boolean matchesSafely(String actual) {
-                return actual.startsWith(expected);
-            }
-        };
-    }
-
-    @Factory
-    public static Matcher<String> contains(final String expected) {
-        return new TypeSafeMatcher<String>() {
-
-            @Override
-            public void describeTo(Description description) {
-                description.appendText(" contains '" + expected + "'");
-            }
-
-            @Override
-            public boolean matchesSafely(String actual) {
-                return actual.contains(expected);
-            }
-        };
-    }
-
-    
-    @Factory
-    public static Matcher<File> equalsFile(final File file) throws IOException {
-        final String canonicalPath = file.getCanonicalPath();
-        return new TypeSafeMatcher<File>() {
-
-            @Override
-            public void describeTo(Description arg0) {
-                arg0.appendText("file '" + canonicalPath + "'");
-            }
-
-            @Override
-            public boolean matchesSafely(File arg0) {
-                try {
-                    return arg0.getCanonicalPath().equals(canonicalPath);
-                } catch (IOException e) {
-                    return false;
-                }
-            }
-        };
-    }
-
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.commons.matchers;
+
+import static org.hamcrest.CoreMatchers.nullValue;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.isis.core.commons.lang.StringUtils;
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.Description;
+import org.hamcrest.Factory;
+import org.hamcrest.Matcher;
+import org.hamcrest.Matchers;
+import org.hamcrest.TypeSafeMatcher;
+import org.hamcrest.core.IsEqual;
+import org.hamcrest.core.StringContains;
+import org.hamcrest.core.StringEndsWith;
+import org.hamcrest.core.StringStartsWith;
+
+/**
+ * Hamcrest {@link Matcher} implementations.
+ * 
+ */
+public final class IsisMatchers {
+
+    private IsisMatchers() {
+    }
+
+    @Factory
+    public static Matcher<String> containsStripNewLines(final String expected) {
+        final String strippedExpected = StringUtils.stripNewLines(expected);
+        return new StringContains(strippedExpected) {
+            @Override
+            public boolean matchesSafely(final String actual) {
+                return super.matchesSafely(StringUtils.stripNewLines(actual));
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("a string (ignoring new lines) containing").appendValue(strippedExpected);
+            }
+        };
+    }
+
+    @Factory
+    public static Matcher<String> equalToStripNewLines(final String expected) {
+        final String strippedExpected = StringUtils.stripNewLines(expected);
+        return new IsEqual<String>(strippedExpected) {
+            @Override
+            public boolean matches(final Object actualObj) {
+                final String actual = (String) actualObj;
+                return super.matches(StringUtils.stripNewLines(actual));
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("a string (ignoring new lines) equal to").appendValue(strippedExpected);
+            }
+        };
+    }
+
+    @Factory
+    public static StringStartsWith startsWithStripNewLines(final String expected) {
+        final String strippedExpected = StringUtils.stripNewLines(expected);
+        return new StringStartsWith(strippedExpected) {
+            @Override
+            public boolean matchesSafely(final String actual) {
+                return super.matchesSafely(StringUtils.stripNewLines(actual));
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("a string (ignoring new lines) starting with").appendValue(strippedExpected);
+            }
+        };
+    }
+
+    @Factory
+    public static Matcher<String> endsWithStripNewLines(final String expected) {
+        final String strippedExpected = StringUtils.stripNewLines(expected);
+        return new StringEndsWith(strippedExpected) {
+            @Override
+            public boolean matchesSafely(final String actual) {
+                return super.matchesSafely(StringUtils.stripNewLines(actual));
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("a string (ignoring new lines) ending with").appendValue(strippedExpected);
+            }
+        };
+    }
+
+    @Factory
+    public static <T> Matcher<T> anInstanceOf(final Class<T> expected) {
+        return new TypeSafeMatcher<T>() {
+            @Override
+            public boolean matchesSafely(final T actual) {
+                return expected.isAssignableFrom(actual.getClass());
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("an instance of ").appendValue(expected);
+            }
+        };
+    }
+
+    @Factory
+    public static Matcher<String> nonEmptyString() {
+        return new TypeSafeMatcher<String>() {
+            @Override
+            public boolean matchesSafely(final String str) {
+                return str != null && str.length() > 0;
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("a non empty string");
+            }
+
+        };
+    }
+
+    @Factory
+    @SuppressWarnings("unchecked")
+    public static Matcher<String> nonEmptyStringOrNull() {
+        return CoreMatchers.anyOf(nullValue(String.class), nonEmptyString());
+    }
+
+    @Factory
+    public static Matcher<List<?>> containsElementThat(final Matcher<?> elementMatcher) {
+        return new TypeSafeMatcher<List<?>>() {
+            @Override
+            public boolean matchesSafely(final List<?> list) {
+                for (final Object o : list) {
+                    if (elementMatcher.matches(o)) {
+                        return true;
+                    }
+                }
+                return false;
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("contains element that ").appendDescriptionOf(elementMatcher);
+            }
+        };
+    }
+
+    @Factory
+    public static <T extends Comparable<T>> Matcher<T> greaterThan(final T c) {
+        return Matchers.greaterThan(c);
+    }
+
+    @Factory
+    public static Matcher<Class<?>> classEqualTo(final Class<?> operand) {
+
+        class ClassEqualsMatcher extends TypeSafeMatcher<Class<?>> {
+            private final Class<?> clazz;
+
+            public ClassEqualsMatcher(final Class<?> clazz) {
+                this.clazz = clazz;
+            }
+
+            @Override
+            public boolean matchesSafely(final Class<?> arg) {
+                return clazz == arg;
+            }
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendValue(clazz);
+            }
+        }
+
+        return new ClassEqualsMatcher(operand);
+    }
+
+    @Factory
+    public static Matcher<File> existsAndNotEmpty() {
+
+        return new TypeSafeMatcher<File>() {
+
+            @Override
+            public void describeTo(final Description arg0) {
+                arg0.appendText("exists and is not empty");
+            }
+
+            @Override
+            public boolean matchesSafely(final File f) {
+                return f.exists() && f.length() > 0;
+            }
+        };
+    }
+
+    @Factory
+    public static Matcher<String> matches(final String regex) {
+        return new TypeSafeMatcher<String>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("string matching " + regex);
+            }
+
+            @Override
+            public boolean matchesSafely(final String str) {
+                return str.matches(regex);
+            }
+        };
+    }
+
+    @Factory
+    public static <X> Matcher<Class<X>> anySubclassOf(final Class<X> cls) {
+        return new TypeSafeMatcher<Class<X>>() {
+
+            @Override
+            public void describeTo(final Description arg0) {
+                arg0.appendText("is subclass of ").appendText(cls.getName());
+            }
+
+            @Override
+            public boolean matchesSafely(final Class<X> item) {
+                return cls.isAssignableFrom(item);
+            }
+        };
+    }
+
+    @Factory
+    public static <T> Matcher<List<T>> sameContentsAs(final List<T> expected) {
+        return new TypeSafeMatcher<List<T>>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("same sequence as " + expected);
+            }
+
+            @Override
+            public boolean matchesSafely(final List<T> actual) {
+                return actual.containsAll(expected) && expected.containsAll(actual);
+            }
+        };
+    }
+
+    @Factory
+    public static <T> Matcher<List<T>> listContaining(final T t) {
+        return new TypeSafeMatcher<List<T>>() {
+    
+            @Override
+            public void describeTo(Description arg0) {
+                arg0.appendText("list containing ").appendValue(t);
+            }
+    
+            @Override
+            public boolean matchesSafely(List<T> arg0) {
+                return arg0.contains(t);
+            }
+        };
+    }
+
+    @Factory
+    public static <T> Matcher<List<T>> listContainingAll(final T... items) {
+        return new TypeSafeMatcher<List<T>>() {
+
+            @Override
+            public void describeTo(Description arg0) {
+                arg0.appendText("has items ").appendValue(items);
+                
+            }
+
+            @Override
+            public boolean matchesSafely(List<T> arg0) {
+                return arg0.containsAll(Arrays.asList(items));
+            }
+        };
+    }
+
+    @Factory
+    public static Matcher<List<Object>> containsObjectOfType(final Class<?> cls) {
+        return new TypeSafeMatcher<List<Object>>() {
+
+            @Override
+            public void describeTo(final Description desc) {
+                desc.appendText("contains instance of type " + cls.getName());
+            }
+
+            @Override
+            public boolean matchesSafely(final List<Object> items) {
+                for (final Object object : items) {
+                    if (cls.isAssignableFrom(object.getClass())) {
+                        return true;
+                    }
+                }
+                return false;
+            }
+        };
+    }
+
+    @Factory
+    public static Matcher<String> startsWith(final String expected) {
+        return new TypeSafeMatcher<String>() {
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText(" starts with '" + expected + "'");
+            }
+
+            @Override
+            public boolean matchesSafely(String actual) {
+                return actual.startsWith(expected);
+            }
+        };
+    }
+
+    @Factory
+    public static Matcher<String> contains(final String expected) {
+        return new TypeSafeMatcher<String>() {
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText(" contains '" + expected + "'");
+            }
+
+            @Override
+            public boolean matchesSafely(String actual) {
+                return actual.contains(expected);
+            }
+        };
+    }
+
+    
+    @Factory
+    public static Matcher<File> equalsFile(final File file) throws IOException {
+        final String canonicalPath = file.getCanonicalPath();
+        return new TypeSafeMatcher<File>() {
+
+            @Override
+            public void describeTo(Description arg0) {
+                arg0.appendText("file '" + canonicalPath + "'");
+            }
+
+            @Override
+            public boolean matchesSafely(File arg0) {
+                try {
+                    return arg0.getCanonicalPath().equals(canonicalPath);
+                } catch (IOException e) {
+                    return false;
+                }
+            }
+        };
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/package-info.java
----------------------------------------------------------------------
diff --git a/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/package-info.java b/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/package-info.java
index 075da09..ffa03c2 100644
--- a/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/package-info.java
+++ b/framework/core/commons/src/main/java/org/apache/isis/core/commons/matchers/package-info.java
@@ -1,24 +1,24 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-/**
- * Provides a set of Hamcrest {@link org.hamcrest.Matcher}s for various
- * purposes.
- */
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+/**
+ * Provides a set of Hamcrest {@link org.hamcrest.Matcher}s for various
+ * purposes.
+ */
 package org.apache.isis.core.commons.matchers;
\ No newline at end of file