* @param args the list of MSG files to process
*/
public static void main(String[] args) {
- if(args.length <= 0) {
+ if(args.length == 0) {
System.err.println("No files names provided");
} else {
for (String arg : args) {
CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
XWPFHeader hdr = null;
- if (relatedPart != null && relatedPart instanceof XWPFHeader) {
+ if (relatedPart instanceof XWPFHeader) {
hdr = (XWPFHeader) relatedPart;
}
// Assign it; treat invalid options as "default" POI-60293
CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
POIXMLDocumentPart relatedPart = doc.getRelationById(ref.getId());
XWPFFooter ftr = null;
- if (relatedPart != null && relatedPart instanceof XWPFFooter) {
+ if (relatedPart instanceof XWPFFooter) {
ftr = (XWPFFooter) relatedPart;
}
// Assign it; treat invalid options as "default" POI-60293
*/
public XWPFPictureData getPictureDataByID(String blipID) {
POIXMLDocumentPart relatedPart = getRelationById(blipID);
- if (relatedPart != null && relatedPart instanceof XWPFPictureData) {
+ if (relatedPart instanceof XWPFPictureData) {
return (XWPFPictureData) relatedPart;
}
return null;
Collection<String> lst = new TreeSet<>();
for (int i = 0; i < functions.length; i++) {
Function func = functions[i];
- if (func != null && (func instanceof NotImplementedFunction)) {
+ if ((func instanceof NotImplementedFunction)) {
FunctionMetadata metaData = FunctionMetadataRegistry.getFunctionByIndex(i);
lst.add(metaData.getName());
}
*/
public static double nChooseK(int n, int k) {
double d = 1;
- if (n<0 || k<0 || n<k) {
+ if (k < 0 || n < k) {
d= Double.NaN;
}
else {