| Summary: | [quick fix] generate throws clause erases previous throws clause | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Charlie Kelly <Eclipse> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Eclipse, martinae |
| Version: | 3.4 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
|
Description
Charlie Kelly
Can you give a reproducible example? What you describe should only happen if the new thrown exception is a super class of the already thrown exception. In that case there's not need to throw both. (In reply to comment #1) > Can you give a reproducible example? > What you describe should only happen if the new thrown exception is a super > class of the already thrown exception. In that case there's not need to throw > both. > If you remove the throws clause from the method signature, the Eclipse Java editor reports 2 errors (on the lines beginning "HyperSquareCharacteristics" and "this.centerHyperSquare"). If you request that Eclipse automatically correct the first error, it duplicates the method signature below. However, if you request the Eclipse automatically correct the second error, the new throws declaration is "throws TupleException, Exception". (I've included the code for TupleException and UtilityException at the bottom of this reply.) private void prepareCenterHyperSquare() throws UtilityException, TupleException, Exception { int order = this.sudokuHyperSquareCharacteristics.getOrder(); int dimensions = this.sudokuHyperSquareCharacteristics.getDimensions(); DirectionController directionController = new DirectionController(dimensions); HyperSquareCharacteristics hyperSquareCharacteristics = new HyperSquareCharacteristics (order, dimensions); this.centerHyperSquare = new HyperSquare (hyperSquareCharacteristics, directionController); }// private void prepareCenterHyperSquare() throws UtilityException, TupleException, Exception package com.charliekelly.magicsudoku.model.tuple; public class TupleException extends Exception { private static final long serialVersionUID = 1L; //////////////////////////////////////////////////////////////////////////// public TupleException (String message) { super(message); }// private static final long serialVersionUID = 1L; //////////////////////////////////////////////////////////////////////////// }// public class TupleException extends Exception package com.charliekelly.magicsudoku.model.utility; public class UtilityException extends Exception { private static final long serialVersionUID = 1L; //////////////////////////////////////////////////////////////////////////// public UtilityException (String message) { super(message); }// private static final long serialVersionUID = 1L; //////////////////////////////////////////////////////////////////////////// }// public class TupleException extends Exception This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |