Skip to content

Commit 940c352

Browse files
committed
Fix warnings in I-build
``` Type String[] of the last argument to method format(String, Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation. ``` as can be seen at https://download.eclipse.org/eclipse/downloads/drops4/I20230917-1800/compilelogs/plugins/org.eclipse.search.core_3.16.0.v20230913-0751/@dot.html#OTHER_WARNINGS
1 parent 21aa625 commit 940c352

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bundles/org.eclipse.search.core/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,22 +240,22 @@ public IStatus processFile(List<IFile> sameFiles, IProgressMonitor monitor) {
240240
}
241241
}
242242
} catch (UnsupportedCharsetException e) {
243-
String[] args= { getCharSetName(file), file.getFullPath().makeRelative().toString()};
243+
Object[] args= { getCharSetName(file), file.getFullPath().makeRelative().toString()};
244244
String message = MessageFormat.format(SearchCoreMessages.TextSearchVisitor_unsupportedcharset, args);
245245
return new Status(IStatus.ERROR, SearchCorePlugin.PLUGIN_ID, IStatus.ERROR, message, e);
246246
} catch (IllegalCharsetNameException e) {
247-
String[] args= { getCharSetName(file), file.getFullPath().makeRelative().toString()};
247+
Object[] args= { getCharSetName(file), file.getFullPath().makeRelative().toString()};
248248
String message = MessageFormat.format(SearchCoreMessages.TextSearchVisitor_illegalcharset, args);
249249
return new Status(IStatus.ERROR, SearchCorePlugin.PLUGIN_ID, IStatus.ERROR, message, e);
250250
} catch (IOException e) {
251-
String[] args= { getExceptionMessage(e), file.getFullPath().makeRelative().toString()};
251+
Object[] args= { getExceptionMessage(e), file.getFullPath().makeRelative().toString()};
252252
String message = MessageFormat.format(SearchCoreMessages.TextSearchVisitor_error, args);
253253
return new Status(IStatus.ERROR, SearchCorePlugin.PLUGIN_ID, IStatus.ERROR, message, e);
254254
} catch (CoreException e) {
255255
if (fIsLightweightAutoRefresh && IResourceStatus.RESOURCE_NOT_FOUND == e.getStatus().getCode()) {
256256
return monitor.isCanceled() ? Status.CANCEL_STATUS : Status.OK_STATUS;
257257
}
258-
String[] args= { getExceptionMessage(e), file.getFullPath().makeRelative().toString() };
258+
Object[] args= { getExceptionMessage(e), file.getFullPath().makeRelative().toString() };
259259
String message = MessageFormat.format(SearchCoreMessages.TextSearchVisitor_error, args);
260260
return new Status(IStatus.ERROR, SearchCorePlugin.PLUGIN_ID, IStatus.ERROR, message, e);
261261
} catch (StackOverflowError e) {

0 commit comments

Comments
 (0)