Skip to content

Commit

Permalink
Merge pull request #3928 from pdbain-ibm/varhandle
Browse files Browse the repository at this point in the history
VarHandles class initialization
  • Loading branch information
DanHeidinga committed Jan 8, 2019
2 parents 8b82afb + 17f12b0 commit 46dbded
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*[INCLUDE-IF Sidecar19-SE]*/
/*******************************************************************************
* Copyright (c) 2016, 2018 IBM Corp. and others
* Copyright (c) 2016, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -90,9 +90,10 @@ static final MethodHandle[] populateMHs(final Class<?> initType) {

return populateMHs(operationsClass, lookupTypes, exactTypes);
}

/**
* Constructs a VarHandle to a static field.
* Ensure that the class is initialized to match behaviour of the reference implementation.
*
* @param lookupClass The class where we start the lookup of the field
* @param fieldName The field name
Expand All @@ -101,6 +102,7 @@ static final MethodHandle[] populateMHs(final Class<?> initType) {
*/
StaticFieldVarHandle(Class<?> lookupClass, String fieldName, Class<?> fieldType, Class<?> accessClass) {
super(lookupClass, fieldName, fieldType, accessClass, true, COORDINATE_TYPES, populateMHs(fieldType));
_unsafe.ensureClassInitialized(lookupClass);
}

/**
Expand Down

0 comments on commit 46dbded

Please sign in to comment.