mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	CLOUDSTACK-6752: IAM command class separation caused ApiDoc warning of
duplicated cmd class for the same api name.
This commit is contained in:
		
							parent
							
								
									e4e8931389
								
							
						
					
					
						commit
						faa379b6c2
					
				| @ -105,11 +105,22 @@ public class ApiXmlDocWriter { | |||||||
|         for (Class<?> cmdClass : cmdClasses) { |         for (Class<?> cmdClass : cmdClasses) { | ||||||
|             String apiName = cmdClass.getAnnotation(APICommand.class).name(); |             String apiName = cmdClass.getAnnotation(APICommand.class).name(); | ||||||
|             if (s_apiNameCmdClassMap.containsKey(apiName)) { |             if (s_apiNameCmdClassMap.containsKey(apiName)) { | ||||||
|                 System.out.println("Warning, API Cmd class " + cmdClass.getName() + " has non-unique apiname" + apiName); |                 // handle API cmd separation into admin cmd and user cmd with the common api name | ||||||
|  |                 Class<?> curCmd = s_apiNameCmdClassMap.get(apiName); | ||||||
|  |                 if (curCmd.isAssignableFrom(cmdClass)) { | ||||||
|  |                     // api_cmd map always keep the admin cmd class to get full response and parameters | ||||||
|  |                     s_apiNameCmdClassMap.put(apiName, cmdClass); | ||||||
|  |                 } else if (cmdClass.isAssignableFrom(curCmd)) { | ||||||
|  |                     // just skip this one without warning | ||||||
|  |                     continue; | ||||||
|  |                 } else { | ||||||
|  |                     System.out.println("Warning, API Cmd class " + cmdClass.getName() + " has non-unique apiname " + apiName); | ||||||
|                     continue; |                     continue; | ||||||
|                 } |                 } | ||||||
|  |             } else { | ||||||
|                 s_apiNameCmdClassMap.put(apiName, cmdClass); |                 s_apiNameCmdClassMap.put(apiName, cmdClass); | ||||||
|             } |             } | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         LinkedProperties preProcessedCommands = new LinkedProperties(); |         LinkedProperties preProcessedCommands = new LinkedProperties(); | ||||||
|         String[] fileNames = null; |         String[] fileNames = null; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user