Community
Participate
Working Groups
When working with libraries which don't have source code attached, the parameter names are shown as arg0...arg(n). This is because the default parameter name strategy in JDT is to look and the variable name and parameter name. IMO we should not show arg0 arg1 since that doesn't give any value. So its better to remove them from showing up as parameter info mining.
@Gayan: I like your proposal. Maybe you could submit a patch for it. ParameterNamesCodeMiningTest is where you can write (and run) automated tests for it, and CalleeJavaMethodParameterVisitor.skipParameterNamesCodeMinings() is where you can add some extra conditions to skip parameters.
@Mickael i'm trying to write a test case for this scenario where the parameter info is not available. How could i achieve this ? Should i create a new test class with a new project setup base on a sample compiled class in the classpath which doesn't have parameter info and refer in the CU under testing ? Or do i have more better option to do this ?
(In reply to Gayan Perera from comment #2) > @Mickael i'm trying to write a test case for this scenario where the > parameter info is not available. How could i achieve this ? Should i create > a new test class with a new project setup base on a sample compiled class in > the classpath which doesn't have parameter info and refer in the CU under > testing ? Or do i have more better option to do this ? See ParameterNamesCodeMiningTest.testVarargs for a simple example. For this specific case, I suggest you just: 1. add a dummy class in org.eclipse.jdt.text.tests, in same package as the test code 2. In the test code, extract this class into a temporary folder (with the right hierarchy of parents folders/packages) 3. add this folder as a classpath entry to the test project 4. Then you should be able to reference the method from this type, without the source information and see the argN to finalize the test case.