@@ -99,22 +99,22 @@ public DependencyInfo(String key, String value) {
9999 }
100100
101101 /**
102- * Error reasons for ImportClassContent operation
102+ * Empty reasons for ImportClassContent operation
103103 */
104104 public enum ImportClassContentErrorReason {
105- NULL_ARGUMENTS ("Arguments null or empty " ),
106- INVALID_URI ("URI invalid or empty " ),
107- URI_PARSE_FAILED ("URI parse failed " ),
108- FILE_NOT_FOUND ("File not found " ),
109- FILE_NOT_EXISTS ("File does not exist " ),
110- NOT_JAVA_PROJECT ("Not in Java project " ),
111- PROJECT_NOT_EXISTS ("Java project not exists " ),
112- NOT_COMPILATION_UNIT ("Not Java compilation unit " ),
113- NO_IMPORTS ("No import declarations " ),
114- OPERATION_CANCELLED ("Operation cancelled " ),
115- TIME_LIMIT_EXCEEDED ("Time limit exceeded " ),
116- NO_RESULTS ("No classes resolved " ),
117- PROCESSING_EXCEPTION ("Processing exception " );
105+ NULL_ARGUMENTS ("NullArgs " ),
106+ INVALID_URI ("InvalidUri " ),
107+ URI_PARSE_FAILED ("UriParseFail " ),
108+ FILE_NOT_FOUND ("FileNotFound " ),
109+ FILE_NOT_EXISTS ("FileNotExists " ),
110+ NOT_JAVA_PROJECT ("NotJavaProject " ),
111+ PROJECT_NOT_EXISTS ("ProjectNotExists " ),
112+ NOT_COMPILATION_UNIT ("NotCompilationUnit " ),
113+ NO_IMPORTS ("NoImports " ),
114+ OPERATION_CANCELLED ("Cancelled " ),
115+ TIME_LIMIT_EXCEEDED ("Timeout " ),
116+ NO_RESULTS ("NoResults " ),
117+ PROCESSING_EXCEPTION ("ProcessingError " );
118118
119119 private final String message ;
120120
@@ -128,17 +128,17 @@ public String getMessage() {
128128 }
129129
130130 /**
131- * Error reasons for ProjectDependencies operation
131+ * Empty reasons for ProjectDependencies operation
132132 */
133133 public enum ProjectDependenciesErrorReason {
134- NULL_ARGUMENTS ("Arguments null or empty " ),
135- INVALID_URI ("URI invalid or empty " ),
136- URI_PARSE_FAILED ("URI parse failed " ),
137- MALFORMED_URI ("Malformed URI syntax " ),
138- OPERATION_CANCELLED ("Operation cancelled " ),
139- RESOLVER_NULL_RESULT ("Resolver returned null " ),
140- NO_DEPENDENCIES ("No dependencies resolved " ),
141- PROCESSING_EXCEPTION ("Processing exception " );
134+ NULL_ARGUMENTS ("NullArgs " ),
135+ INVALID_URI ("InvalidUri " ),
136+ URI_PARSE_FAILED ("UriParseFail " ),
137+ MALFORMED_URI ("MalformedUri " ),
138+ OPERATION_CANCELLED ("Cancelled " ),
139+ RESOLVER_NULL_RESULT ("ResolverNull " ),
140+ NO_DEPENDENCIES ("NoDependencies " ),
141+ PROCESSING_EXCEPTION ("ProcessingError " );
142142
143143 private final String message ;
144144
@@ -156,19 +156,19 @@ public String getMessage() {
156156 */
157157 public static class ImportClassContentResult {
158158 public List <ImportClassInfo > classInfoList ;
159- public String errorReason ; // Use String for JSON serialization compatibility
160- public boolean hasError ;
159+ public String emptyReason ; // Reason why the result is empty
160+ public boolean isEmpty ;
161161
162162 public ImportClassContentResult (List <ImportClassInfo > classInfoList ) {
163163 this .classInfoList = classInfoList ;
164- this .errorReason = null ;
165- this .hasError = false ;
164+ this .emptyReason = null ;
165+ this .isEmpty = false ;
166166 }
167167
168168 public ImportClassContentResult (ImportClassContentErrorReason errorReason ) {
169169 this .classInfoList = Collections .emptyList ();
170- this .errorReason = errorReason .getMessage (); // Use enum message
171- this .hasError = true ;
170+ this .emptyReason = errorReason .getMessage (); // Use enum message
171+ this .isEmpty = true ;
172172 }
173173 }
174174
@@ -177,19 +177,19 @@ public ImportClassContentResult(ImportClassContentErrorReason errorReason) {
177177 */
178178 public static class ProjectDependenciesResult {
179179 public List <DependencyInfo > dependencyInfoList ;
180- public String errorReason ; // Use String for JSON serialization compatibility
181- public boolean hasError ;
180+ public String emptyReason ; // Reason why the result is empty
181+ public boolean isEmpty ;
182182
183183 public ProjectDependenciesResult (List <DependencyInfo > dependencyInfoList ) {
184184 this .dependencyInfoList = dependencyInfoList ;
185- this .errorReason = null ;
186- this .hasError = false ;
185+ this .emptyReason = null ;
186+ this .isEmpty = false ;
187187 }
188188
189189 public ProjectDependenciesResult (ProjectDependenciesErrorReason errorReason ) {
190190 this .dependencyInfoList = new ArrayList <>();
191- this .errorReason = errorReason .getMessage (); // Use enum message
192- this .hasError = true ;
191+ this .emptyReason = errorReason .getMessage (); // Use enum message
192+ this .isEmpty = true ;
193193 }
194194 }
195195
@@ -445,23 +445,6 @@ public static boolean checkImportStatus() {
445445 return hasError ;
446446 }
447447
448- /**
449- * Get import class content for Copilot integration (backward compatibility wrapper).
450- * This method maintains compatibility with the original return type.
451- *
452- * @param arguments List containing the file URI as the first element
453- * @param monitor Progress monitor for cancellation support
454- * @return List of ImportClassInfo containing class information and JavaDoc
455- */
456- public static List <ImportClassInfo > getImportClassContent (List <Object > arguments , IProgressMonitor monitor ) {
457- ImportClassContentResult result = getImportClassContentWithReason (arguments , monitor );
458- if (result .hasError ) {
459- // Log the error reason for debugging
460- JdtlsExtActivator .logError ("getImportClassContent failed: " + result .errorReason );
461- }
462- return result .classInfoList ;
463- }
464-
465448 /**
466449 * Get import class content for Copilot integration with detailed error reporting.
467450 * This method extracts information about imported classes from a Java file.
@@ -471,7 +454,7 @@ public static List<ImportClassInfo> getImportClassContent(List<Object> arguments
471454 * @param monitor Progress monitor for cancellation support
472455 * @return ImportClassContentResult containing class information and error reason if applicable
473456 */
474- public static ImportClassContentResult getImportClassContentWithReason (List <Object > arguments , IProgressMonitor monitor ) {
457+ public static ImportClassContentResult getImportClassContent (List <Object > arguments , IProgressMonitor monitor ) {
475458 if (arguments == null || arguments .isEmpty ()) {
476459 return new ImportClassContentResult (ImportClassContentErrorReason .NULL_ARGUMENTS );
477460 }
0 commit comments