Skip to content

Commit

Permalink
Log failure to parse a type instead of throwing.
Browse files Browse the repository at this point in the history
Fixes #120.
  • Loading branch information
netdpb committed Dec 14, 2023
1 parent 8713813 commit a2736b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/test/java/tests/ConformanceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package tests;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static java.util.Objects.requireNonNull;
Expand All @@ -35,6 +34,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
Expand Down Expand Up @@ -84,6 +84,7 @@
*/
@RunWith(JUnit4.class)
public final class ConformanceTest {
private static final Logger logger = Logger.getLogger(ConformanceTest.class.getCanonicalName());

private static final ImmutableList<String> OPTIONS =
ImmutableList.of(
Expand Down Expand Up @@ -242,7 +243,10 @@ public String toString() {
*/
private static String fixType(String type) {
Matcher matcher = TYPE.matcher(type);
checkArgument(matcher.matches(), "did not match for \"%s\"", type);
if (!matcher.matches()) {
logger.warning(String.format("type \"%s\" did not match /%s/", type, TYPE.pattern()));
return type;
}
String args = matcher.group("args");
String suffix = matcher.group("suffix");
if (args == null && suffix != null) {
Expand Down

0 comments on commit a2736b8

Please sign in to comment.