Skip to content

Commit a6d5568

Browse files
committed
[deprecation] Marked AccessLevel.MODULE as deprecated. It was written for a future that never came to pass, and should never be used.
1 parent 492011d commit a6d5568

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

src/core/lombok/AccessLevel.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2009 The Project Lombok Authors.
2+
* Copyright (C) 2009-2025 The Project Lombok Authors.
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,24 @@
2525
* Represents an AccessLevel. Used e.g. to specify the access level for generated methods and fields.
2626
*/
2727
public enum AccessLevel {
28-
PUBLIC, MODULE, PROTECTED, PACKAGE, PRIVATE,
28+
/** Represents the {@code public} access level. */
29+
PUBLIC,
30+
31+
/**
32+
* Acts exactly like {@code PACKAGE} - the package private access level.
33+
* @deprecated This value was created at a time when a module-level access keyword was planned as a way of being prepared for the future. But that's not the direction java went in; a 'module access level' is not likely to ever exist. This enum acts like {@code PACKAGE} in every way.
34+
*/
35+
@Deprecated MODULE,
36+
37+
/** Represents the {@code protected} access level (any code in the same package as well as any subtype). */
38+
PROTECTED,
39+
40+
/** Represents the default access level: package private. (any code in the same package). */
41+
PACKAGE,
42+
43+
/** Represents the {@code private} access level. */
44+
PRIVATE,
45+
2946
/** Represents not generating anything or the complete lack of a method. */
3047
NONE;
3148
}

src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,7 @@ public static TypeReference makeType(TypeBinding binding, ASTNode pos, boolean a
13931393
/**
13941394
* Turns an {@code AccessLevel} instance into the flag bit used by eclipse.
13951395
*/
1396+
@SuppressWarnings("deprecation") // We have to use MODULE here to make it act according to spec, which is to treat it like `PACKAGE`.
13961397
public static int toEclipseModifier(AccessLevel value) {
13971398
switch (value) {
13981399
case MODULE:

src/core/lombok/javac/handlers/JavacHandlerUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,7 @@ public static boolean isConstructorCall(final JCStatement statement) {
997997
/**
998998
* Turns an {@code AccessLevel} instance into the flag bit used by javac.
999999
*/
1000+
@SuppressWarnings("deprecation") // We have to use MODULE here to make it act according to spec, which is to treat it like `PACKAGE`.
10001001
public static int toJavacModifier(AccessLevel accessLevel) {
10011002
switch (accessLevel) {
10021003
case MODULE:

0 commit comments

Comments
 (0)