/** * Given an IMessage's target object, return the line number, of the IFile, which the target * object represents. If the object is null, or if access to line numbers is not possible, * return "0". */ public int getLineNo(Object object) { IResourceUtil util = ValidatorManager.getResourceUtil(); if (util == null) { return IMessage.LINENO_UNSET; } try { return util.getLineNo(object); } catch (Exception exc) { Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); if (logger.isLoggingLevel(Level.SEVERE)) { LogEntry entry = ValidationPlugin.getLogEntry(); entry.setSourceID("WorkbenchContext.getLineNo(Object)"); //$NON-NLS-1$ entry.setTargetException(exc); logger.write(Level.SEVERE, entry); } return IMessage.LINENO_UNSET; } }