Bug 490313 - Refactoring: reduce warnings
diff --git a/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/ODFParser.java b/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/ODFParser.java
index 867c8f8..7e68adc 100644
--- a/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/ODFParser.java
+++ b/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/ODFParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -196,6 +196,7 @@
String name = entry.getName();
list.add(name);
}
+ zipFile.close();
return list.toArray(new String[list.size()]);
} catch (IOException e1) {
e1.printStackTrace();
diff --git a/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/base/impl/ODFDocumentImpl.java b/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/base/impl/ODFDocumentImpl.java
index 92ded87..b53c8f3 100644
--- a/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/base/impl/ODFDocumentImpl.java
+++ b/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/base/impl/ODFDocumentImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -59,25 +59,18 @@
import org.w3c.dom.Text;
public class ODFDocumentImpl extends ODFNodeImpl implements ODFDocument {
- private static final long serialVersionUID = 1L;
-
private static final Map<String, Class<? extends AbstractODFNodeFactory>> factoryMap = new HashMap<String, Class<? extends AbstractODFNodeFactory>>();
+
static {
- factoryMap.put(ChartConstants.CHART_NAMESPACE_URI,
- ChartNodeFactory.class);
+ factoryMap.put(ChartConstants.CHART_NAMESPACE_URI, ChartNodeFactory.class);
factoryMap.put(Dr3dConstants.DR3D_NAMESPACE_URI, Dr3dNodeFactory.class);
factoryMap.put(DrawConstants.DRAW_NAMESPACE_URI, DrawNodeFactory.class);
factoryMap.put(FormConstants.FORM_NAMESPACE_URI, FormNodeFactory.class);
- factoryMap.put(NumberConstants.NUMBER_NAMESPACE_URI,
- NumberNodeFactory.class);
- factoryMap.put(OfficeConstants.OFFICE_NAMESPACE_URI,
- OfficeNodeFactory.class);
- factoryMap.put(PresentationConstants.PRESENTATION_NAMESPACE_URI,
- PresentationNodeFactory.class);
- factoryMap.put(StyleConstants.STYLE_NAMESPACE_URI,
- StyleNodeFactory.class);
- factoryMap.put(TableConstants.TABLE_NAMESPACE_URI,
- TableNodeFactory.class);
+ factoryMap.put(NumberConstants.NUMBER_NAMESPACE_URI, NumberNodeFactory.class);
+ factoryMap.put(OfficeConstants.OFFICE_NAMESPACE_URI, OfficeNodeFactory.class);
+ factoryMap.put(PresentationConstants.PRESENTATION_NAMESPACE_URI, PresentationNodeFactory.class);
+ factoryMap.put(StyleConstants.STYLE_NAMESPACE_URI, StyleNodeFactory.class);
+ factoryMap.put(TableConstants.TABLE_NAMESPACE_URI, TableNodeFactory.class);
factoryMap.put(TextConstants.TEXT_NAMESPACE_URI, TextNodeFactory.class);
factoryMap.put(SVGConstants.SVG_NAMESPACE_URI, SVGNodeFactory.class);
}
@@ -103,8 +96,7 @@
return null;
}
- public Attr createAttributeNS(String namespaceURI, String qualifiedName)
- throws DOMException {
+ public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException {
// TODO Auto-generated method stub
return null;
}
@@ -130,31 +122,26 @@
public Element createElement(String tagName) throws DOMException {
if (iNode instanceof Document) {
- return (Element) getODFNode(((Document) iNode)
- .createElement(tagName));
+ return (Element) getODFNode(((Document) iNode).createElement(tagName));
}
return null;
}
- public Element createElementNS(String namespaceURI, String qualifiedName)
- throws DOMException {
+ public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException {
if (iNode instanceof Document) {
- return (Element) getODFNode(((Document) iNode).createElementNS(
- namespaceURI, qualifiedName));
+ return (Element) getODFNode(((Document) iNode).createElementNS(namespaceURI, qualifiedName));
}
return null;
}
- public EntityReference createEntityReference(String name)
- throws DOMException {
+ public EntityReference createEntityReference(String name) throws DOMException {
if (iNode instanceof Document) {
return ((Document) iNode).createEntityReference(name);
}
return null;
}
- public ProcessingInstruction createProcessingInstruction(String target,
- String data) throws DOMException {
+ public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException {
if (iNode instanceof Document) {
return ((Document) iNode).createProcessingInstruction(target, data);
}
@@ -212,8 +199,7 @@
public NodeList getElementsByTagName(String tagname) {
if (iNode instanceof Document) {
- NodeList iNodeList = ((Document) iNode)
- .getElementsByTagName(tagname);
+ NodeList iNodeList = ((Document) iNode).getElementsByTagName(tagname);
if (iNodeList == null)
return null;
return new ODFNodeListImpl(this, iNodeList);
@@ -223,8 +209,7 @@
public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
if (iNode instanceof Document) {
- NodeList iNodeList = ((Document) iNode).getElementsByTagNameNS(
- namespaceURI, localName);
+ NodeList iNodeList = ((Document) iNode).getElementsByTagNameNS(namespaceURI, localName);
if (iNodeList == null)
return null;
return new ODFNodeListImpl(this, iNodeList);
@@ -284,8 +269,7 @@
}
- public Node renameNode(Node n, String namespaceURI, String qualifiedName)
- throws DOMException {
+ public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException {
// TODO Auto-generated method stub
return null;
}
@@ -323,8 +307,7 @@
for (int i = 0; i < methods.length; i++) {
if ("createElement".equals(methods[i].getName())) { //$NON-NLS-1$
Class<?>[] parms = methods[i].getParameterTypes();
- if (parms.length == 3 && parms[0].equals(ODFDocument.class)
- && parms[1].equals(String.class)
+ if (parms.length == 3 && parms[0].equals(ODFDocument.class) && parms[1].equals(String.class)
&& parms[2].equals(Element.class)) {
return methods[i];
}
@@ -338,15 +321,13 @@
if (result != null)
return result;
- Class<? extends AbstractODFNodeFactory> factory = factoryMap.get(node
- .getNamespaceURI());
+ Class<? extends AbstractODFNodeFactory> factory = factoryMap.get(node.getNamespaceURI());
if (factory != null) {
if (node instanceof Element) {
Method createElemMethod = findCreateElementMethod(factory);
try {
result = (ODFNode) createElemMethod.invoke(factory,
- new Object[] { this, node.getLocalName(),
- (Element) node });
+ new Object[] { this, node.getLocalName(), (Element) node });
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
@@ -368,8 +349,7 @@
} else if (node instanceof CharacterData) {
result = new ODFCharacterDataImpl(this, (CharacterData) node);
} else if (node instanceof ProcessingInstruction) {
- result = new ODFProcessingInstructionImpl(this,
- (ProcessingInstruction) node);
+ result = new ODFProcessingInstructionImpl(this, (ProcessingInstruction) node);
} else {
result = new ODFNodeImpl(this, node);
}
@@ -388,8 +368,8 @@
public void setODFVersion(double version) {
Element root = this.getDocumentElement();
- root.setAttributeNS(OfficeConstants.OFFICE_NAMESPACE_URI,
- OfficeConstants.ATTR_VERSION, new Double(version).toString());
+ root.setAttributeNS(OfficeConstants.OFFICE_NAMESPACE_URI, OfficeConstants.ATTR_VERSION,
+ new Double(version).toString());
}
public double getODFVersion() {
diff --git a/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/util/ODFWriter.java b/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/util/ODFWriter.java
index d0e16a5..e1f35a5 100644
--- a/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/util/ODFWriter.java
+++ b/plugins/org.eclipse.actf.model.dom.odf/src/org/eclipse/actf/model/dom/odf/util/ODFWriter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -122,6 +122,7 @@
} catch (IOException e) {
e.printStackTrace();
} finally {
+ zipFile.close();
fos.close();
}
}
diff --git a/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/flash/util/AsVersionChecker.java b/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/flash/util/AsVersionChecker.java
index f9d0b64..1682505 100644
--- a/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/flash/util/AsVersionChecker.java
+++ b/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/flash/util/AsVersionChecker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -57,7 +57,7 @@
try {
File f = new File(path);
if (f.exists()) {
- url = f.toURL();
+ url = f.toURI().toURL();
} else {
url = new URL(path);
}
diff --git a/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/internal/flash/ASBridgeImplV8.java b/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/internal/flash/ASBridgeImplV8.java
index 573f222..ffe3e77 100644
--- a/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/internal/flash/ASBridgeImplV8.java
+++ b/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/internal/flash/ASBridgeImplV8.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and Others
+ * Copyright (c) 2008, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -97,6 +97,7 @@
}
private Object invoke(Object[] args) {
+ @SuppressWarnings("unused")
int counter = 0;
try {
if (!initSecret()) {
diff --git a/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/internal/flash/proxy/SWFBootloader.java b/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/internal/flash/proxy/SWFBootloader.java
index 2a075b5..7f1c918 100644
--- a/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/internal/flash/proxy/SWFBootloader.java
+++ b/plugins/org.eclipse.actf.model.flash/src/org/eclipse/actf/model/internal/flash/proxy/SWFBootloader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -197,7 +197,7 @@
* (org.eclipse.actf.util.httpproxy.proxy.ClientStateManager,
* org.eclipse.actf.util.httpproxy.core.HTTPRequestMessage)
*/
- @SuppressWarnings("nls")
+ @SuppressWarnings({ "nls", "unused" })
public boolean replaceRequest(IClientStateManager csm,
IHTTPRequestMessage request) throws IOException {
replacedFlag = false;
diff --git a/plugins/org.eclipse.actf.model.ui.editors.ooo/src/org/eclipse/actf/model/internal/ui/editors/ooo/OOoWindowComposite.java b/plugins/org.eclipse.actf.model.ui.editors.ooo/src/org/eclipse/actf/model/internal/ui/editors/ooo/OOoWindowComposite.java
index ff646ca..cb28ce9 100644
--- a/plugins/org.eclipse.actf.model.ui.editors.ooo/src/org/eclipse/actf/model/internal/ui/editors/ooo/OOoWindowComposite.java
+++ b/plugins/org.eclipse.actf.model.ui.editors.ooo/src/org/eclipse/actf/model/internal/ui/editors/ooo/OOoWindowComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -330,12 +330,14 @@
}
}
+ @SuppressWarnings("unused")
public void setWidth(int width) {
if (xWindow != null) {
xWindow.setPosSize(0, 0, width, 0, PosSize.WIDTH);
}
}
+ @SuppressWarnings("unused")
public void setHeight(int height) {
if (xWindow != null) {
xWindow.setPosSize(0, 0, 0, height, PosSize.HEIGHT);
diff --git a/plugins/org.eclipse.actf.model.ui.editors.ooo/src/org/eclipse/actf/model/internal/ui/editors/ooo/util/ODFUtils.java b/plugins/org.eclipse.actf.model.ui.editors.ooo/src/org/eclipse/actf/model/internal/ui/editors/ooo/util/ODFUtils.java
index 8c9248c..aa104c4 100644
--- a/plugins/org.eclipse.actf.model.ui.editors.ooo/src/org/eclipse/actf/model/internal/ui/editors/ooo/util/ODFUtils.java
+++ b/plugins/org.eclipse.actf.model.ui.editors.ooo/src/org/eclipse/actf/model/internal/ui/editors/ooo/util/ODFUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,23 +47,21 @@
@SuppressWarnings("nls")
public class ODFUtils {
public static int getDrawPageCount(XComponent xComp) {
- XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier) UnoRuntime
- .queryInterface(XDrawPagesSupplier.class, xComp);
+ XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier) UnoRuntime.queryInterface(XDrawPagesSupplier.class,
+ xComp);
XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
return xDrawPages.getCount();
}
- public static XDrawPage getDrawPageByIndex(XComponent xComp, int index)
- throws ODFException {
+ public static XDrawPage getDrawPageByIndex(XComponent xComp, int index) throws ODFException {
try {
XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier) UnoRuntime
.queryInterface(XDrawPagesSupplier.class, xComp);
XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
- return (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class,
- xDrawPages.getByIndex(index));
+ return (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class, xDrawPages.getByIndex(index));
} catch (IndexOutOfBoundsException ioobe) {
ioobe.printStackTrace();
@@ -78,32 +76,27 @@
if (odfContent != null) {
Element content = odfContent.getDocumentElement();
if (content instanceof DocumentContentElement) {
- return ((DocumentContentElement) content).getBodyElement()
- .getContent().getContentType();
+ return ((DocumentContentElement) content).getBodyElement().getContent().getContentType();
}
}
return ContentType.NONE;
}
- public static XFrame getXFrame(XComponentContext xCompContext)
- throws ODFException {
+ public static XFrame getXFrame(XComponentContext xCompContext) throws ODFException {
XComponent xComp = getXComponent(xCompContext);
XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, xComp);
return model.getCurrentController().getFrame();
}
- public static XDispatchHelper getXDispatchHelper(
- XComponentContext xCompContext) throws ODFException {
+ public static XDispatchHelper getXDispatchHelper(XComponentContext xCompContext) throws ODFException {
XDispatchHelper xDispatchHelper = null;
XMultiComponentFactory xMCF = xCompContext.getServiceManager();
try {
- Object oDispatchHelper = xMCF.createInstanceWithContext(
- "com.sun.star.frame.DispatchHelper", xCompContext);
- xDispatchHelper = (XDispatchHelper) UnoRuntime.queryInterface(
- XDispatchHelper.class, oDispatchHelper);
+ Object oDispatchHelper = xMCF.createInstanceWithContext("com.sun.star.frame.DispatchHelper", xCompContext);
+ xDispatchHelper = (XDispatchHelper) UnoRuntime.queryInterface(XDispatchHelper.class, oDispatchHelper);
} catch (Exception e) {
throw new ODFException(e.getMessage());
}
@@ -111,17 +104,14 @@
return xDispatchHelper;
}
- public static XLayoutManager getXLayoutManager(XFrame xFrame)
- throws ODFException {
+ public static XLayoutManager getXLayoutManager(XFrame xFrame) throws ODFException {
XLayoutManager xLayoutManager = null;
- XPropertySet framePropSet = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class, xFrame);
+ XPropertySet framePropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xFrame);
try {
- xLayoutManager = (XLayoutManager) UnoRuntime.queryInterface(
- XLayoutManager.class, framePropSet
- .getPropertyValue("LayoutManager"));
+ xLayoutManager = (XLayoutManager) UnoRuntime.queryInterface(XLayoutManager.class,
+ framePropSet.getPropertyValue("LayoutManager"));
} catch (UnknownPropertyException upe) {
throw new ODFException(upe.getMessage());
} catch (WrappedTargetException wte) {
@@ -131,8 +121,7 @@
return xLayoutManager;
}
- public static XComponent getXComponent(XComponentContext xComponentContext)
- throws ODFException {
+ public static XComponent getXComponent(XComponentContext xComponentContext) throws ODFException {
XDesktop xDesktop = BootstrapForOOoComposite.getXDesktop();
XEnumerationAccess xEnumerationAccess = xDesktop.getComponents();
XEnumeration xEnumeration = xEnumerationAccess.createEnumeration();
@@ -147,23 +136,19 @@
}
if (null != oComp) {
- return (XComponent) UnoRuntime.queryInterface(XComponent.class,
- oComp);
+ return (XComponent) UnoRuntime.queryInterface(XComponent.class, oComp);
}
}
return null;
}
- public static XDesktop getXDesktop(XComponentContext xComponentContext)
- throws ODFException {
+ public static XDesktop getXDesktop(XComponentContext xComponentContext) throws ODFException {
XDesktop xDesktop = null;
try {
XMultiComponentFactory xMCF = xComponentContext.getServiceManager();
- Object oDesktop = xMCF.createInstanceWithContext(
- "com.sun.star.frame.Desktop", xComponentContext);
- xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
- oDesktop);
+ Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xComponentContext);
+ xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, oDesktop);
} catch (Exception e) {
throw new ODFException(e.getMessage());
}
@@ -173,8 +158,7 @@
@SuppressWarnings("unused")
public static ClassLoader loadOpenOfficeLibs() throws ODFException {
- String openOfficeProgramPath = OOoEditorInitUtil.getOpenOfficePath()
- + "\\";
+ String openOfficeProgramPath = OOoEditorInitUtil.getOpenOfficePath() + "\\";
File msvcr71 = new File(openOfficeProgramPath + "msvcr71.dll");
if (msvcr71.exists()) {
@@ -182,14 +166,12 @@
}
if (System.getProperty("java.vm.vendor").equals("IBM Corporation")) {
- String javaHome = System
- .getProperty("com.ibm.oti.vm.bootstrap.library.path");
+ String javaHome = System.getProperty("com.ibm.oti.vm.bootstrap.library.path");
// dummy variable to load awt.dll
java.awt.Color awtColor = new java.awt.Color(0, 0, 0);
System.load(javaHome + "\\jawt.dll");
- } else if (System.getProperty("java.vm.vendor").equals(
- "Sun Microsystems Inc.")) {
+ } else if (System.getProperty("java.vm.vendor").equals("Sun Microsystems Inc.")) {
String javaHome = System.getProperty("java.home");
// dummy variable to load awt.dll
@@ -201,28 +183,23 @@
System.load(openOfficeProgramPath + "..\\URE\\bin\\uwinapi.dll");
try {
- System.load(openOfficeProgramPath + "officebean.dll");
+ System.load(openOfficeProgramPath + "officebean.dll");
} catch (UnsatisfiedLinkError e) {
- System.load(openOfficeProgramPath + "..\\Basis\\program\\officebean.dll"); // older than OpenOffice 3.2.1
+ System.load(openOfficeProgramPath + "..\\Basis\\program\\officebean.dll");
+ // older than OpenOffice 3.2.1
}
System.load(openOfficeProgramPath + "..\\URE\\bin\\sal3.dll");
System.load(openOfficeProgramPath + "..\\URE\\bin\\jpipe.dll");
ClassLoader javaClassLoader = null;
- //TODO replace with toURI().toURL()
+ // TODO replace with toURI().toURL()
try {
- URL[] jarList = new URL[] {
- new File(openOfficeProgramPath + "..\\URE\\java\\juh.jar")
- .toURL(),
- new File(openOfficeProgramPath + "..\\URE\\java\\jurt.jar")
- .toURL(),
- new File(openOfficeProgramPath + "..\\URE\\java\\ridl.jar")
- .toURL(),
- new File(openOfficeProgramPath
- + "..\\Basis\\program\\classes\\unoil.jar").toURL() };
+ URL[] jarList = new URL[] { new File(openOfficeProgramPath + "..\\URE\\java\\juh.jar").toURI().toURL(),
+ new File(openOfficeProgramPath + "..\\URE\\java\\jurt.jar").toURI().toURL(),
+ new File(openOfficeProgramPath + "..\\URE\\java\\ridl.jar").toURI().toURL(),
+ new File(openOfficeProgramPath + "..\\Basis\\program\\classes\\unoil.jar").toURI().toURL() };
- javaClassLoader = new URLClassLoader(jarList, Bootstrap.class
- .getClassLoader());
+ javaClassLoader = new URLClassLoader(jarList, Bootstrap.class.getClassLoader());
} catch (MalformedURLException murle) {
throw new ODFException(murle.getMessage());
@@ -252,8 +229,7 @@
public static int getOpenOfficeFrameNum() {
int result = 0;
- int hwndChild = WindowUtil
- .GetChildWindow(WindowUtil.GetDesktopWindow());
+ int hwndChild = WindowUtil.GetChildWindow(WindowUtil.GetDesktopWindow());
// OS.GetWindow (OS.GetDesktopWindow(), OS.GW_CHILD);
while (hwndChild != 0) {
result = getOpenOfficeFrameNum(hwndChild, result);
diff --git a/plugins/org.eclipse.actf.model.ui/src/org/eclipse/actf/model/ui/editor/DummyEditorInput.java b/plugins/org.eclipse.actf.model.ui/src/org/eclipse/actf/model/ui/editor/DummyEditorInput.java
index 4934171..d8d9419 100644
--- a/plugins/org.eclipse.actf.model.ui/src/org/eclipse/actf/model/ui/editor/DummyEditorInput.java
+++ b/plugins/org.eclipse.actf.model.ui/src/org/eclipse/actf/model/ui/editor/DummyEditorInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -63,7 +63,7 @@
return ""; //$NON-NLS-1$
}
- @SuppressWarnings("rawtypes")
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public Object getAdapter(Class adapter) {
return null;
}
diff --git a/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/ChunkEncoder.java b/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/ChunkEncoder.java
index 2da4fa2..8df7422 100644
--- a/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/ChunkEncoder.java
+++ b/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/ChunkEncoder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -125,5 +125,6 @@
String line = sb.toString();
System.out.println(line);
}
+ decoder.close();
}
}
diff --git a/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/HTTPReader.java b/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/HTTPReader.java
index b1eba3f..7d2913e 100644
--- a/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/HTTPReader.java
+++ b/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/HTTPReader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -60,7 +60,8 @@
return fLastByte;
}
- private int getAvailableInput(long timeout) throws IOException, TimeoutException {
+ @SuppressWarnings("unused")
+ private int getAvailableInput(long timeout) throws IOException, TimeoutException {
int data;
if (false) {
if (timeout > 0) {
@@ -378,6 +379,7 @@
}
return n;
} finally {
+ decoder.close();
encoder.close();
}
}
diff --git a/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/HTTPRequestMessage.java b/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/HTTPRequestMessage.java
index 32f4f02..fc3638e 100644
--- a/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/HTTPRequestMessage.java
+++ b/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/HTTPRequestMessage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -142,7 +142,8 @@
}
private boolean contentLengthInvalidMessage;
- final void recalculateContentLength() {
+ @SuppressWarnings("unused")
+ final void recalculateContentLength() {
IMessageBody body = getMessageBody();
if (body.getContentLength() == -1) {
contentLengthInvalidMessage = true;
diff --git a/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/ServerConnection.java b/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/ServerConnection.java
index 750a920..6381cb8 100644
--- a/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/ServerConnection.java
+++ b/plugins/org.eclipse.actf.util.httpproxy/src/org/eclipse/actf/util/internal/httpproxy/core/ServerConnection.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and Others
+ * Copyright (c) 2007, 2016 IBM Corporation and Others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -106,6 +106,7 @@
private static class Status {
private int fStat = STAT_INIT;
+ @SuppressWarnings("unused")
private int fNumWaiters = 0;
Status() {
@@ -593,7 +594,10 @@
// long lastActivityTime = System.currentTimeMillis();
try {
boolean serverError = false;
+
+ @SuppressWarnings("unused")
int counter = 0;
+
while (!Thread.interrupted() && !serverError) {
counter += 1;
IHTTPRequestMessage request = nextRequest();