mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUAC-1170: Fix unchecked cast warnings.
This commit is contained in:
@@ -112,7 +112,7 @@ public class GuacamoleSession {
|
||||
|
||||
// Add an instance of each class to the list
|
||||
if (listenerClasses != null) {
|
||||
for (Class listenerClass : listenerClasses) {
|
||||
for (Class<?> listenerClass : listenerClasses) {
|
||||
|
||||
// Instantiate listener
|
||||
Object listener = listenerClass.getConstructor().newInstance();
|
||||
|
@@ -55,11 +55,10 @@ public class TunnelModule extends ServletModule {
|
||||
try {
|
||||
|
||||
// Attempt to find WebSocket module
|
||||
Class<TunnelLoader> module = (Class<TunnelLoader>)
|
||||
GuacamoleClassLoader.getInstance().findClass(classname);
|
||||
Class<?> module = (Class<?>) GuacamoleClassLoader.getInstance().findClass(classname);
|
||||
|
||||
// Create loader
|
||||
TunnelLoader loader = module.getConstructor().newInstance();
|
||||
TunnelLoader loader = (TunnelLoader) module.getConstructor().newInstance();
|
||||
|
||||
// Install module, if supported
|
||||
if (loader.isSupported()) {
|
||||
|
@@ -79,7 +79,7 @@ public class LanguageRESTService {
|
||||
* filename.
|
||||
*/
|
||||
private static final Pattern LANGUAGE_KEY_PATTERN = Pattern.compile(".*/([a-z]+_[A-Z]+)\\.json");
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of all available language keys to their corresponding
|
||||
* human-readable names.
|
||||
@@ -104,7 +104,7 @@ public class LanguageRESTService {
|
||||
@Context ServletContext servletContext) throws GuacamoleException {
|
||||
|
||||
// Get the paths of all the translation files
|
||||
Set<String> resourcePaths = servletContext.getResourcePaths(TRANSLATION_PATH);
|
||||
Set<?> resourcePaths = servletContext.getResourcePaths(TRANSLATION_PATH);
|
||||
|
||||
// If no translation files found, return an empty map
|
||||
if (resourcePaths == null)
|
||||
@@ -113,7 +113,10 @@ public class LanguageRESTService {
|
||||
Map<String, String> languageMap = new HashMap<String, String>();
|
||||
|
||||
// Iterate through all the found language files and add them to the return map
|
||||
for (String resourcePath : resourcePaths) {
|
||||
for (Object resourcePathObject : resourcePaths) {
|
||||
|
||||
// Each resource path is guaranteed to be a string
|
||||
String resourcePath = (String) resourcePathObject;
|
||||
|
||||
// Get input stream for language file
|
||||
InputStream languageFileStream = servletContext.getResourceAsStream(resourcePath);
|
||||
|
Reference in New Issue
Block a user