Bug 9452

Summary: IllegalArgumentException when creating an AST for TestCase.java
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on:    
Bug Blocks: 8192    

Description Dirk Baeumer CLA 2002-02-12 10:09:11 EST
build 20020205+

- load JUnit into a workspace
- try to create an DOM/AST for TestCase.java

You get an IllegalArgumentException:

java.lang.IllegalArgumentException

Stack trace:
   java/lang/Throwable.<init>()V
   org/eclipse/jdt/core/dom/MethodDeclaration.setModifiers(I)V
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration;)
Lorg/eclipse/jdt/core/dom/MethodDeclaration;
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/TypeDeclaration;)
Lorg/eclipse/jdt/core/dom/TypeDeclaration;
   org/eclipse/jdt/core/dom/ASTConverter.convert
(Lorg/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration;[C)
Lorg/eclipse/jdt/core/dom/CompilationUnit;
   org/eclipse/jdt/core/dom/AST.parseCompilationUnit
(Lorg/eclipse/jdt/core/ICompilationUnit;Z)
Lorg/eclipse/jdt/core/dom/CompilationUnit;
   org/eclipse/jdt/internal/corext/dom/JavaElementMapper.perform
(Lorg/eclipse/jdt/core/IMember;Ljava/lang/Class;)
Lorg/eclipse/jdt/core/dom/ASTNode;
   
org/eclipse/jdt/internal/corext/refactoring/sef/SelfEncapsulateFieldRefactoring.
checkActivation(Lorg/eclipse/core/runtime/IProgressMonitor;)
Lorg/eclipse/jdt/internal/corext/refactoring/base/RefactoringStatus;
   org/eclipse/jdt/internal/ui/refactoring/actions/RefactoringStarter.activate
(Lorg/eclipse/jdt/internal/corext/refactoring/base/Refactoring;Lorg/eclipse/jdt/
internal/ui/refactoring/RefactoringWizard;Ljava/lang/String;Z)V
   
org/eclipse/jdt/internal/ui/refactoring/actions/SelfEncapsulateFieldAction.run()
V
   org/eclipse/jface/action/Action.runWithEvent(Lorg/eclipse/swt/widgets/Event;)
V
   org/eclipse/jface/action/ActionContributionItem.handleWidgetSelection
(Lorg/eclipse/swt/widgets/Event;)V
   org/eclipse/jface/action/ActionContributionItem.handleWidgetEvent
(Lorg/eclipse/swt/widgets/Event;)V
   org/eclipse/jface/action/ActionContributionItem.access$0
(Lorg/eclipse/jface/action/ActionContributionItem;Lorg/eclipse/swt/widgets/Event
;)V
   org/eclipse/jface/action/ActionContributionItem$ActionListener.handleEvent
(Lorg/eclipse/swt/widgets/Event;)V
   org/eclipse/swt/widgets/EventTable.sendEvent(Lorg/eclipse/swt/widgets/Event;)
V
   org/eclipse/swt/widgets/Widget.notifyListeners
(ILorg/eclipse/swt/widgets/Event;)V
   org/eclipse/swt/widgets/Display.runDeferredEvents()Z
   org/eclipse/swt/widgets/Display.readAndDispatch()Z
   org/eclipse/ui/internal/Workbench.runEventLoop()V
   org/eclipse/ui/internal/Workbench.run(Ljava/lang/Object;)Ljava/lang/Object;
   org/eclipse/core/internal/boot/InternalBootLoader.run
(Ljava/lang/String;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;)
Ljava/lang/Object;
   org/eclipse/core/boot/BootLoader.run
(Ljava/lang/String;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;)
Ljava/lang/Object;
   SlimLauncher.main([Ljava/lang/String;)V
Comment 1 Olivier Thomann CLA 2002-02-12 10:12:08 EST
I will fix it today. Hopefully I will be able to fix it for the build input.
Comment 2 Olivier Thomann CLA 2002-02-12 10:54:22 EST
Stupid bug. I forgot to remove the AccDeprecated flag from the modifiers stored 
on the method declaration. I propagated the fix for field declaration and type 
declaration.
Fixed and released in HEAD.