package org.jbake.util;

import org.jbake.app.ContentStore;
import org.jbake.app.DocumentList;

import java.util.Map;

public class DataFileUtil {
    private ContentStore db;
    private String defaultDocType;

    public DataFileUtil(ContentStore db, String defaultDocType) {
        this.db = db;
        this.defaultDocType = defaultDocType;
    }

    public Map<String, Object> get(String ref) {
        DocumentList docs = db.getDocumentByUri(defaultDocType, ref);
        if (docs.size() == 1) {
            return docs.get(0);
        }
        return null;
    }
}

@@ -92,59 +92,230 @@
 st;%0A
-%0Aimport java.util.Map;%0A%0Apublic class DataFileUtil %7B
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class DataFileUtil %7B%0A%0A    private static final Logger LOGGER = LoggerFactory.getLogger(DataFileUtil.class);%0A
 %0A   
@@ -562,24 +562,78 @@
 ring ref) %7B%0A
+        Map%3CString, Object%3E result = new HashMap%3C%3E();%0A
         Docu
@@ -690,16 +690,137 @@
 , ref);%0A
+        if (docs.isEmpty()) %7B%0A            LOGGER.warn(%22Unable to locate content for ref: %7B%7D%22, ref);%0A        %7D else %7B%0A    
         
@@ -855,22 +855,28 @@
         
-return
+    result =
  docs.ge
@@ -881,16 +881,122 @@
 get(0);%0A
+            %7D else %7B%0A                LOGGER.warn(%22Located multiple hits for ref: %7B%7D%22, ref);%0A            %7D%0A
         
@@ -1016,12 +1016,14 @@
 urn 
-null
+result
 ;%0A  

Return empty Map instead of null. Added logging.