Skip to content

Commit

Permalink
Fix yml constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
oxsean committed Jul 26, 2024
1 parent 6dd81e6 commit f62f397
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Object decode(InputStream is, Type targetType, Charset charset) throws De
@Override
public Object[] decode(InputStream is, Class<?>[] targetTypes, Charset charset) throws DecodeException {
try (InputStreamReader reader = new InputStreamReader(is, charset)) {
Yaml yaml = new Yaml();
Yaml yaml = createYaml();
Iterator<Object> iterator = yaml.loadAll(reader).iterator();
int len = targetTypes.length;
Object[] results = new Object[len];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.config.Configuration;
import org.apache.dubbo.common.config.ConfigurationUtils;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.constants.LoggerCodeConstants;
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.config.nested.RestConfig;
Expand Down Expand Up @@ -57,7 +58,8 @@

public final class DefaultRequestMappingRegistry implements RequestMappingRegistry {

private static final Logger LOGGER = LoggerFactory.getLogger(DefaultRequestMappingRegistry.class);
private static final ErrorTypeAwareLogger LOGGER =
LoggerFactory.getErrorTypeAwareLogger(DefaultRequestMappingRegistry.class);

private final FrameworkModel frameworkModel;
private final ContentNegotiator contentNegotiator;
Expand Down Expand Up @@ -154,9 +156,10 @@ private void register0(RequestMapping mapping, HandlerMeta handler) {
for (PathExpression path : mapping.getPathCondition().getExpressions()) {
Registration exists = tree.addPath(path, registration);
if (exists == null) {
LOGGER.debug("Register rest mapping path: '" + path + "' -> " + mapping);
} else {
LOGGER.warn(Messages.DUPLICATE_MAPPING.format(path, mapping, exists.mapping));
LOGGER.debug("Register rest mapping path: '{}' -> {}", path, mapping);
} else if (LOGGER.isWarnEnabled()) {
String msg = Messages.DUPLICATE_MAPPING.format(path, mapping, exists.mapping);
LOGGER.warn(LoggerCodeConstants.INTERNAL_ERROR, "", "", msg);
}
}
} finally {
Expand Down

0 comments on commit f62f397

Please sign in to comment.