/** * <p> * as the {@link AstElement#copyOf()} can return {@code this} is the cloning is not implemented * by the subclass, this method add some spice around it by checking for this case and tracking * a DEBUG message in the logs. * </p> * * @param e the element to be cloned. Cannot be null. * @return same as {@link AstElement#copyOf()} */ @NotNull public static AstElement copyElementAndCheckReference(@NotNull final AstElement e) { AstElement clone = checkNotNull(e).copyOf(); if (clone == e && LOG.isDebugEnabled()) { LOG.debug( "Failed to clone the AstElement. Returning same reference; the client may fail. {} - {}", e.getClass().getName(), e); } return clone; }
return normalizeNonRelativePropertyName(propertyName); propertyName = normalizeNonRelativePropertyName(propertyName); return PathUtils.concat(relativePath, propertyName);
return normalizeNonRelativePropertyName(propertyName); propertyName = normalizeNonRelativePropertyName(propertyName); return PathUtils.concat(relativePath, propertyName);
/** * <p> * as the {@link AstElement#copyOf()} can return {@code this} is the cloning is not implemented * by the subclass, this method add some spice around it by checking for this case and tracking * a DEBUG message in the logs. * </p> * * @param e the element to be cloned. Cannot be null. * @return same as {@link AstElement#copyOf()} */ @NotNull public static AstElement copyElementAndCheckReference(@NotNull final AstElement e) { AstElement clone = checkNotNull(e).copyOf(); if (clone == e && LOG.isDebugEnabled()) { LOG.debug( "Failed to clone the AstElement. Returning same reference; the client may fail. {} - {}", e.getClass().getName(), e); } return clone; }
return normalizeNonRelativePropertyName(propertyName); propertyName = normalizeNonRelativePropertyName(propertyName); return PathUtils.concat(relativePath, propertyName);
/** * <p> * as the {@link AstElement#copyOf()} can return {@code this} is the cloning is not implemented * by the subclass, this method add some spice around it by checking for this case and tracking * a DEBUG message in the logs. * </p> * * @param e the element to be cloned. Cannot be null. * @return same as {@link AstElement#copyOf()} */ @Nonnull public static AstElement copyElementAndCheckReference(@Nonnull final AstElement e) { AstElement clone = checkNotNull(e).copyOf(); if (clone == e && LOG.isDebugEnabled()) { LOG.debug( "Failed to clone the AstElement. Returning same reference; the client may fail. {} - {}", e.getClass().getName(), e); } return clone; }