code: private static boolean handleLegacyWeightInitFromJson(String json, Layer l, ObjectMapper mapper, JsonNode confs, int layerCount) {
          if ((l instanceof BaseLayer) && ((BaseLayer) l).getWeightInitFn() == null) {
              try {
                  JsonNode jsonNode = mapper.readTree(json);
                  if (confs == null) {
                      confs = jsonNode.get("confs");
                  }
                  if (confs instanceof ArrayNode) {
                      ArrayNode layerConfs = (ArrayNode) confs;
                      JsonNode outputLayerNNCNode = layerConfs.get(layerCount);
                      if (outputLayerNNCNode == null)
                          return false; //Should never happen...
                      JsonNode layerWrapperNode = outputLayerNNCNode.get("layer");
  
                      if (layerWrapperNode == null || layerWrapperNode.size() != 1) {
                          return true;
                      }
  
                      JsonNode layerNode = layerWrapperNode.elements().next();
                      JsonNode weightInit = layerNode.get("weightInit"); //Should only have 1 element: "dense", "output", etc
                      JsonNode distribution = layerNode.get("dist");
  
                      Distribution dist = null;
                      if(distribution != null) {
                          dist = mapper.treeToValue(distribution, Distribution.class);
                      }
  
                      if (weightInit != null) {
                          final IWeightInit wi = WeightInit.valueOf(weightInit.asText()).getWeightInitFunction(dist);
                          ((BaseLayer) l).setWeightInitFn(wi);
                      }
                  }
  
              } catch (IOException e) {
                  log.warn("Layer with null WeightInit detected: " + l.getLayerName() + ", could not parse JSON",
                          e);
              }
          }
          return true;
  
      }
docs: Handle {@link WeightInit} and {@link Distribution} from legacy configs in Json format. Copied from handling of {@link Activation}
  above.
  @return True if all is well and layer iteration shall continue. False else-wise.