Author: rob.stryker(a)jboss.com
Date: 2008-10-20 14:09:23 -0400 (Mon, 20 Oct 2008)
New Revision: 11008
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java
Log:
JBIDE-2852 - line numbers have changed but I've tried to NPE-proof it.
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java 2008-10-20
17:11:39 UTC (rev 11007)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/ModelTruezipBridge.java 2008-10-20
18:09:23 UTC (rev 11008)
@@ -232,11 +232,14 @@
private static File[] getFiles(FileWrapper[] inputFiles, IArchiveFileSet fs ) {
String filesetRelative;
File fsFile = getFile(fs);
- if( fsFile == null )
+ if( fs == null || fsFile == null )
return new File[]{};
- File[] returnFiles = new File[inputFiles.length];
+ ArrayList<File> returnFiles = new ArrayList<File>();
for( int i = 0; i < inputFiles.length; i++ ) {
+ if( inputFiles[i] == null )
+ continue;
+
if( fs.isFlattened() )
filesetRelative = inputFiles[i].getOutputName();
else
@@ -251,9 +254,9 @@
} else {
parentFile = fsFile;
}
- returnFiles[i] = new File(parentFile, new Path(filesetRelative).lastSegment(),
ArchiveDetector.DEFAULT);
+ returnFiles.add(new File(parentFile, new Path(filesetRelative).lastSegment(),
ArchiveDetector.DEFAULT));
}
- return returnFiles;
+ return (File[]) returnFiles.toArray(new File[returnFiles.size()]);
}
Show replies by date