List String

Hi again,
I was just searching for someting and found out something that Sabre150 post:
public static List<String> head(File file, int numberOfLinesToRead) throws IOException
        return head(file, "ISO-8859-1" , numberOfLinesToRead);
    }Can anybody tell me what is the meaning of <String> next to the return object? What does it do?
Many Thanks
Titus

means that all the objects in the List must be Strings
so if you try to add an Integer for example into the List, I think it will give you an error because you already told it that it will be a String list

Similar Messages

  • How can i get also the files in the root directory and how can i for testing add items of IEnumerable FTPListDetail to List string ?

    What i get is only the directories and files that in other nodes. But i have also files on the root directory and i never
    get them. This is a screenshot of my program after i got the content of my ftp. I'm using treeView to display my ftp content:
    You can see two directories from the root but no files on the root it self. And in my ftp server host i have files in the root direcory.
    This is the method i'm using to get the directory listing:
    public IEnumerable<FTPListDetail> GetDirectoryListing(string rootUri)
    var CurrentRemoteDirectory = rootUri;
    var result = new StringBuilder();
    var request = GetWebRequest(WebRequestMethods.Ftp.ListDirectoryDetails, CurrentRemoteDirectory);
    using (var response = request.GetResponse())
    using (var reader = new StreamReader(response.GetResponseStream()))
    string line = reader.ReadLine();
    while (line != null)
    result.Append(line);
    result.Append("\n");
    line = reader.ReadLine();
    if (string.IsNullOrEmpty(result.ToString()))
    return new List<FTPListDetail>();
    result.Remove(result.ToString().LastIndexOf("\n"), 1);
    var results = result.ToString().Split('\n');
    string regex =
    @"^" + //# Start of line
    @"(?<dir>[\-ld])" + //# File size
    @"(?<permission>[\-rwx]{9})" + //# Whitespace \n
    @"\s+" + //# Whitespace \n
    @"(?<filecode>\d+)" +
    @"\s+" + //# Whitespace \n
    @"(?<owner>\w+)" +
    @"\s+" + //# Whitespace \n
    @"(?<group>\w+)" +
    @"\s+" + //# Whitespace \n
    @"(?<size>\d+)" +
    @"\s+" + //# Whitespace \n
    @"(?<month>\w{3})" + //# Month (3 letters) \n
    @"\s+" + //# Whitespace \n
    @"(?<day>\d{1,2})" + //# Day (1 or 2 digits) \n
    @"\s+" + //# Whitespace \n
    @"(?<timeyear>[\d:]{4,5})" + //# Time or year \n
    @"\s+" + //# Whitespace \n
    @"(?<filename>(.*))" + //# Filename \n
    @"$"; //# End of line
    var myresult = new List<FTPListDetail>();
    foreach (var parsed in results)
    var split = new Regex(regex)
    .Match(parsed);
    var dir = split.Groups["dir"].ToString();
    var permission = split.Groups["permission"].ToString();
    var filecode = split.Groups["filecode"].ToString();
    var owner = split.Groups["owner"].ToString();
    var group = split.Groups["group"].ToString();
    var filename = split.Groups["filename"].ToString();
    var size = split.Groups["size"].Length;
    myresult.Add(new FTPListDetail()
    Dir = dir,
    Filecode = filecode,
    Group = group,
    FullPath = CurrentRemoteDirectory + "/" + filename,
    Name = filename,
    Owner = owner,
    Permission = permission,
    return myresult;
    And then this method to loop over and listing :
    private int total_dirs;
    private int searched_until_now_dirs;
    private int max_percentage;
    private TreeNode directories_real_time;
    private string SummaryText;
    private TreeNode CreateDirectoryNode(string path, string name , int recursive_levl )
    var directoryNode = new TreeNode(name);
    var directoryListing = GetDirectoryListing(path);
    var directories = directoryListing.Where(d => d.IsDirectory);
    var files = directoryListing.Where(d => !d.IsDirectory);
    total_dirs += directories.Count<FTPListDetail>();
    searched_until_now_dirs++;
    int percentage = 0;
    foreach (var dir in directories)
    directoryNode.Nodes.Add(CreateDirectoryNode(dir.FullPath, dir.Name, recursive_levl+1));
    if (recursive_levl == 1)
    TreeNode temp_tn = (TreeNode)directoryNode.Clone();
    this.BeginInvoke(new MethodInvoker( delegate
    UpdateList(temp_tn);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    foreach (var file in files)
    TreeNode file_tree_node = new TreeNode(file.Name);
    file_tree_node.Tag = "file" ;
    directoryNode.Nodes.Add(file_tree_node);
    numberOfFiles.Add(file.FullPath);
    return directoryNode;
    Then updating the treeView:
    DateTime last_update;
    private void UpdateList(TreeNode tn_rt)
    TimeSpan ts = DateTime.Now - last_update;
    if (ts.TotalMilliseconds > 200)
    last_update = DateTime.Now;
    treeViewMS1.BeginUpdate();
    treeViewMS1.Nodes.Clear();
    treeViewMS1.Nodes.Add(tn_rt);
    ExpandToLevel(treeViewMS1.Nodes, 1);
    treeViewMS1.EndUpdate();
    And inside a backgroundworker do work how i'm using it:
    var root = Convert.ToString(e.Argument);
    var dirNode = CreateDirectoryNode(root, "root", 1);
    e.Result = dirNode;
    And last the FTPListDetail class:
    public class FTPListDetail
    public bool IsDirectory
    get
    return !string.IsNullOrWhiteSpace(Dir) && Dir.ToLower().Equals("d");
    internal string Dir { get; set; }
    public string Permission { get; set; }
    public string Filecode { get; set; }
    public string Owner { get; set; }
    public string Group { get; set; }
    public string Name { get; set; }
    public string FullPath { get; set; }
    Now the main problem is that when i list the files and directories and display them in the treeView it dosen't get/display
    the files in the root directory. Only in the sub nodes.
    I will see the files inside hello and stats but i need also to see the files in the root directory.
    1. How can i get and list/display the files of the root directory ?
    2. For the test i tried to add to a List<string> the items in var files to see if i get the root files at all.
       This is what i tried in the CreateDirectoryNode before it i added:
    private List<string> testfiles = new List<string>();
    Then after var files i did:
    testfiles.Add(files.ToList()
    But this is wrong. I just wanted to see in testfiles what items i'm getting in var files in the end of the process.
    Both var files and directoryListing are IEnumerable<FTPListDetail> type.
    The most important is to make the number 1 i mentioned and then to do number 2.

    Risa no.
    What i mean is this. This is a screenshot of my ftp server at my host(ipage.com).
    Now this is a screenshot of my program and you can see that in my program i have only the directories hello stats test but i don't have the files in the root: htaccess.config swp txt 1.txt 2.png....all this files i don't have it on my treeView.
    What i want it to be is that on my program on the treeView i will also display the files like in my ftp server.
    I see in my program only the directories and the files in the directories but i don't see the files on the root directory/node.
    I need it to be like in my ftp server i need to see in my program the htaccess 1.txt 2.png and so on.
    So what i wrote in my main question is that in the var files i see this files of the root directory i just don't know to add and display them in my treeView(my treeView is treeViewMS1).
    I know i checked in my program in the method CreateDirectoryNode i see in the first iteration of the recursive that var files contain this root files i just dont know how to add and display them in my treeView.
    On the next iterations when it does the recursive it's adding the directories hello stats test and the files in this directories but i need it to first add the root files.

  • How to use List String in JSP page?

    Hello All,
    I am having problem using List<String> in my JSP page. Below is my JSP code.
    <%@ page import="java.util.*, java.io.*"%>
    <html>
    <body>
    <h1 align="center">Beer Recommendations JSP</h1>
    <p>
    <%
    List<String> beerBrands = (List<String>)request.getAttribute("styles");
    Iterator<String> it = beerBrands.iterator();
    while(it.hasNext()){
         out.print("<br>try: " + it.next());
    %>
    </body>
    </html>
    When I compile the above JSP code in Eclipse 3.4 (using JBoss 4.2 as my Application Server), I get the following Warning.
    Type safety: Unchecked cast from Enumeration to Enumeration<String>
    If I add the "@SuppressWarnings("unchecked")" to the code, Eclipse does not give any Error during compilation. But, at runtime, I get the following Error.
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 10 in the jsp file: /BeerAdvice.jsp
    Syntax error, annotations are only available if source level is 5.0
    7: <p>
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
    The type List is not generic; it cannot be parameterized with arguments <String>
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    14:      out.print("<br>try: " + it.next());
    An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
    Syntax error, parameterized types are only available if source level is 5.0
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    14:      out.print("<br>try: " + it.next());
    Any help is very much appreciated.
    Thank you for your help.
    Thanks,
    Chubha

    Hi anotherAikman,
    Thank you for your help. I currently have the following version of the Java.
    {color:#800000}java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
    {color:#000000}{color:#000000}Does it mean I have Java SE Version 6 Update 17 and you are suggesting me to download the Java EE Version 6?{color} If this is correct, can you please let me know what difference does it make?
    I am now going to install the Java EE 6 and try this out.
    Thank you for your help.{color}
    {color:#000000}Thanks,
    Chubha{color}
    {color}

  • What does and mean in "List String "?

    Anyone familiair with this line:
    List<String> list = new ArrayList<String>(c)what does the "<String>" part precisely mean? I've been through the documentation, but I've not been able to find out what those "<" and ">" represent. Now I know that brackets ("[ ]") are used for arrays, but I doubt wether it's an principal equallity.
    So if someone knows its true meaning and/or has a nice URL for me to glance through some nice documentation...
    Thanks in advance!
    Tensos

    too late, it already did... seeing the code below (encountered in the general
    documentation), I'm afraid you're right...
    Object[] toArray();
    <T> T[] toArray(T[] a);An extra functionality is fine with me, but it is a
    pity that it doesn't make the code more easy readible
    (yet).It's easy to read once you get used to it, and I don't know how they would have been able to add generics with a syntax which is easier to understand, and yet is compact.
    Kaj

  • Returning List String or String[][] in JNI

    Hi,
    I am calling a native function in C++ from Java which has to return List<String> or String[][]. Is this possible?
    The java declaration is - private native List<String> GetListNative();
    In C++ the declaration is:
    JNIEXPORT jobject JNICALL Java_com_GetListNative
    (JNIEnv *env, jobject obj);
    Please help!
    Thanks in advance...
    Message was edited by:
    arjundg

    try treating String[][] as array of arrays of strings
    I mean consider your 2D array as a 1D array and each of its elements is an array of Strings
    I think this will work

  • SharePoint Btach Process with List string items into list

    Hi 
    I have a List<string> with 8000 elements.
    I need to take 1000 everytime and run the batch process to insert data into list.
    I cant apply all 8000 items in one shot.
    Can you please suggest me that how  i can query List<string> and execute.
    Thanks
    Siddartha

    You need to use Skip and Take methods of your object collection.
    Example:
    list.Skip(1000).Take(1000)
    This would skip the first 1000 and take the next 1000.
    You'd just need to increase the amount skipped with each call
    List<string> list = new List<string>();
    //Code to get 8000 elements
    for (int index = 0; index < 8; index++)
    List<string> batchList = GetBatch(index, list);
    //Code to insert data into list
    And here is the GetBatch method...
    public List<string> GetBatch(int pageNumber, List<string> list)
    return list.Skip(pageNumber * 1000).Take(1000);
    I found the answer
    here.

  • Statements like 'List String .class' cause error.

    Consider the following simple code:
        Class<List<String>> cl;
        cl=List<String>.class;The first line is valid but the second one causes the "illegal start of expression" error.
    That's rather strange: the type
    Class<List<String>>is valid itself, but variables of that type cannot be assigned via the ".class" expression.
    Is this a bug or I am missing something?
    Thanks.

    Java generics aren't C++ templates; they don't cause new classes to be created based on parameter type.
    What this means is that for types...
    List<String> stringList = new ArrayList<String>();
    List<Number> numberList = new ArrayList<Number>();...the class of those lists is, in both cases, java.util.ArrayList...
    string.getClass().equals(ArrayList.class);
    numberList.getClass().equals(ArrayList.class);Neither class ArrayList<String> nor class ArrayList<Number> exist, because such generics information is wiped out at runtime. That's why an expression like...
    ArrayList<Number>.class...is illegal.

  • IntialContext.list(String args) not implemented in iAS 6.5 Any other workarounds?

    Hi,
    I tried using initialContext.list(string) method and I got OperationNotSupported exception. Looks like its not implemented in iAS 6.5. Is there any other way I can obtain a list of the JNDI tree ? How about any proprietary APIs ?
    thanks,
    sreenivas

    When you drop something onto a spark List you need to provide a non null dragSource in the "itemsByIndex" format, if you change your code to something like this it should work:
                protected function draggableLabel_mouseDownHandler(event:MouseEvent):void {
                    // make some data to pass to the List
                    var someData:Vector.<Object> = new Vector.<Object>();
                    someData.push("hello world");
                    // List expects drag data with "itemsByIndex" format
                    var dragData:DragSource= new DragSource();
                    dragData.addData(someData, "itemsByIndex");
                    DragManager.doDrag(event.currentTarget as IUIComponent,dragData,event);

  • Another Tutorial Error? List String [] lsa = new List ? [10];

    Quote from Gilad Bracha's tutorial:List<String>[] lsa = new List<?>[10]; // unchecked warning - this is unsafeAt least with jdk 1.5.0_01 it does not compile at all, but gives compile error "incompatioble types. found java.,util.List<?>[]. reuired java.util.List<java.lang.String>".
    This one however gives an unchecked warning:List<String>[] lsb = (List<String>[]) new List<?>[10];

    An error in the tutorial. Thanks for noticing. I've told Gilad.

  • JPA2 Question: Is it possible to map a Map(enum, List String ) in JPA2?

    Is it possible to map a Map(enum, List<String>) in JPA2? Or do I have to create a separate Entity class that maps each List<String> collections for each possible value in the enum?
    Edited by: user7976113 on Jan 22, 2010 7:51 PM
    Edited by: user7976113 on Jan 22, 2010 7:51 PM

    No, JPA does not support this or any nested collection type of mappings directly.
    The best solution is to create an Entity or Embeddable to contain the collection data.
    See,
    http://en.wikibooks.org/wiki/Java_Persistence/Relationships#Nested_Collections.2C_Maps_and_Matrices
    James : http://www.eclipselink.org

  • Traversing var of type List List String

    hello all,
    i hope someone can help me with this little problem.
    im still a newbie on java devt.
    the problem is, i have retrieved some records from a database
    and i am trying to display it on a table. but i am having some issues
    with traversing the info returned to me, which is of type List<List<String>>.
    im using SWT by the way.
    here is the code snippet of my function:
    ================================
    * Displays the search result on the table
    * @param searchResult - search result returned after db query
    public void populateTable (List<List<String>> searchResult) {
    logger_.debug("===SearchView::populateTable()=== - START");
    logger_.debug("searchResult received: " + searchResult.toString());
    //traverse rows
    List <String> row = new ArrayList<String>();
    for (int i = 0; i < searchResult.size(); ++i) {
    row = searchResult.get(i);
    logger_.debug("row value: " + row);
    if ( (row != null) && (!row.isEmpty()) ) {
    //get row attribs
    String custId = row.get(0);
    String custName = row.get(1);
    String custAdd = row.get(2);
    String custContact = row.get(10);
    String custPhone = row.get(11);
    TableItem tableItem = new TableItem(searchTable_, SWT.NONE);
    tableItem.setText( new String[] { custId, custName, custAdd, custContact, custPhone } );
    logger_.debug("===SearchView::populateTable()=== - END");
    ================================
    thanks,
    doods

         * Displays the search result on the table
         * @param searchResult
        public void populateTable (List<List<String>> searchResult) {
            logger_.debug("===SearchView::populateTable()=== - START");
            logger_.debug("searchResult received " + searchResult.toString());
            logger_.debug("searchResult.size() = " + searchResult.size());
            //traverse rows
            List <String> row = new ArrayList<String>();
            for (int i = 0; i < searchResult.size(); ++i) {
                row = searchResult.get(i);
                logger_.debug("row value: " + row);
                if ( (row != null) && (!row.isEmpty()) ) {
                    //get row attribs
                    String custId = row.get(0);
                    String custName = row.get(1);
                    String custAdd = row.get(2);
                    String custContact = row.get(10);
                    String custPhone = row.get(11);
                    TableItem tableItem = new TableItem(searchTable_, SWT.NONE);
                    tableItem.setText( new String[] { custId, custName, custAdd, custContact, custPhone } );
    //        Iterator <List<String>> iter = searchResult.iterator();
    //        List <String> row = new ArrayList<String>();
    //        while (iter.hasNext()) {
    //            row = iter.next();
    //            String custId = row.get(0);
    //            String custName = row.get(1);
    //            String custAdd = row.get(2);
    //            String custContact = row.get(10);
    //            String custPhone = row.get(11);
    //            logger_.debug(row.toString());
    //            logger_.debug(row.size());
    //            TableItem tableItem = new TableItem(searchTable_, SWT.NONE);
    //            tableItem.setText( new String[] { custId, custName, custAdd, custContact, custPhone } );
            logger_.debug("===SearchView::populateTable()=== - END");
        }sorry bout the code formatting.
    i have already tried using the iterator but it doesn't work.
    is this the right way to use the iterator?
    i commented it out already.
    basically, the searchResult returns 3 rows,
    when i try to print the records on the table, it displays 3 rows
    but the info on those 3 rows are all from the first row.
    ex: row1 = doods, 123, aaa
    row2 = doodies, 333, bbb
    row3 = doodles, 444, ccc
    whats printed on the table:
    doods, 123, aaa
    doods, 123, aaa
    doods, 123, aaa

  • C# SSIS Script component - Save List String to Object package-scope variable and read it in Script Task

    before posting this i was searching this on internet but was not able to find info regarding my specific case:
    i have a DataFlow Task with "Error output" pointing from FlatFile to
    Script Component that does below (variable "ErrorMessageList" is listed under ReadWriteVariables property):
    List<string> lsErrors = new List<string>();
    public override void Input0_ProcessInputRow(Input0Buffer Row)
    lsErrors.Add("test1");
    lsErrors.Add("test2");
        void PostExecute()
            base.PostExecute();
            Variables.ErrorMessageList = lsErrors;
    Then the DataFlow points to a ScriptComponent where this object variable is listed under ReadOnlyVariables property and does the below:
    public void Main()
    List<string> lsErrors = (List<string>)Dts.Variables["ErrorMessageList"].Value;
    and that is where i get exception-has-been-thrown-by-the-target-of-an-invocation
    What is wrong here?
    (i have mistakenly edited this first post before, so i tried to manually put it back to original version)

    i have missed the "override" keyword...
    public class ScriptMain : UserComponent
    public class UserComponent: ScriptComponent
    namespace Microsoft.SqlServer.Dts.Pipeline
    public class ScriptComponent
    // i should have seen this before
    public virtual void PostExecute();
    i believe i must have deleted the PostExecute method definition right after the ScriptComponent generated the script for me... and then when i've realized that i can't change ReadWriteVariables as a part of:
    public override void Input0_ProcessInputRow(Input0Buffer Row)
    // --- can't change ReadWriteVariables here
    then i had to add the method back but forgot that the base method is virtual
    thanks for this hint, Russ!

  • Any way to assign value for  variable of type Class List String ?

    I'm puzzled why I can declare a variable:
    Class<List<String>> clazz;but I cannot assign a value to it as
    clazz = List<String>.class;The compiler also complains about
    Class<List<?>> clazz0 = List<?>.class;yet it has the nerve to warn about raw types when I give up and use
    Class<List> clazz0 = List.class;Even using a dummy instance does not work.
            List<String> dummy = new ArrayList<String>();
            Class<List<String>> clazz1 = dummy.getClass();I only care because I've declared a method like
    public String useless( Class<List<String>> unSetable){
      return  unSetable.getName();
    }And now there seems to be no way to call it.

    Hello chymes,
    there is no way to get an instance of Class<List<String>> without at least one unchecked warning. Otherwise you could get away with the following:
    List<Integer> ints = new ArrayList<Integer>();
    Class<List<String>> clazz = List<String>.class;
    List<String> strings = clazz.cast(ints);
    strings.add("No Good");
    int i = ints.get(0); // CCETherefore the only way to get it is via unchecked cast:
    Class<List<String>> clazz = (Class<List<String>>) (Object) List.class;With kind regards
    Ben

  • Error  to the past in the Eclipse - List String tags = Arrays.asList("Hello", "Tutorial"); in

    Hi,
    When I past the Setting properties List<String> tags = Arrays.asList("Hello", "Tutorial"); in the Eclipse I have this error:
    The type List is not generic; it cannot be parameterized with arguments <String>            HelloWorldServlet.java      /hello-world/src/com/sap/cloud/sample/helloworld      line 98           Java Problem
    Why?
    Weides

    Hi Weides...
    Maybe, accidently, when you first hit "organize imports" after you pasted that code fragment, and you were asked which "List" you want to import most probably you selected java.awt.List (In java you have at least the awt list and the java.util.List)
    Now... do the following:
    1. Delete the import statement of import java.awt.List and delete the import java.util.List
    2. Put back List<String>
    3. Then, Organize Imports again , and when it prompted for the choice, choose java.util.List.
    I hope that works for you.
    Regards.
    (PD. Useful checks will be appreciated)

  • OutOfMemoryError: Java heap space when using List String

    Hey folks,
    i stumbled about the following problem: I want to read IDs from a textfile (around 100.000 lines) an store them in a List or HashMap for later use. When I store them as Integers there is no problem, but when I store them as Strings I quickly run out of memory. The IDs are 6 chars long, so an Integer would use 2 Bytes and an unicode String 12. When I run the following code the memeory usage is ca. 13 MB, but when nbot commenting out the add-command for the string list, it qucikly raises up to ca. 70 MB and then throws the OutOfMemoryError. I tried a run with -mx1024M then the programm succesfully terminates but it uses a peak heap of 300 MB! Can anyone explain these differences?
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.InputStreamReader;
    import java.util.ArrayList;
    public class ReadTheFile {
         public static void main(String[] args) {
              try {
                   // read file
                 BufferedReader in =
                      new BufferedReader(
                           new InputStreamReader(
                                new FileInputStream(args[0]), "UTF-8"));
                 ArrayList<Integer> list1 = new ArrayList<Integer>();
                 ArrayList<String> list2 = new ArrayList<String>();
                 String line;
                 while ((line = in.readLine()) != null) {
                     String str = line.substring(10, 16);
                     list1.add(Integer.valueOf(str));
                     //list2.add(str);
              } catch (Exception e) {
                   e.printStackTrace();
    }Any help would be appreciated. Thanks.
    schneidexe
    P.S.: I also tried HashMaps instead of List, same failure! :-(
    Edited by: schneidexe on Feb 7, 2008 4:15 PM

    kajbj wrote:
    kajbj wrote:
    What happens if you replace the line
    String str = line.substring(10, 16);
    with
    String str = new String(line.substring(10, 16));
    ?I should probably explain why I want this tested.
    A call to substring creates a substring that chares the character data with the original string (in this case the whole line), so all of your substrings are still forcing the whole lines to be kept in memory. Calling new String() on the substrings will create a new string that doesn't share the character data, so the char[] will be truncated and the string that is referencing the whole line can be GC:ed
    KajThat did it! Thank you very much. I did not test this, because I generated the substring in both cases. But I think in the first case (w/o storing in in the List) the GC frees the memeory because the generated substring isn't used anymore after it's creation.
    So thanx again!
    schneidexe
    P.S.: I'm using Java 1.6.0-b105

Maybe you are looking for

  • Using CFmail with gmail

    Hi, hope you can help me! I'm running developer, and I'm having some big issues getting cfmail to work. When I try to connect to gmail (smtp.gmail.com port 587) I get this: This exception was caused by: javax.mail.MessagingException: 530 5.7.0 Must i

  • Improving Performance of Dynamic SQL in Pro*C

    I am using Dynamic sql format 3 in pro*C, i.e prepare sqlstmt from :sql_stmt declare cursor c1 for sqlstmt But the query is slow .I am also using order by with ltrim(rtrim(colname)) & sometimes group by . can anyone tell how to improve performance of

  • QT 7.1.3 stalls when tring to play an iPOD (H.264) video file

    Here we go again. I've spend already 2 night on getting iTunes 7 +QT 7.1.3 working. Now I'm at the point iTunes works fine, but I cannot preview any movies (H.264 encoded for the iPOD). I've identified QT as the source of the problem. 7.1.0 did work

  • TPEPROTO (9) Error when calling Tuxedo

    Hello All, I read the manual for the quick start guide to weblogic tuxedo connector, I wrote my ejb as per the sample and followed all the config steps of the manual. Now when I do a tmadmin->psc command I can see all my servers running DMADM, GWADM,

  • HT5312 i need to change the email address of apple id to my old email how can i do that?

    I need to change my apple id current email address to my old email address how can i do that??