Community
Participate
Working Groups
I would like to have a simpler way to update existing projects regarding support of latest apis. On the one hand we have there quick fixes that do a lot of work. On the other hand it might be useful to have a dedicated search page where one can find easily deprecated and not deprecated uses of legacy apis. Of course there is no chance to provide something like this for every api in the java world but for eclipse itself and some third party libraries with strong coupling to eclipse (like junit 3/4/5) it could be possible. Even if it is half complete it could be of use. I provided a sample implementation at https://git.eclipse.org/r/#/c/160634/. There you have a datastructure like this: private static final String[] JUNIT3CLASSES= { "junit.framework.TestCase", //$NON-NLS-1$ "junit.framework.TestSuite" //$NON-NLS-1$ }; private static final String[] JFACELEGACY= { "org.eclipse.jface.text.contentassist.BoldStylerProvider", //$NON-NLS-1$ "org.eclipse.jface.text.templates.ContextTypeRegistry" //$NON-NLS-1$ }; private static final String[] ECPLIPSECORELEGACY= { "org.eclipse.core.runtime.SubProgressMonitor" //$NON-NLS-1$ }; private static final String[] GENERICDEPRECATED= { "java.lang.Deprecated" //$NON-NLS-1$ }; public enum Legacy { JUNIT3(Stream.of(JUNIT3CLASSES).collect(Collectors.toSet())), JFACE(Stream.of(JFACELEGACY).collect(Collectors.toSet())), ECLIPSECORE(Stream.of(ECPLIPSECORELEGACY).collect(Collectors.toSet())), DEPRECATED(Stream.of(GENERICDEPRECATED).collect(Collectors.toSet())); So you can easily add additional classes to be searched for in your projects even without deeper knowledge of the api.
I changed the code slightly to have everything in a properties file like this: # # junit classes based on junit 3 # junit.framework.TestCase=JUNIT3CLASSES junit.framework.TestSuite=JUNIT3CLASSES # # jface classes that should not be used any longer # org.eclipse.jface.text.contentassist.BoldStylerProvider=JFACELEGACY org.eclipse.jface.text.templates.ContextTypeRegistry=JFACELEGACY # # eclipse core classes that should no longer be used # org.eclipse.core.runtime.SubProgressMonitor=ECPLIPSECORELEGACY # # references to @deprecated # java.lang.Deprecated=GENERICDEPRECATED # # javas own deprecated classes # org.xml.sax.AttributeList=JAVA java.util.Vector=JAVA java.util.Stack=JAVA java.lang.StringBuffer=JAVA # # icu classes # com.ibm.icu.util.Calendar=ICU com.ibm.icu.text.BreakIterator=ICU com.ibm.icu.text.Collator=ICU com.ibm.icu.text.DateFormat=ICU com.ibm.icu.text.MessageFormat=ICU com.ibm.icu.text.SimpleDateFormat=ICU So you can select "ICU" and it searches for all listed classes.