Merge pull request #249 from sammyhk/master

#248 - fix VerisonUti.versionFor() unintended to return null instead …
diff --git a/release-notes/VERSION b/release-notes/VERSION
index d5869c8..8ef10c5 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -26,6 +26,12 @@
 - Implemented `ReaderBasedJsonParser.nextFieldName(SerializableString)`
   (to improved Afterburner performance over String/char[] sources)
 
+2.6.6 (not yet released)
+
+#248: VersionUtil.versionFor() unexpectedly return null instead of Version.unknownVersion()
+ (reported by sammyhk@github)
+
+2.6.5 (19-Jan-2015)
 2.6.4 (07-Dec-2015)
 
 No changes since 2.6.3.
diff --git a/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java b/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
index 2d9ac42..a6f53e0 100644
--- a/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
+++ b/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
@@ -465,7 +465,22 @@
 
     // No embedded objects with base impl...
     @Override public Object getEmbeddedObject() throws IOException { return null; }
-    
+
+    @SuppressWarnings("resource")
+    @Override // since 2.7
+    public byte[] getBinaryValue(Base64Variant variant) throws IOException
+    {
+        if (_binaryValue == null) {
+            if (_currToken != JsonToken.VALUE_STRING) {
+                _reportError("Current token ("+_currToken+") not VALUE_STRING, can not access as binary");
+            }
+            ByteArrayBuilder builder = _getByteArrayBuilder();
+            _decodeBase64(getText(), builder, variant);
+            _binaryValue = builder.toByteArray();
+        }
+        return _binaryValue;
+    }
+
     /*
     /**********************************************************
     /* Public low-level accessors
diff --git a/src/main/java/com/fasterxml/jackson/core/util/VersionUtil.java b/src/main/java/com/fasterxml/jackson/core/util/VersionUtil.java
index 2121fdd..3896001 100644
--- a/src/main/java/com/fasterxml/jackson/core/util/VersionUtil.java
+++ b/src/main/java/com/fasterxml/jackson/core/util/VersionUtil.java
@@ -78,24 +78,26 @@
     /**
      * Loads version information by introspecting a class named
      * "PackageVersion" in the same package as the given class.
-     *
+     *<p>
      * If the class could not be found or does not have a public
      * static Version field named "VERSION", returns null.
      */
     public static Version packageVersionFor(Class<?> cls)
     {
+        Version v = null;
         try {
             String versionInfoClassName = cls.getPackage().getName() + ".PackageVersion";
             Class<?> vClass = Class.forName(versionInfoClassName, true, cls.getClassLoader());
             // However, if class exists, it better work correctly, no swallowing exceptions
             try {
-                return ((Versioned) vClass.newInstance()).version();
+                v = ((Versioned) vClass.newInstance()).version();
             } catch (Exception e) {
                 throw new IllegalArgumentException("Failed to get Versioned out of "+vClass);
             }
         } catch (Exception e) { // ok to be missing (not good but acceptable)
-            return null;
+            ;
         }
+        return (v == null) ? Version.unknownVersion() : v;
     }
 
     /**
@@ -148,7 +150,7 @@
                     (parts.length > 3) ? parts[3] : null,
                     groupId, artifactId);
         }
-        return null;
+        return Version.unknownVersion();
     }
 
     protected static int parseVersionPart(String s) {