This commit is contained in:
Alexey Kudravtsev
2014-09-23 18:47:38 +04:00
parent 44b4f320f9
commit 26918f0090
10 changed files with 27 additions and 9 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,6 +47,7 @@ public class LanguageExtensionPoint<T> extends CustomLoadingExtensionPointBean i
}
};
@NotNull
@Override
public T getInstance() {
return myHandler.getValue();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import com.intellij.openapi.extensions.AbstractExtensionPointBean;
import com.intellij.openapi.util.LazyInstance;
import com.intellij.util.KeyedLazyInstance;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.NotNull;
public class FileTypeExtensionPoint<T> extends AbstractExtensionPointBean implements KeyedLazyInstance<T> {
@@ -40,6 +41,7 @@ public class FileTypeExtensionPoint<T> extends AbstractExtensionPointBean implem
}
};
@NotNull
@Override
public T getInstance() {
return myHandler.getValue();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,9 +20,9 @@
package com.intellij.openapi.util;
import com.intellij.openapi.extensions.AbstractExtensionPointBean;
import com.intellij.openapi.util.LazyInstance;
import com.intellij.util.KeyedLazyInstance;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.NotNull;
public class ClassExtensionPoint<T> extends AbstractExtensionPointBean implements KeyedLazyInstance<T> {
// these must be public for scrambling compatibility
@@ -39,6 +39,7 @@ public class ClassExtensionPoint<T> extends AbstractExtensionPointBean implement
}
};
@NotNull
@Override
public T getInstance() {
return myHandler.getValue();
@@ -31,6 +31,7 @@ import com.intellij.util.xmlb.annotations.AbstractCollection;
import com.intellij.util.xmlb.annotations.Attribute;
import com.intellij.util.xmlb.annotations.Property;
import com.intellij.util.xmlb.annotations.Tag;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@@ -95,11 +96,13 @@ public class PsiReferenceProviderBean extends AbstractExtensionPointBean impleme
}
}
@NotNull
@Override
public String getKey() {
return language;
}
@NotNull
@Override
public PsiReferenceProviderBean getInstance() {
return this;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,10 @@
*/
package com.intellij.util;
import org.jetbrains.annotations.NotNull;
public interface KeyedLazyInstance<T> {
String getKey();
@NotNull
T getInstance();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package com.intellij.util;
import com.intellij.openapi.extensions.AbstractExtensionPointBean;
import com.intellij.openapi.util.LazyInstance;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.NotNull;
/**
* @author yole
@@ -38,6 +39,7 @@ public class KeyedLazyInstanceEP<T> extends AbstractExtensionPointBean implement
}
};
@NotNull
@Override
public T getInstance() {
return myHandler.getValue();
@@ -48,6 +48,7 @@ public class PsiReferenceContributorEP extends CustomLoadingExtensionPointBean i
}
};
@NotNull
@Override
public PsiReferenceContributor getInstance() {
return myHandler.getValue();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
package com.intellij.openapi.extensions;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.NotNull;
import org.picocontainer.PicoContainer;
/**
@@ -29,7 +30,8 @@ public class CustomLoadingExtensionPointBean extends AbstractExtensionPointBean
@Attribute("factoryArgument")
public String factoryArgument;
protected Object instantiateExtension(final String implementationClass, final PicoContainer picoContainer) throws ClassNotFoundException {
@NotNull
protected Object instantiateExtension(String implementationClass, @NotNull PicoContainer picoContainer) throws ClassNotFoundException {
if (factoryClass != null) {
ExtensionFactory factory = instantiate(factoryClass, picoContainer);
return factory.createInstance(factoryArgument, implementationClass);
@@ -53,6 +53,7 @@ public class WeigherExtensionPoint extends AbstractExtensionPointBean implements
}
};
@NotNull
@Override
public Weigher getInstance() {
return myHandler.getValue();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import com.intellij.openapi.extensions.AbstractExtensionPointBean;
import com.intellij.openapi.util.LazyInstance;
import com.intellij.util.KeyedLazyInstance;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.NotNull;
public class StatisticsServiceEP extends AbstractExtensionPointBean implements KeyedLazyInstance<StatisticsService> {
@Attribute("key")
@@ -35,6 +36,7 @@ public class StatisticsServiceEP extends AbstractExtensionPointBean implements K
}
};
@NotNull
@Override
public StatisticsService getInstance() {
return myHandler.getValue();