Bug 107012 - Move refactoring caused Exception
Summary: Move refactoring caused Exception
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-08-15 09:04 EDT by Oyvind Harboe CLA
Modified: 2009-08-30 02:06 EDT (History)
0 users

See Also:


Attachments
Shows exception in debugger (236.04 KB, image/pjpeg)
2005-08-16 03:46 EDT, Oyvind Harboe CLA
no flags Details
A shot in the dark (243.17 KB, image/jpeg)
2005-08-22 03:12 EDT, Oyvind Harboe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oyvind Harboe CLA 2005-08-15 09:04:43 EDT
I selected a private method that I wanted to move to another class and got this
exception when clicking preview:


java.lang.reflect.InvocationTargetException
	at
org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:90)
	at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: Java Model Exception: Java Model Status [setProductPrice(BigDecimal)
{key=Lno/ecc/gds/data/auto/_GdsProductPrice;.setProductPrice(Ljava/math/BigDecimal;)V}
[in _GdsProductPrice [in _GdsProductPrice.java [in no.ecc.gds.data.auto [in src
[in gds]]]]] does not exist]
	at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:468)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:499)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:232)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:218)
	at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:147)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.adjustOutgoingVisibility(MemberVisibilityAdjustor.java:688)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.adjustOutgoingVisibility(MemberVisibilityAdjustor.java:707)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.adjustOutgoingVisibility(MemberVisibilityAdjustor.java:739)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.adjustVisibility(MemberVisibilityAdjustor.java:780)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createChangeManager(MoveInstanceMethodProcessor.java:1529)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.checkFinalConditions(MoveInstanceMethodProcessor.java:1097)
	at
org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:169)
	at
org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:84)
	at
org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:114)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1719)
	at
org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86)
	... 1 more
Comment 1 Oyvind Harboe CLA 2005-08-15 09:05:36 EDT
If I do not click Preview, but OK directly, I get this exception:


Java Model Exception: Java Model Status [setProductPrice(BigDecimal)
{key=Lno/ecc/gds/data/auto/_GdsProductPrice;.setProductPrice(Ljava/math/BigDecimal;)V}
[in _GdsProductPrice [in _GdsProductPrice.java [in no.ecc.gds.data.auto [in src
[in gds]]]]] does not exist]
	at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:468)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:499)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:232)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:218)
	at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:147)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.adjustOutgoingVisibility(MemberVisibilityAdjustor.java:688)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.adjustOutgoingVisibility(MemberVisibilityAdjustor.java:707)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.adjustOutgoingVisibility(MemberVisibilityAdjustor.java:739)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.adjustVisibility(MemberVisibilityAdjustor.java:780)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.createChangeManager(MoveInstanceMethodProcessor.java:1529)
	at
org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor.checkFinalConditions(MoveInstanceMethodProcessor.java:1097)
	at
org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:169)
	at
org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:84)
	at
org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:114)
	at
org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:189)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1719)
	at
org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86)
	at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Comment 2 Frederic Fusier CLA 2005-08-15 11:09:56 EDT
Please provide build ID and a test case to reproduce, thx
Comment 3 Oyvind Harboe CLA 2005-08-15 11:16:23 EDT
(In reply to comment #2)
> Please provide build ID and a test case to reproduce, thx

This was with 3.1 release version.

The code is my client's, so I'm not at liberty to pass it along.

Feel free to close this PR as impossible to pursue if you can't immediately
extract something useful from the exceptions.

Øyvind
Comment 4 Frederic Fusier CLA 2005-08-15 11:28:20 EDT
I understand that your code might be private...
Can't you create a similar test case which reproduces the problem and put it in
this bug?
TIA
Comment 5 Oyvind Harboe CLA 2005-08-15 11:38:12 EDT
(In reply to comment #4)
> I understand that your code might be private...
> Can't you create a similar test case which reproduces the problem and put it in
> this bug?

The Move refactoring code is quite mature + the program I'm working on is large.
I believe it unlikely to be easy to produce a small test case. I've used the
Move refactoring a dozen times the last week on cases which appear to be fairly
similar(different projects though).

I will see if I can make it happen again and try to squeeze some info out of the
debugger.


> TIA

Comment 6 Oyvind Harboe CLA 2005-08-16 03:46:06 EDT
Created attachment 26139 [details]
Shows exception in debugger

I can reproduce the problem here.

I tried to get some info out of the debugger, but found nothing obvious so far.
Comment 7 Oyvind Harboe CLA 2005-08-16 03:47:48 EDT
I tried opening the source file in which setProductPrice is implemented, but I 
still get the exception.

Comment 8 Jerome Lanneluc CLA 2005-08-17 04:44:14 EDT
(In reply to comment #3)
> Feel free to close this PR as impossible to pursue if you can't immediately
> extract something useful from the exceptions.

Unfortunately the stack traces are not enough to find out what's wrong. 
Please reopen if you can find steps to reproduce.
Comment 9 Oyvind Harboe CLA 2005-08-17 07:10:28 EDT
(In reply to comment #8)
> (In reply to comment #3)
> > Feel free to close this PR as impossible to pursue if you can't immediately
> > extract something useful from the exceptions.
> 
> Unfortunately the stack traces are not enough to find out what's wrong. 
> Please reopen if you can find steps to reproduce.

I can reproduce it on my machine. Can you give me some tips on where and how to
debug?

Øyvind




Comment 10 Jerome Lanneluc CLA 2005-08-17 09:01:36 EDT
(In reply to comment #9)
> I can reproduce it on my machine. Can you give me some tips on where and how to
> debug?

Can you please evaluate the following in the Display view of the debugger when
the top stack frame is selected ?

  this.getOpenable().getBuffer().getContents()

and check if the method "setProductPrice(BigDecimal)" exists in the class
"_GdsProductPrice" in this source.
Comment 11 Oyvind Harboe CLA 2005-08-22 02:56:17 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > I can reproduce it on my machine. Can you give me some tips on where and 
how to
> > debug?
> Can you please evaluate the following in the Display view of the debugger when
> the top stack frame is selected ?
>   this.getOpenable().getBuffer().getContents()
> and check if the method "setProductPrice(BigDecimal)" exists in the class
> "_GdsProductPrice" in this source.

Yes:

package no.ecc.gds.data.auto;

/** Class _GdsProductPrice was generated by Cayenne.
  * It is probably a good idea to avoid changing this class manually, 
  * since it may be overwritten next time code is regenerated. 
  * If you need to make any customizations, please use subclass. 
  */
public class _GdsProductPrice extends org.objectstyle.cayenne.CayenneDataObject 
{

    public static final String PRODUCT_PRICE_PROPERTY = "productPrice";
    public static final String PRODUCT_PROPERTY = "product";
    public static final String SUBSCRIPTION_TYPE_PROPERTY = "subscriptionType";

    public static final String PRODUCT_ID_PK_COLUMN = "PRODUCT_ID";
    public static final String SUBSCRIPTION_TYPE_PK_COLUMN 
= "SUBSCRIPTION_TYPE";

    public void setProductPrice(java.math.BigDecimal productPrice) {
        writeProperty("productPrice", productPrice);
    }
    public java.math.BigDecimal getProductPrice() {
        return (java.math.BigDecimal)readProperty("productPrice");
    }
    
    
    public void setProduct(no.ecc.gds.data.GdsProduct product) {
        setToOneTarget("product", product, true);
    }

    public no.ecc.gds.data.GdsProduct getProduct() {
        return (no.ecc.gds.data.GdsProduct)readProperty("product");
    } 
    
    
    public void setSubscriptionType(no.ecc.gds.data.GdsSubscriptionType 
subscriptionType) {
        setToOneTarget("subscriptionType", subscriptionType, true);
    }

    public no.ecc.gds.data.GdsSubscriptionType getSubscriptionType() {
        return (no.ecc.gds.data.GdsSubscriptionType)readProperty
("subscriptionType");
    } 
    
    
}
Comment 12 Oyvind Harboe CLA 2005-08-22 03:12:56 EDT
Created attachment 26335 [details]
A shot in the dark
Comment 13 Denis Roy CLA 2009-08-30 02:06:25 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.