Skip to content

Commit abbba7b

Browse files
Protect static String array contents from modification.
1 parent c75755b commit abbba7b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

objectbox-java/src/main/java/io/objectbox/model/EntityFlags.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ private EntityFlags() { }
2828
*/
2929
public static final int USE_NO_ARG_CONSTRUCTOR = 1;
3030

31-
public static final String[] names = { "USE_NO_ARG_CONSTRUCTOR", };
31+
// Private to protect contents from getting modified.
32+
private static final String[] names = { "USE_NO_ARG_CONSTRUCTOR", };
3233

3334
public static String name(int e) { return names[e - USE_NO_ARG_CONSTRUCTOR]; }
3435
}

objectbox-java/src/main/java/io/objectbox/model/PropertyType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ private PropertyType() { }
6969
public static final short DateVector = 31;
7070
public static final short DateNanoVector = 32;
7171

72-
public static final String[] names = { "Unknown", "Bool", "Byte", "Short", "Char", "Int", "Long", "Float", "Double", "String", "Date", "Relation", "DateNano", "Reserved2", "Reserved3", "Reserved4", "Reserved5", "Reserved6", "Reserved7", "Reserved8", "Reserved9", "Reserved10", "BoolVector", "ByteVector", "ShortVector", "CharVector", "IntVector", "LongVector", "FloatVector", "DoubleVector", "StringVector", "DateVector", "DateNanoVector", };
72+
// Private to protect contents from getting modified.
73+
private static final String[] names = { "Unknown", "Bool", "Byte", "Short", "Char", "Int", "Long", "Float", "Double", "String", "Date", "Relation", "DateNano", "Reserved2", "Reserved3", "Reserved4", "Reserved5", "Reserved6", "Reserved7", "Reserved8", "Reserved9", "Reserved10", "BoolVector", "ByteVector", "ShortVector", "CharVector", "IntVector", "LongVector", "FloatVector", "DoubleVector", "StringVector", "DateVector", "DateNanoVector", };
7374

7475
public static String name(int e) { return names[e]; }
7576
}

objectbox-java/src/main/java/io/objectbox/query/OrderFlags.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ private OrderFlags() { }
4646
*/
4747
public static final int NULLS_ZERO = 16;
4848

49-
public static final String[] names = { "DESCENDING", "CASE_SENSITIVE", "", "UNSIGNED", "", "", "", "NULLS_LAST", "", "", "", "", "", "", "", "NULLS_ZERO", };
49+
// Private to protect contents from getting modified.
50+
private static final String[] names = { "DESCENDING", "CASE_SENSITIVE", "", "UNSIGNED", "", "", "", "NULLS_LAST", "", "", "", "", "", "", "", "NULLS_ZERO", };
5051

5152
public static String name(int e) { return names[e - DESCENDING]; }
5253
}

0 commit comments

Comments
 (0)