From c6e597eb3c4e69f6f84fea111aa66af17fb51e58 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 27 Aug 2008 00:37:02 +0000 Subject: [PATCH] unnecessary unused code removed --- .../src/org/aspectj/bridge/MessageUtil.java | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/bridge/src/org/aspectj/bridge/MessageUtil.java b/bridge/src/org/aspectj/bridge/MessageUtil.java index ef3ec0696..e9f23031e 100644 --- a/bridge/src/org/aspectj/bridge/MessageUtil.java +++ b/bridge/src/org/aspectj/bridge/MessageUtil.java @@ -63,11 +63,11 @@ public class MessageUtil { && handler.handleMessage(fail(message))); } - /** create and handle fail message from reader (ignored if handler is null) */ - public static boolean fail(IMessageHandler handler, String message, LineReader reader) { - return ((null != handler) - && handler.handleMessage(fail(message, reader))); - } +// /** create and handle fail message from reader (ignored if handler is null) */ +// public static boolean fail(IMessageHandler handler, String message, LineReader reader) { +// return ((null != handler) +// && handler.handleMessage(fail(message, reader))); +// } /** create and handle fail message (ignored if handler is null) */ public static boolean fail(IMessageHandler handler, String message, Throwable thrown) { @@ -125,7 +125,9 @@ public class MessageUtil { if (LangUtil.isEmpty(message)) { return FAIL_NOMESSAGE; } else { - return fail(message, (LineReader) null); + return new Message(message, IMessage.FAIL, null, ISourceLocation.EMPTY); + +// return fail(message, (LineReader) null); } } @@ -152,19 +154,19 @@ public class MessageUtil { * @return IMessage with IMessage.Kind FAIL and message as text * and soure location from reader */ - public static IMessage fail(String message, LineReader reader) { - ISourceLocation loc = null; - if (null == reader) { - loc = ISourceLocation.EMPTY; - } else { - int line = reader.getLineNumber(); - if (0 < line) { - line = 0; - } - loc = new SourceLocation(reader.getFile(), line, line, 0); - } - return new Message(message, IMessage.FAIL, null, loc); - } +// public static IMessage fail(String message) {//, LineReader reader) { +// ISourceLocation loc = null; +// if (null == reader) { +// loc = ISourceLocation.EMPTY; +// } else { +// int line = reader.getLineNumber(); +// if (0 < line) { +// line = 0; +// } +// loc = new SourceLocation(reader.getFile(), line, line, 0); +// } +// return new Message(message, IMessage.FAIL, null, ISourceLocation.EMPTY); +// } /** @return ERROR_NOMESSAGE if message is empty or IMessage otherwise */ // public static IMessage error(String message, ISourceLocation location) { @@ -211,16 +213,16 @@ public class MessageUtil { return new Message(message, IMessage.INFO, null, null); } - /** @return ISourceLocation with the current File/line of the reader */ - public static ISourceLocation makeSourceLocation(LineReader reader) { - LangUtil.throwIaxIfNull(reader, "reader"); - - int line = reader.getLineNumber(); - if (0 < line) { - line = 0; - } - return new SourceLocation(reader.getFile(), line, line, 0); - } +// /** @return ISourceLocation with the current File/line of the reader */ +// public static ISourceLocation makeSourceLocation(LineReader reader) { +// LangUtil.throwIaxIfNull(reader, "reader"); +// +// int line = reader.getLineNumber(); +// if (0 < line) { +// line = 0; +// } +// return new SourceLocation(reader.getFile(), line, line, 0); +// } // ------------------------ printing messages /** @@ -367,7 +369,7 @@ public class MessageUtil { return false; } public void dontIgnore(IMessage.Kind kind) { - ; + } public void ignore(Kind kind) { } @@ -591,7 +593,7 @@ public class MessageUtil { } public void dontIgnore(IMessage.Kind kind) { - ; + } private boolean textIn(IMessage message) { @@ -599,7 +601,7 @@ public class MessageUtil { return true; } String text = message.getMessage(); - return ((null != message) && (-1 != text.indexOf(infix))); + return (text.indexOf(infix)!=-1); } public void ignore(Kind kind) { -- 2.39.5