All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.spun.util.DeprecatedException Maven / Gradle / Ivy

There is a newer version: 24.9.0
Show newest version
package com.spun.util;

import com.spun.util.introspection.Caller;
import com.spun.util.logger.SimpleLogger;

public class DeprecatedException extends FormattedException
{
  private static final long serialVersionUID = 1L;
  public DeprecatedException(String useNewMethod, Object... formattingParams)
  {
    super("%s is Depercated.\n Instead, please use :\n %s", methodName(Caller.get(1)),
        String.format(useNewMethod, formattingParams));
    SimpleLogger.message(getMessage());
  }
  private static Object methodName(StackTraceElement trace)
  {
    if (trace.getMethodName().equals(""))
    { return trace.getClassName(); }
    return trace.getMethodName();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy