File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/java.base/share/classes/jdk/internal/jimage Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ boolean resolve() {
53
53
ENABLED () {
54
54
@ Override
55
55
boolean resolve () {
56
- return true ;
56
+ return ENABLE_PREVIEW_MODE ;
57
57
}
58
58
},
59
59
/**
@@ -63,6 +63,9 @@ boolean resolve() {
63
63
FOR_RUNTIME () {
64
64
@ Override
65
65
boolean resolve () {
66
+ if (!ENABLE_PREVIEW_MODE ) {
67
+ return false ;
68
+ }
66
69
// We want to call jdk.internal.misc.PreviewFeatures.isEnabled(), but
67
70
// is not available in older JREs, so we must look to it reflectively.
68
71
Class <?> clazz ;
@@ -81,6 +84,15 @@ boolean resolve() {
81
84
}
82
85
};
83
86
87
+ // Temporary system property to disable preview patching and enable the new preview mode
88
+ // feature for testing/development. Once the preview mode feature is finished, the value
89
+ // will be always 'true' and this code, and all related dead-code can be removed.
90
+ private static final boolean DISABLE_PREVIEW_PATCHING_DEFAULT = false ;
91
+ private static final boolean ENABLE_PREVIEW_MODE = Boolean .parseBoolean (
92
+ System .getProperty (
93
+ "DISABLE_PREVIEW_PATCHING" ,
94
+ Boolean .toString (DISABLE_PREVIEW_PATCHING_DEFAULT )));
95
+
84
96
/**
85
97
* Resolves whether preview mode should be enabled for an {@link ImageReader}.
86
98
*/
You can’t perform that action at this time.
0 commit comments