You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2017/03/07 03:16:50 UTC
svn commit: r1785793 -
/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java
Author: onealj
Date: Tue Mar 7 03:16:50 2017
New Revision: 1785793
URL: http://svn.apache.org/viewvc?rev=1785793&view=rev
Log:
store repeated expressions as temporary variables to make code shorter
Modified:
poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java
Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java?rev=1785793&r1=1785792&r2=1785793&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java Tue Mar 7 03:16:50 2017
@@ -58,17 +58,19 @@ public class TestZipPackage {
// Check we found the contents of it
boolean foundCoreProps = false, foundDocument = false, foundTheme1 = false;
- for (PackagePart part : p.getParts()) {
- if (part.getPartName().toString().equals("/docProps/core.xml")) {
- assertEquals(ContentTypes.CORE_PROPERTIES_PART, part.getContentType());
+ for (final PackagePart part : p.getParts()) {
+ final String partName = part.getPartName().toString();
+ final String contentType = part.getContentType();
+ if ("/docProps/core.xml".equals(partName)) {
+ assertEquals(ContentTypes.CORE_PROPERTIES_PART, contentType);
foundCoreProps = true;
}
- if (part.getPartName().toString().equals("/word/document.xml")) {
- assertEquals(XWPFRelation.DOCUMENT.getContentType(), part.getContentType());
+ if ("/word/document.xml".equals(partName)) {
+ assertEquals(XWPFRelation.DOCUMENT.getContentType(), contentType);
foundDocument = true;
}
- if (part.getPartName().toString().equals("/word/theme/theme1.xml")) {
- assertEquals(XWPFRelation.THEME.getContentType(), part.getContentType());
+ if ("/word/theme/theme1.xml".equals(partName)) {
+ assertEquals(XWPFRelation.THEME.getContentType(), contentType);
foundTheme1 = true;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org