michael-o commented on code in PR #576:
URL: https://github.com/apache/maven-resolver/pull/576#discussion_r1741027932


##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/http/RFC9457/RFC9457Payload.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.spi.connector.transport.http.RFC9457;
+
+import java.net.URI;
+
+public class RFC9457Payload {
+    private final URI type;

Review Comment:
   What about:
   > When this member is not present, its value is assumed to be "about:blank".



##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/http/RFC9457/RFC9457Payload.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.spi.connector.transport.http.RFC9457;
+
+import java.net.URI;
+
+public class RFC9457Payload {
+    private final URI type;
+
+    private final int status;

Review Comment:
   Should status be `Integer`? It is not mandatory



##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/http/RFC9457/RFC9457Payload.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.spi.connector.transport.http.RFC9457;
+
+import java.net.URI;
+
+public class RFC9457Payload {

Review Comment:
   This naming is inconsistent. You use `RFC`and `Rfc`, you should use only one 
syle: `Rfc`.



##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/http/RFC9457/RFC9457Reporter.java:
##########
@@ -20,60 +20,65 @@
 
 import java.io.IOException;
 
+import com.google.gson.Gson;
+import com.google.gson.JsonSyntaxException;
+
 /**
- * A reporter for RFC9457 messages.
+ * A reporter for RFC 9457 messages.
  * RFC9457 is a standard for reporting problems in HTTP responses as a JSON 
object.
  * There are members specified in the RFC but none of those appear to be 
required,
  * @see <a href=https://www.rfc-editor.org/rfc/rfc9457#section-3-7>rfc9457 
section 3.7</a>
  * Given the JSON fields are not mandatory, this reporter simply extracts the 
body of the
  * response without validation.
- * A RFC9457 message is detected by the content type 
"application/problem+json".
+ * A RFC 9457 message is detected by the content type 
"application/problem+json".
  *
  * @param <T> The type of the response.
  * @param <E> The base exception type to throw if the response is not a 
RFC9457 message.
  */
-public abstract class Rfc9457Reporter<T, E extends Exception> {
-    protected abstract boolean isRfc9457Message(T response);
+public abstract class RFC9457Reporter<T, E extends Exception> {
+    private static final Gson GSON = new Gson();

Review Comment:
   I consider Gson way to large here. There is 
https://github.com/ralfstx/minimal-json and friends. We only need to read out 
the obj props, that's it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to