Skip to content

Commit 7b5bc8d

Browse files
committed
ECJ: ignore deprecation problems if --warning-as-error and --force-deprecation-as-warning
1 parent 5b0f9ed commit 7b5bc8d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mx/_impl/mx.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7970,7 +7970,10 @@ def prepareJavacLike(self, project, javacArgs, disableApiRestrictions, warningsA
79707970
content = content + '\norg.eclipse.jdt.core.compiler.problem.discouragedReference=ignore'
79717971

79727972
if forceDeprecationAsWarning:
7973-
content = content.replace('org.eclipse.jdt.core.compiler.problem.deprecation=error', 'org.eclipse.jdt.core.compiler.problem.deprecation=warning')
7973+
if warningsAsErrors:
7974+
content = re.sub(r'org\.eclipse\.jdt\.core\.compiler\.problem\.deprecation=.*', 'org.eclipse.jdt.core.compiler.problem.deprecation=ignore', content)
7975+
else:
7976+
content = content.replace('org.eclipse.jdt.core.compiler.problem.deprecation=error', 'org.eclipse.jdt.core.compiler.problem.deprecation=warning')
79747977

79757978
if origContent != content:
79767979
jdtPropertiesTmp = jdtProperties + '.tmp'
@@ -18459,7 +18462,7 @@ def alarm_handler(signum, frame):
1845918462
_CACHE_DIR = get_env('MX_CACHE_DIR', join(dot_mx_dir(), 'cache'))
1846018463

1846118464
# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
18462-
version = VersionSpec("7.46.0") # GR-64149 pruning_mode
18465+
version = VersionSpec("7.47.0") # GR-64331 Ignore deprecation inspections on ECJ if --warning-as-error and --force-deprecation-as-warning
1846318466

1846418467
_mx_start_datetime = datetime.utcnow()
1846518468

0 commit comments

Comments
 (0)