Here you can find the source of formatMessageException(String format, Object... args)
public static Exception formatMessageException(String format, Object... args)
//package com.java2s; //License from project: Apache License import java.util.Formatter; public class Main { public static Exception formatMessageException(String format, Object... args) { StringBuilder mes = new StringBuilder(); Formatter f = new Formatter(mes); f.format(format, args);// ww w . j a va 2 s.co m f.close(); return new Exception(mes.toString()); } }