iwangjie opened a new issue, #4407:
URL: https://github.com/apache/shenyu/issues/4407

   ### Is there an existing issue for this?
   
   - [X] I have searched the existing issues
   
   ### Current Behavior
   
   It usually occurs when switching branches
   
   Name for argument of type [java.lang.String] not specified, and parameter 
name information not found in class file either.
   
   
![image](https://user-images.githubusercontent.com/23075587/221347770-17c3ebd6-735b-4978-9a5f-ef1c6d1b3819.png)
   
   This error is usually caused by the compiler's inability to find parameter 
name information in the code, which may affect the IDE's automatic code 
generation and refactoring capabilities, but usually does not affect the 
runtime behavior of the code. 
    
   This error may occur in the IDE or build tool you are using, such as 
Eclipse, IntelliJ IDEA, Maven, and so on. Typically, the IDE will try to 
determine the name of a method parameter by reading the parameter name 
information in a Java class file, but in some cases the information may be 
missing or inaccurate, resulting in the IDE not parsing the code properly. 
   
   
   eg:
   
   ```
   public void myMethod(@ParameterName("myParam") String myParam) {
       // ...
   }
   
   ```
   
   
   ### Expected Behavior
   
   success
   
   ### Steps To Reproduce
   
   non
   
   ### Environment
   
   ```markdown
   ShenYu version(s): 2.5.1
   ```
   
   
   ### Debug logs
   
   _No response_
   
   ### Anything else?
   
   
   The fix is simple, a misunderstanding later submitted PR:
   Use the-parameters compiler option to generate parameter name information in 
the class file. For example, when building with Maven, add the following 
configuration to pom. exe. In the XML file:
   
   ```
   <build>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                   <source>1.8</source>
                   <target>1.8</target>
                   <compilerArgs>
                       <arg>-parameters</arg>
                   </compilerArgs>
               </configuration>
           </plugin>
       </plugins>
   </build>
   
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to