--- a/src/main/java/org/easymock/EasyMock.java Thu Feb 23 10:32:43 2012 +0100 +++ b/src/main/java/org/easymock/EasyMock.java Thu Feb 23 11:25:46 2012 +0100 @@ -1452,81 +1452,200 @@ /** * Expect any object but captures it for later use. - * - * @param Type of the captured object - * @param captured Where the parameter is captured + * + * @param + * Type of the captured object + * @param captured + * Where the parameter is captured * @return null */ - public static T capture(Capture captured) { + public static T capture(final Capture captured) { reportMatcher(new Captures(captured)); return null; } - + + /** + * Expect any boolean but captures it for later use. + * + * @param captured + * Where the parameter is captured + * @return false + */ + public static boolean captureBoolean(final Capture captured) { + reportMatcher(new Captures(captured)); + return false; + } + +// /** +// * Expect any boolean but captures it for later use. +// * +// * @param captured +// * Where the parameter is captured +// * @return 0 +// * +// * @deprecated Because of harder erasure enforcement, doesn't compile in +// * Java 7 +// */ +// @Deprecated +// public static boolean capture(final Capture captured) { +// return captureBoolean(captured); +// } + /** * Expect any int but captures it for later use. - * - * @param captured Where the parameter is captured + * + * @param captured + * Where the parameter is captured * @return 0 */ - public static int capture(Capture captured) { + public static int captureInt(final Capture captured) { reportMatcher(new Captures(captured)); return 0; } - +// /** +// * Expect any int but captures it for later use. +// * +// * @param captured +// * Where the parameter is captured +// * @return 0 +// * +// * @deprecated Because of harder erasure enforcement, doesn't compile in +// * Java 7 +// */ +// @Deprecated +// public static int capture(final Capture captured) { +// return captureInt(captured); +// } + /** * Expect any long but captures it for later use. - * - * @param captured Where the parameter is captured + * + * @param captured + * Where the parameter is captured * @return 0 */ - public static long capture(Capture captured) { + public static long captureLong(final Capture captured) { reportMatcher(new Captures(captured)); return 0; } - +// /** +// * Expect any long but captures it for later use. +// * +// * @param captured +// * Where the parameter is captured +// * @return 0 +// * +// * @deprecated Because of harder erasure enforcement, doesn't compile in +// * Java 7 +// */ +// @Deprecated +// public static long capture(final Capture captured) { +// return captureLong(captured); +// } + /** * Expect any float but captures it for later use. - * - * @param captured Where the parameter is captured + * + * @param captured + * Where the parameter is captured * @return 0 */ - public static float capture(Capture captured) { + public static float captureFloat(final Capture captured) { reportMatcher(new Captures(captured)); return 0; } - +// /** +// * Expect any float but captures it for later use. +// * +// * @param captured +// * Where the parameter is captured +// * @return 0 +// * +// * @deprecated Because of harder erasure enforcement, doesn't compile in +// * Java 7 +// */ +// @Deprecated +// public static float capture(final Capture captured) { +// return captureFloat(captured); +// } + /** * Expect any double but captures it for later use. - * - * @param captured Where the parameter is captured + * + * @param captured + * Where the parameter is captured * @return 0 */ - public static double capture(Capture captured) { + public static double captureDouble(final Capture captured) { reportMatcher(new Captures(captured)); return 0; } +// /** +// * Expect any double but captures it for later use. +// * +// * @param captured +// * Where the parameter is captured +// * @return 0 +// * +// * @deprecated Because of harder erasure enforcement, doesn't compile in +// * Java 7 +// */ +// @Deprecated +// public static double capture(final Capture captured) { +// return captureDouble(captured); +// } /** * Expect any byte but captures it for later use. - * - * @param captured Where the parameter is captured + * + * @param captured + * Where the parameter is captured * @return 0 */ - public static byte capture(Capture captured) { + public static byte captureByte(final Capture captured) { reportMatcher(new Captures(captured)); return 0; } - +// /** +// * Expect any byte but captures it for later use. +// * +// * @param captured +// * Where the parameter is captured +// * @return 0 +// * +// * @deprecated Because of harder erasure enforcement, doesn't compile in +// * Java 7 +// */ +// @Deprecated +// public static byte capture(final Capture captured) { +// return captureByte(captured); +// } + /** * Expect any char but captures it for later use. - * - * @param captured Where the parameter is captured + * + * @param captured + * Where the parameter is captured * @return 0 */ - public static char capture(Capture captured) { + public static char captureChar(final Capture captured) { reportMatcher(new Captures(captured)); return 0; } +// /** +// * Expect any char but captures it for later use. +// * +// * @param captured +// * Where the parameter is captured +// * @return 0 +// * +// * @deprecated Because of harder erasure enforcement, doesn't compile in +// * Java 7 +// */ +// @Deprecated +// public static char capture(final Capture captured) { +// return captureChar(captured); +// } /** * Switches the given mock objects (more exactly: the controls of the mock