Merge "Issue #1441 Break net.dods dependency on AWIPS code" into development
Former-commit-id:a40a0fc79b
[formerly5a861267aa
] [formerly7d67bd5949
] [formerlya40a0fc79b
[formerly5a861267aa
] [formerly7d67bd5949
] [formerlyd5fcc68163
[formerly7d67bd5949
[formerly 45b7e01839ef90c8623c3c5b8f2c873997e90111]]]] Former-commit-id:d5fcc68163
Former-commit-id:2c21da07a8
[formerly048606bae5
] [formerly e3e253eb0720cac3fa541b01c0f9dc5674f3e281 [formerlyc6609e8ea8
]] Former-commit-id: 7c94f035431882eabb9784a429774a125d4d528d [formerlyf1161422d7
] Former-commit-id:c1988cbf3f
This commit is contained in:
commit
bb444602ec
2 changed files with 17 additions and 5 deletions
|
@ -7,8 +7,7 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.eclipse.core.runtime,
|
||||
javax.servlet;bundle-version="2.5.0",
|
||||
org.apache.http;bundle-version="4.1.2",
|
||||
org.junit,
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174"
|
||||
org.junit
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ClassPath: gnu-getopt-1.0.6.jar,
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.net.URL;
|
|||
import java.util.zip.InflaterInputStream;
|
||||
|
||||
import com.raytheon.dods.HttpConnectStrategy;
|
||||
import com.raytheon.uf.common.util.ReflectionUtil;
|
||||
|
||||
import dods.dap.parser.ParseException;
|
||||
|
||||
|
@ -147,8 +146,8 @@ public class DConnect {
|
|||
*/
|
||||
public DConnect(String urlString, String proxyHost, String proxyPort,
|
||||
boolean acceptDeflate) throws FileNotFoundException {
|
||||
this(urlString, proxyHost, proxyPort, acceptDeflate, ReflectionUtil
|
||||
.newInstanceOfAssignableType(HttpConnectStrategy.class,
|
||||
this(urlString, proxyHost, proxyPort, acceptDeflate,
|
||||
newInstanceOfAssignableType(HttpConnectStrategy.class,
|
||||
HTTP_CONNECT_STRATEGY));
|
||||
}
|
||||
|
||||
|
@ -769,4 +768,18 @@ public class DConnect {
|
|||
|
||||
return dds;
|
||||
}
|
||||
|
||||
private static <T> T newInstanceOfAssignableType(Class<T> assignableClass,
|
||||
String name) {
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Class<? extends T> forName = (Class<? extends T>) Class
|
||||
.forName(name);
|
||||
return assignableClass.cast(forName.newInstance());
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(String.format(
|
||||
"%s is not assignable to a field of type %s", name,
|
||||
assignableClass.getName()), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue