cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

How to find Deprecated API ?

vlmadala
9-Granite

How to find Deprecated API ?

Is there a way I can find all the Deprecated API in Windchill 11 & Windchill 12 Programmatically ?

8 REPLIES 8
avillanueva
22-Sapphire I
(To:vlmadala)

Typically an IDE like Eclipse and Netbeans will note when you've used a deprecated API with some warning or indicator. Not every class/method is documented in the Windchill JavaDoc but there are some notes there too. 

avillanueva_0-1663859492093.png

 

Yes .That's right . However, when the codebase is larger, going through it to identify the deprecations needs some time. If any utility that will scan the code and generate a report comparing to the required  target , will be helpful .

Hi @vlmadala 

Why? Many Windchill classes are marked as deprecated for ages but they are still there. From version 9 to 12.

PetrH.   

@HelesicPetr  Windchill 12 has removed all the deprecated classed that were in use till WIndchill 11

 

Hi @vlmadala 

I don´t think so  May be some of them not all. 

PetrH

I am trying to identify the occurrences that should give me a report or a count of the deprecated API . That will help me to feed to the Utility and suggest the appropriate solutions reading the method signature , Parameters or alternate API suggested by PTC.  However , this is a tricky case to judge how to use the alternate solution , That's a later part .

 

Is this achieable? 

@vlmadala 

I understand what you are trying to do. I cares about the deprecated classes only if it is necessary.

 

In my case the IntelijIdea has an analyze function (Run Inspection by Name) which can find what you need all deprecated usage.

 

I guess that other IDEs has something similar

 

PetrH

 

I google search pointed this this solution, https://www.sonarsource.com/, which appears to offer tools for scanning and identifying deprecated code. Knowing all the deprecated code in the API may not be all that helpful. As I code, I follow examples of others and sometimes guess at what APIs might be needed. If Eclipse identifies some deprecated methods, which you can have it warn on compile for, I make a note that there should be a newer method I should be using. That does not mean it will not work. This is a process that should be followed with each version change. Like you mentioned, PTC will remove them at version changes. You will then get a compiler failure that you need to fix. I am going through that process now porting my 11 code to 12. Knowing all deprecated code tells me what not to use, not what to use, which is more important. 

Top Tags