Reverse C++ Code fails


#1

I often get the following error when I attempt to reverse several of my classes. I was able to reverse with v14.1 but after upgrading to v15, it fails.

Failed to reverse code

details:
java.lang.NullPointerException
at v.gz.b.a(:161)
at v.gh.a.a(:1375)
at v.gh.a.b(:1064)
at v.ha.b.b(:139)
at v.bye.d.run(:34)

This is pretty annoying. Any help would be appreciated.


#2

Hi,

It seems that your project contains some invalid relationships. Could you please test on a new project?


#3

The class compile and run correctly.

Is there an way to get more information on why i thinks there’s invalid relationships. Which relationship is it complaining about.

Like I mentioned, this was working with v14.1.


#4

Please show Model Explorer, check Show Relationships in the popup menu.
Can you find a generalization missing From element?
Screenshot

If you found it, please delete and recreate if necessary.


#5

I could not find the “Show Relationship” from the Model Explorer window. I had to select Window->Application Options->View->Show relationships.

After doing that , I could see many relationships in the Model Explorer, but none matched the generalizations that you specified. Here are a few things that I tried as a test, but did not fix the reverse c++ code issue:

  1. delete all the classes accept the class that is failing. No faulty generalizations was present.
  2. delete all the operations/attributes of my class. No faulty generalizations was present.

At this point I only had 1 class with no operations/attributes. Then I deleted all my UML diagrams… this caused the faulty generalizations to suddenly appear in the Model Explorer.

So it seems that a faulty generalization does exist, but it is not visible unless I delete a lot of stuff. Obviously, that’s not want I want. So I continued trying other ways to make it appear, and I think I found one. In essence, if I launch an Analysis of my class then that action will produce a diagram with lots of classes in it. If I then simply delete that diagram, the faulty generalization will appear.

If I delete the faulty generalizations then I can run the Reverse c++ code with any failures for my class.

I can’t say if my steps will work in all causes yet since I only tried with 1 class so far.


#6

Can you locate the “to” end of the generalization? i.e. Class2 in my example.
Then you can open specification of that class, show Relations tab and delete the generalization.