[prev in list] [next in list] [prev in thread] [next in thread]
List: htmlunit-develop
Subject: [HtmlUnit] SVN: [13563] trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/ cyberneko
From: rbri () users ! sourceforge ! net
Date: 2017-02-05 17:29:52
Message-ID: E1caQdP-0003gE-KA () sfs-ml-3 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 13563
http://sourceforge.net/p/htmlunit/code/13563
Author: rbri
Date: 2017-02-05 17:29:52 +0000 (Sun, 05 Feb 2017)
Log Message:
-----------
cleanup
Modified Paths:
--------------
trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/HTMLComponent.java
trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/HTMLTagBalancer.java
trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/ObjectFactory.java
trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/SecuritySupport.java
trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/SecuritySupport12.java
trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/filters/Identity.java
Modified: trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/HTMLComponent.java
===================================================================
--- trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/HTMLComponent.java 2017-02-05 \
17:16:52 UTC (rev 13562)
+++ trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/HTMLComponent.java 2017-02-05 \
17:29:52 UTC (rev 13563) @@ -39,6 +39,7 @@
* component does not want to report a default value for this
* feature.
*/
+ @Override
public Boolean getFeatureDefault(String featureId);
/**
@@ -46,6 +47,7 @@
* component does not want to report a default value for this
* property.
*/
+ @Override
public Object getPropertyDefault(String propertyId);
} // interface HTMLComponent
Modified: trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/HTMLTagBalancer.java
===================================================================
--- trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/HTMLTagBalancer.java 2017-02-05 \
17:16:52 UTC (rev 13562)
+++ trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/HTMLTagBalancer.java 2017-02-05 \
17:29:52 UTC (rev 13563) @@ -785,7 +785,7 @@
// call handler
fSeenRootElement = true;
- if (element != null && element.isEmpty()) {
+ if (element.isEmpty()) {
if (attrs == null) {
attrs = emptyAttributes();
}
@@ -794,7 +794,7 @@
}
}
else {
- boolean inline = element != null && element.isInline();
+ boolean inline = element.isInline();
fElementStack.push(new Info(element, elem, inline ? attrs : null));
if (attrs == null) {
attrs = emptyAttributes();
Modified: trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/ObjectFactory.java
===================================================================
--- trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/ObjectFactory.java 2017-02-05 \
17:16:52 UTC (rev 13562)
+++ trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/ObjectFactory.java 2017-02-05 \
17:29:52 UTC (rev 13563) @@ -294,7 +294,7 @@
// Check for any extension ClassLoaders in chain up to
// boot ClassLoader
chain = ss.getParentClassLoader(chain);
- };
+ }
// Assert: Context ClassLoader not in chain of
// boot/extension/system ClassLoaders
@@ -310,7 +310,7 @@
{
// assert(className != null);
try{
- Class providerClass = findProviderClass(className, cl, doFallback);
+ Class<?> providerClass = findProviderClass(className, cl, doFallback);
Object instance = providerClass.newInstance();
if (DEBUG) debugPrintln("created new instance of " + providerClass +
" using ClassLoader: " + cl);
@@ -328,7 +328,7 @@
/**
* Find a Class using the specified ClassLoader
*/
- static Class findProviderClass(String className, ClassLoader cl,
+ static Class<?> findProviderClass(String className, ClassLoader cl,
boolean doFallback)
throws ClassNotFoundException, ConfigurationError
{
@@ -345,7 +345,7 @@
}catch(SecurityException e){
throw e ;
}
- Class providerClass;
+ Class<?> providerClass;
if (cl == null) {
// XXX Use the bootstrap ClassLoader. There is no way to
// load a class using the bootstrap ClassLoader that works
Modified: trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/SecuritySupport.java
===================================================================
--- trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/SecuritySupport.java 2017-02-05 \
17:16:52 UTC (rev 13562)
+++ trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/SecuritySupport.java 2017-02-05 \
17:29:52 UTC (rev 13563) @@ -42,7 +42,7 @@
static {
SecuritySupport ss = null;
try {
- Class c = Class.forName("java.security.AccessController");
+ Class.forName("java.security.AccessController");
// if that worked, we're on 1.2.
/*
// don't reference the class explicitly so it doesn't
Modified: trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/SecuritySupport12.java
===================================================================
--- trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/SecuritySupport12.java 2017-02-05 \
17:16:52 UTC (rev 13562)
+++ trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/SecuritySupport12.java 2017-02-05 \
17:29:52 UTC (rev 13563) @@ -34,105 +34,113 @@
*/
class SecuritySupport12 extends SecuritySupport {
+ @Override
ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ @Override
+ public ClassLoader run() {
+ ClassLoader cl = null;
+ try {
+ cl = Thread.currentThread().getContextClassLoader();
+ } catch (SecurityException ex) { }
+ return cl;
}
+ });
+ }
+ @Override
ClassLoader getSystemClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = ClassLoader.getSystemClassLoader();
- } catch (SecurityException ex) {}
- return cl;
- }
- });
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ @Override
+ public ClassLoader run() {
+ ClassLoader cl = null;
+ try {
+ cl = ClassLoader.getSystemClassLoader();
+ } catch (SecurityException ex) {}
+ return cl;
+ }
+ });
}
+ @Override
ClassLoader getParentClassLoader(final ClassLoader cl) {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader parent = null;
- try {
- parent = cl.getParent();
- } catch (SecurityException ex) {}
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ @Override
+ public ClassLoader run() {
+ ClassLoader parent = null;
+ try {
+ parent = cl.getParent();
+ } catch (SecurityException ex) {}
- // eliminate loops in case of the boot
- // ClassLoader returning itself as a parent
- return (parent == cl) ? null : parent;
- }
- });
+ // eliminate loops in case of the boot
+ // ClassLoader returning itself as a parent
+ return (parent == cl) ? null : parent;
+ }
+ });
}
+ @Override
String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
+ return AccessController.doPrivileged(new PrivilegedAction<String>() {
+ @Override
+ public String run() {
+ return System.getProperty(propName);
+ }
+ });
}
+ @Override
FileInputStream getFileInputStream(final File file)
throws FileNotFoundException
{
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
+ try {
+ return AccessController.doPrivileged(new \
PrivilegedExceptionAction<FileInputStream>() { + @Override
+ public FileInputStream run() throws FileNotFoundException {
return new FileInputStream(file);
}
});
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
+ } catch (PrivilegedActionException e) {
+ throw (FileNotFoundException)e.getException();
+ }
}
- }
+ @Override
InputStream getResourceAsStream(final ClassLoader cl,
final String name)
{
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
+ return AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
+ @Override
+ public InputStream run() {
+ InputStream ris;
+ if (cl == null) {
+ ris = ClassLoader.getSystemResourceAsStream(name);
+ } else {
+ ris = cl.getResourceAsStream(name);
}
- });
+ return ris;
+ }
+ });
}
+ @Override
boolean getFileExists(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return Boolean.valueOf(f.exists());
- }
- })).booleanValue();
- }
+ return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ @Override
+ public Boolean run() {
+ return Boolean.valueOf(f.exists());
+ }
+ }).booleanValue();
+ }
+ @Override
long getLastModified(final File f) {
- return ((Long)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return Long.valueOf(f.lastModified());
- }
- })).longValue();
+ return AccessController.doPrivileged(new PrivilegedAction<Long>() {
+ @Override
+ public Long run() {
+ return Long.valueOf(f.lastModified());
+ }
+ }).longValue();
}
}
Modified: trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/filters/Identity.java
===================================================================
--- trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/filters/Identity.java 2017-02-05 \
17:16:52 UTC (rev 13562)
+++ trunk/neko-htmlunit/src/main/java/net/sourceforge/htmlunit/cyberneko/filters/Identity.java 2017-02-05 \
17:29:52 UTC (rev 13563) @@ -68,6 +68,7 @@
//
/** Start element. */
+ @Override
public void startElement(QName element, XMLAttributes attributes,
Augmentations augs) throws XNIException {
if (augs == null || !synthesized(augs)) {
@@ -76,6 +77,7 @@
} // startElement(QName,XMLAttributes,Augmentations)
/** Empty element. */
+ @Override
public void emptyElement(QName element, XMLAttributes attributes,
Augmentations augs) throws XNIException {
if (augs == null || !synthesized(augs)) {
@@ -84,6 +86,7 @@
} // emptyElement(QName,XMLAttributes,Augmentations)
/** End element. */
+ @Override
public void endElement(QName element, Augmentations augs)
throws XNIException {
if (augs == null || !synthesized(augs)) {
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
HtmlUnit-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic