Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321494 - Assert label != null in ActivityStack.getUndoLabel
Summary: Assert label != null in ActivityStack.getUndoLabel
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 2.6.2   Edit
Assignee: Dazheng Gao CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard: Obsolete
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-02 07:29 EDT by Vladimír Hájek CLA
Modified: 2010-10-21 02:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimír Hájek CLA 2010-08-02 07:29:08 EDT
Build Identifier: 20100617-1415

Commands implemented in org.eclipse.birt.report.designer.core.commands (e.g. DeleteCommand, SetPropertyCommand, ...) doesn't have set command label. In method ActivityStack.getUndoLabel is assert label != null.

Workaround:

public class MyCommandStack extends WrapperCommandStack {
   public MyCommandStack(org.eclipse.birt.report.model.api.CommandStack ar) {
      super(ar);
   }
   public void execute(Command command) {
      // Prevents command assertion in ActivityStack
      if (command != null && command.getLabel() == null)
         command.setLabel("");
      super.execute(command);
   }
}

In subclass of GraphicalEditor (e.g. ReportEditorWithRuler) implement method:

protected void configureGraphicalViewer() {
   ...
   ModuleHandle model = getModel();
   CommandStack modelCommandStack = model==null?null:model.getCommandStack();
   MyCommandStack myCommandStack = new MyCommandStack(modelCommandStack);
   getGraphicalViewer().getEditDomain().setCommandStack(myCommandStack);
   ...
}

Reproducible: Always

Steps to Reproduce:
1. Open new report design BIRT Report Designer.
2. Insert label into report and write some text into label.
3. End label editing with <Enter> or mouse click outside label.
4. Assert label != null in ActivityStack.getUndoLabel

If view Property Editor is shown, assertion happens every time.
Comment 1 Dazheng Gao CLA 2010-10-18 22:18:40 EDT
Fixed.
Comment 2 Xiaoying Gu CLA 2010-10-21 02:13:54 EDT
Verified in daily build 2.6.2.v20101021-0630