MavenParamReferenceProvider () { if (!myProviderInitialized) { MavenParamReferenceProvider res = null; if (myParam.refProvider != null) { assert myParam.values == null : myParam.name; Object instance; try { instance = myClassLoader.loadClass(myParam.refProvider).newInstance(); } catch (Exception e) { throw new RuntimeException("Failed to create reference provider instance", e); } if (instance instanceof MavenParamReferenceProvider) { res = (MavenParamReferenceProvider)instance; } else { res = new PsiReferenceProviderWrapper((PsiReferenceProvider)instance); } } else if (myParam.values != null) { StringTokenizer st = new StringTokenizer(myParam.values, " ,;"); int n = st.countTokens(); if (n == 0) throw new RuntimeException("Incorrect value of 'values' attribute for param " + myParam.name); String[] values = new String[n]; for (int i = 0; i < n; i++) { values[i] = st.nextToken(); } res = new MavenFixedValueReferenceProvider(values); } if (res != null && myParam.soft != null) { ((MavenSoftAwareReferenceProvider)res).setSoft(myParam.soft); } myProviderInstance = res; myProviderInitialized = true; } return myProviderInstance; }