aboutsummaryrefslogtreecommitdiff
path: root/test/core/src/lombok/LombokTestSource.java
diff options
context:
space:
mode:
authorCaleb Brinkman <cbrinkman@sonatype.com>2019-09-11 09:17:02 -0500
committerCaleb Brinkman <cbrinkman@sonatype.com>2019-09-11 09:17:02 -0500
commitdc56309dada0ae0fba2c939d3fc300d6abac145c (patch)
treef79b31cb086a368aa467f359b84923bca1ecaa6b /test/core/src/lombok/LombokTestSource.java
parent4dc5c32d6b47264b5c8abb6fdf24077eec5aa7e7 (diff)
parent8c32769f18361ed626ebd06962d924c288950d26 (diff)
downloadlombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.tar.gz
lombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.tar.bz2
lombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.zip
Merge branch 'master' of github.com:rzwitserloot/lombok into feature/builder-setter-prefixes
Diffstat (limited to 'test/core/src/lombok/LombokTestSource.java')
-rw-r--r--test/core/src/lombok/LombokTestSource.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/core/src/lombok/LombokTestSource.java b/test/core/src/lombok/LombokTestSource.java
index 31f7db3e..ba0aa972 100644
--- a/test/core/src/lombok/LombokTestSource.java
+++ b/test/core/src/lombok/LombokTestSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2015 The Project Lombok Authors.
+ * Copyright (C) 2014-2019 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -52,6 +52,7 @@ public class LombokTestSource {
private final Map<String, String> formatPreferences;
private final boolean ignore;
private final boolean skipCompareContent;
+ private final boolean skipIdempotent;
private final boolean unchanged;
private final int versionLowerLimit, versionUpperLimit;
private final ConfigurationResolver configuration;
@@ -92,6 +93,10 @@ public class LombokTestSource {
return skipCompareContent;
}
+ public boolean isSkipIdempotent() {
+ return skipIdempotent;
+ }
+
public String getSpecifiedEncoding() {
return specifiedEncoding;
}
@@ -139,6 +144,7 @@ public class LombokTestSource {
private static final Pattern IGNORE_PATTERN = Pattern.compile("^\\s*ignore\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private static final Pattern UNCHANGED_PATTERN = Pattern.compile("^\\s*unchanged\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private static final Pattern SKIP_COMPARE_CONTENT_PATTERN = Pattern.compile("^\\s*skip[- ]?compare[- ]?contents?\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
+ private static final Pattern SKIP_IDEMPOTENT_PATTERN = Pattern.compile("^\\s*skip[- ]?idempotent\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private LombokTestSource(File file, String content, List<CompilerMessageMatcher> messages, List<String> directives) {
this.file = file;
@@ -150,6 +156,7 @@ public class LombokTestSource {
int versionUpper = Integer.MAX_VALUE;
boolean ignore = false;
boolean skipCompareContent = false;
+ boolean skipIdempotent = false;
boolean unchanged = false;
String encoding = null;
Map<String, String> formats = new HashMap<String, String>();
@@ -173,6 +180,11 @@ public class LombokTestSource {
continue;
}
+ if (SKIP_IDEMPOTENT_PATTERN.matcher(directive).matches()) {
+ skipIdempotent = true;
+ continue;
+ }
+
if (lc.startsWith("platform ")) {
String platformDesc = lc.substring("platform ".length());
int idx = platformDesc.indexOf(':');
@@ -223,6 +235,7 @@ public class LombokTestSource {
this.versionUpperLimit = versionUpper;
this.ignore = ignore;
this.skipCompareContent = skipCompareContent;
+ this.skipIdempotent = skipIdempotent;
this.unchanged = unchanged;
this.platforms = platformLimit == null ? null : Arrays.asList(platformLimit);
ConfigurationProblemReporter reporter = new ConfigurationProblemReporter() {