6 comments
Comment actions Permalink

Hi Ole

Your idea and how you have coded the plugin is great. The setup in xml-files and types can inherit preconditions is great.

However I found some problems.

I have this simple method


If I set preconditons for both variables using the dialog I get the Exception:

0
Comment actions Permalink

thanks for your report... I'll look at it (and fix it hopefully) tonight..

regards

/Ole



"Claus Ibsen" <cib_rejse@yahoo.dk> wrote in message
news:5651042.1038323074544.JavaMail.jrun@is.intellij.net...

Hi Ole

>

Your idea and how you have coded the plugin is great. The setup in

xml-files and types can inherit preconditions is great.
>

However I found some problems.

>

I have this simple method

>

    ...
> }]]>

>

If I set preconditons for both variables using the dialog I get the

Exception:
>

[ 283844] ERROR - mand.impl.CommandProcessorImpl - IntelliJ IDEA 3.0 Build #682 > [ 283844] ERROR - mand.impl.CommandProcessorImpl - JDK: 1.4.1_01 > [ 283844] ERROR - mand.impl.CommandProcessorImpl - VM: Java HotSpot(TM) Client VM > [ 283844] ERROR - mand.impl.CommandProcessorImpl - Vendor: Sun Microsystems Inc. > [ 283844] ERROR - mand.impl.CommandProcessorImpl - OS: Windows NT > [ 283860] ERROR - mand.impl.CommandProcessorImpl - Last Action: Actions.PreconditionPlugin.CreatePreconditions > [ 283860] ERROR - mand.impl.CommandProcessorImpl - Current Command: Create Preconditon > [ 283860] ERROR - mand.impl.CommandProcessorImpl - > java.lang.IllegalArgumentException > at com.intellij.psi.a.b.i.addBefore(i.java:243) > at com.eviware.plugins.precondition.controller.CreatePreconditionAction$Handler .createAssertions(Unknown Source) > at com.eviware.plugins.precondition.controller.CreatePreconditionAction$Handler .executeWriteAction(Unknown Source) > at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(Edit orWriteActionHandler.java:2) > at com.intellij.openapi.application.a.e.runWriteAction(e.java:74) > at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.execute(Ed itorWriteActionHandler.java:4) > at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.jav a:2) > at com.intellij.openapi.command.b.b.executeCommand(b.java:19) > at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(Editor Action.java:10) > at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(Editor Action.java:11) > at com.intellij.openapi.a.a.e.a(e.java:54) > at com.intellij.openapi.a.a.e.b(e.java:55) > at com.intellij.openapi.a.a.e.a(e.java:29) > at com.intellij.ide.q.dispatchEvent(q.java:11) > at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) > at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) > at java.awt.EventDispatchThread.pumpEvents(Unknown Source) > at java.awt.EventDispatchThread.pumpEvents(Unknown Source) > at java.awt.EventDispatchThread.run(Unknown Source)]]>




0
Comment actions Permalink

Hi Ole

Another problem

I have the same method

 0 : "Argument name in method DummyBean.doit must not be empty";

    }]]>


Where I already have a precondition for the name variable. Now I add a precondition for the age varaible and I select lager than 0. I get the wrong code below

 0 : "Argument name in method DummyBean.doit must not be empty";]]>


It uses the wrong variable name, as it uses the name variable and not the age variable.


Another minor issue is that if your method is empty and you add a precondition the caret is moved to the end of the method, right before the last }. However if there is some code in the method the caret is correctly moved to the next line.

0
Comment actions Permalink

And why is it possible to select

>]]>

at "select method" in the dialog?

0
Comment actions Permalink

Hi!

This option should be selected by default if the caret is not within any
method..

regards!

/Ole


"Claus Ibsen" <cib_rejse@yahoo.dk> wrote in message
news:2353611.1038323519578.JavaMail.jrun@is.intellij.net...

And why is it possible to select

>

<<none selected>>

>

at "select method" in the dialog?

>
>


0
Comment actions Permalink

Thanks again.. gonna be a long (and rewarding) night..

:)

/Ole


"Claus Ibsen" <cib_rejse@yahoo.dk> wrote in message
news:4573036.1038323366206.JavaMail.jrun@is.intellij.net...

Hi Ole

>

Another problem

>

I have the same method

>

         assert name != null && name.trim().length() > 0 : "Argument name
in method DummyBean.doit must not be empty";
>
>     }]]>

>

Where I already have a precondition for the name variable. Now I add a

precondition for the age varaible and I select lager than 0. I get the wrong
code below
>

 0 : "Argument
name in method DummyBean.doit must not be empty";]]>

>

It uses the wrong variable name, as it uses the name variable and

not the age variable.
>
>

Another minor issue is that if your method is empty and you add a

precondition the caret is moved to the end of the method, right before the
last }. However if there is some code in the method the caret is correctly
moved to the next line.


0

Please sign in to leave a comment.