Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 1563 Details for
Bug 18152
OutOfMemory error and NPE in editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Test.java
Test.java (text/plain), 1.81 KB, created by
Chris McLaren
on 2002-06-23 23:23:11 EDT
(
hide
)
Description:
Test.java
Filename:
MIME Type:
Creator:
Chris McLaren
Created:
2002-06-23 23:23:11 EDT
Size:
1.81 KB
patch
obsolete
>import java.io.*; >import java.util.*; >import java.util.jar.*; > >public class Test { > > public static void main(String[] args) { > > final String PATH = "c:\\eclipse-SDK-20020620-win32\\eclipse\\workspace\\test\\"; > final int INITIAL_CAPACITY = 10000; > final int FILES = 50; > final int DECLARATIONS_PER_FILE = 2000; > > try { > File[] files = new File(PATH).listFiles(new FilenameFilter() { > public boolean accept(File dir, String name) { > return name != null && name.trim().endsWith(".jar"); > } > }); > > List list = new ArrayList(INITIAL_CAPACITY); > JarFile jarFile; > Enumeration e; > Object o; > JarEntry jarEntry; > String name; > > for (int i = 0, l = files.length; i < l; i++) { > jarFile = new JarFile(files[i]); > e = jarFile.entries(); > > while (e.hasMoreElements()) { > o = e.nextElement(); > > if (o instanceof JarEntry) { > jarEntry = (JarEntry) o; > name = jarEntry.getName(); > > if (name != null) { > name = name.trim(); > > if (name.endsWith(".class") && name.indexOf("$") == -1) { > list.add(name.substring(0, name.length() - 6).replace('/', '.')); > } > } > } > } > } > > int size = list.size(); > > for (int i = 0; i < FILES; i++) { > BufferedWriter writer = new BufferedWriter(new FileWriter(PATH + "Output" + i + ".java")); > > writer.write("public class Output" + i + " {"); > writer.newLine(); > writer.newLine(); > > for (int j = 0; j < DECLARATIONS_PER_FILE; j++) { > writer.write("\t" + list.get((int) (Math.random() * size)) + " _" + j + ";"); > writer.newLine(); > } > > writer.write("}"); > writer.newLine(); > writer.flush(); > writer.close(); > } > } catch (IOException eIO) { > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 18152
: 1563 |
1564
|
1565
|
1569
|
1570