Skip to content

Commit 773ad5e

Browse files
committed
[github-356] accept some of the changes in this PR (not all)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902784 13f79535-47bb-0310-9956-ffa450edef68
1 parent 46b1404 commit 773ad5e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

poi-examples/src/main/java/org/apache/poi/examples/hsmf/Msg2txt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public void processAttachment(AttachmentChunks attachment,
142142
* @param args the list of MSG files to process
143143
*/
144144
public static void main(String[] args) {
145-
if(args.length <= 0) {
145+
if(args.length == 0) {
146146
System.err.println("No files names provided");
147147
} else {
148148
for (String arg : args) {

poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public XWPFHeaderFooterPolicy(XWPFDocument doc, CTSectPr sectPr) {
110110
CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
111111
POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
112112
XWPFHeader hdr = null;
113-
if (relatedPart != null && relatedPart instanceof XWPFHeader) {
113+
if (relatedPart instanceof XWPFHeader) {
114114
hdr = (XWPFHeader) relatedPart;
115115
}
116116
// Assign it; treat invalid options as "default" POI-60293
@@ -128,7 +128,7 @@ public XWPFHeaderFooterPolicy(XWPFDocument doc, CTSectPr sectPr) {
128128
CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
129129
POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
130130
XWPFFooter ftr = null;
131-
if (relatedPart != null && relatedPart instanceof XWPFFooter) {
131+
if (relatedPart instanceof XWPFFooter) {
132132
ftr = (XWPFFooter) relatedPart;
133133
}
134134
// Assign it; treat invalid options as "default" POI-60293

poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public String addPictureData(InputStream is, int format) throws InvalidFormatExc
290290
*/
291291
public XWPFPictureData getPictureDataByID(String blipID) {
292292
POIXMLDocumentPart relatedPart = getRelationById(blipID);
293-
if (relatedPart != null && relatedPart instanceof XWPFPictureData) {
293+
if (relatedPart instanceof XWPFPictureData) {
294294
return (XWPFPictureData) relatedPart;
295295
}
296296
return null;

poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionEval.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ public static Collection<String> getNotSupportedFunctionNames() {
428428
Collection<String> lst = new TreeSet<>();
429429
for (int i = 0; i < functions.length; i++) {
430430
Function func = functions[i];
431-
if (func != null && (func instanceof NotImplementedFunction)) {
431+
if ((func instanceof NotImplementedFunction)) {
432432
FunctionMetadata metaData = FunctionMetadataRegistry.getFunctionByIndex(i);
433433
lst.add(metaData.getName());
434434
}

poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public static double tanh(double d) {
414414
*/
415415
public static double nChooseK(int n, int k) {
416416
double d = 1;
417-
if (n<0 || k<0 || n<k) {
417+
if (k < 0 || n < k) {
418418
d= Double.NaN;
419419
}
420420
else {

0 commit comments

Comments
 (0)