private String[] getStringProperty(String name, Object value) { // Don't log a warning if the value is null. The filter guarantees at least one of the necessary // properties // is there. If others are not, this method will get called with value equal to null. if (value == null) return new String[0]; if (value instanceof String) { return new String[] {(String) value}; } if (value instanceof String[]) { return (String[]) value; } Exception e = null; if (value instanceof Collection) { @SuppressWarnings("unchecked") Collection<String> temp = (Collection<String>) value; try { return temp.toArray(new String[temp.size()]); } catch (ArrayStoreException ase) { e = ase; } } log.log( LogService.LOG_WARNING, NLS.bind( MetaTypeMsg.INVALID_PID_METATYPE_PROVIDER_IGNORED, new Object[] {_bundle.getSymbolicName(), _bundle.getBundleId(), name, value}), e); return new String[0]; }