Skip to content

Commit

Permalink
Provide additional method to avoid multiple load
Browse files Browse the repository at this point in the history
  • Loading branch information
Yulin Wang committed Mar 9, 2018
1 parent 5940b61 commit 02f04b9
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -38,7 +38,7 @@ public class FunctionProvider
*/
public static void setFunctionProvider( IFunctionProvider provider )
{
if ( FunctionProvider.instance == null )
if ( !isLoaded( ) )
{
FunctionProvider.instance = provider;
}
Expand All @@ -47,6 +47,11 @@ public static void setFunctionProvider( IFunctionProvider provider )
logger.warning( "FunctionProvider should not set twice." ); //$NON-NLS-1$
}
}

public static boolean isLoaded( )
{
return FunctionProvider.instance != null;
}

protected synchronized static IFunctionProvider getFunctionProvider( )
{
Expand Down

0 comments on commit 02f04b9

Please sign in to comment.