You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Charles Honton (JIRA)" <ji...@apache.org> on 2008/05/08 21:34:55 UTC

[jira] Created: (CONFIGURATION-324) INIConfiguration does not support line continuation

INIConfiguration does not support line continuation
---------------------------------------------------

                 Key: CONFIGURATION-324
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
             Project: Commons Configuration
          Issue Type: New Feature
          Components: Documentation, Format
    Affects Versions: 1.5
            Reporter: Charles Honton


INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:

[section1]
dotted.var1 = \
	foo
var2 = doodle

Produces the following contents:
    section1.dotted.var1= \
    section1.foo= 

I expected the following contents:
    section1.dotted.var1= foo


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Charles Honton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595600#action_12595600 ] 

Charles Honton commented on CONFIGURATION-324:
----------------------------------------------

It's not applications that produce line continuations, it's end users used to the properties file format that will create line continuations.

> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Priority: Minor
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732199#action_12732199 ] 

Ralph Goers commented on CONFIGURATION-324:
-------------------------------------------

Typically where I've seen this supported the continuation character has to be the last character on the line. If \ is followed by a blank it will not be a continuation. I've never much liked that since a blank is invisible most of the time. 

> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Assignee: Oliver Heger
>            Priority: Minor
>             Fix For: 1.6
>
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Charles Honton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595600#action_12595600 ] 

charles_honton@intuit.com edited comment on CONFIGURATION-324 at 5/9/08 7:23 AM:
----------------------------------------------------------------------

It's not applications that produce line continuations, it's end users used to the properties file format that will create line continuations.  I would expect any format supported by properties to be supported by Ini.  Wouldn't it be easy enough to reuse the properties reader?  

http://www.cloanto.com/specs/ini.html is a good definition of a tolerant ini file reader

      was (Author: charles_honton@intuit.com):
    It's not applications that produce line continuations, it's end users used to the properties file format that will create line continuations.  I would expect any format supported by properties to be supported by Ini.  Wouldn't it be easy enough to reuse the properties reader?
  
> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Priority: Minor
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Charles Honton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595600#action_12595600 ] 

charles_honton@intuit.com edited comment on CONFIGURATION-324 at 5/9/08 7:14 AM:
----------------------------------------------------------------------

It's not applications that produce line continuations, it's end users used to the properties file format that will create line continuations.  I would expect any format supported by properties to be supported by Ini.  Wouldn't it be easy enough to reuse the properties reader?

      was (Author: charles_honton@intuit.com):
    It's not applications that produce line continuations, it's end users used to the properties file format that will create line continuations.
  
> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Priority: Minor
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger resolved CONFIGURATION-324.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6

Support for line continuation has been added to {{HierarchicalINIConfiguration}}. I don't know whether really all possibilities are covered, but the unit tests check a bunch of corner cases, including quoted values and line comments. So the most important cases should be handled.

> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Assignee: Oliver Heger
>            Priority: Minor
>             Fix For: 1.6
>
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Joerg Schaible (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732375#action_12732375 ] 

Joerg Schaible commented on CONFIGURATION-324:
----------------------------------------------

bq. Typically where I've seen this supported the continuation character has to be the last character on the line. If \ is followed by a blank it will not be a continuation.

Luke's problem is that his ini files don't have a blank before the continuation character, but expect that a blank is automagically is added. However, I see such a behaviour also critical as Oliver's example with the Windows path shows.

> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Assignee: Oliver Heger
>            Priority: Minor
>             Fix For: 1.6
>
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg updated CONFIGURATION-324:
-----------------------------------------

      Priority: Minor  (was: Major)
    Issue Type: Improvement  (was: New Feature)

Is there an application that actually produce this kind of line continuation in INI files ? I've never seen this, and the wiki article doesn't seem very confident in the actual existence of the features presented :

{quote}The following is a list of some common features, which may or may not be implemented in any given program.{quote}

> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Priority: Minor
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732127#action_12732127 ] 

Oliver Heger commented on CONFIGURATION-324:
--------------------------------------------

This makes sense, however I am nor sure whether this approach would work with file paths defined in ini files. Consider a property declaration like

[section]
directory=C:\Programs\

I think that the backslash is typically not escaped if used in path names. So when applying the strategy you suggested we would continue this line, which is certainly not desired.

I don't know what would be the best way of dealing with this problem.

> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Assignee: Oliver Heger
>            Priority: Minor
>             Fix For: 1.6
>
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Luke Alford (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731154#action_12731154 ] 

Luke Alford commented on CONFIGURATION-324:
-------------------------------------------

Sorry to bring up something so picky, but I'm dealing with some annoying legacy configuration files.  One thing this solution does not address is the case where there is no whitespace in front of the line continuation character.  I think perhaps the requirement ought to simply be a not escaped backslash followed by a new line?

The following would not work.
[section]
key = this is\
a multiline\
test

But this works fine.
[section]
key = this is \
a multiline \
test

Here's a possible solution, my apologies for such a crude submission.  When I get more time, I'll see about submitting a patch for review.

private static boolean lineContinues(String line)
{
         String s = line.trim();
         return s.equals(LINE_CONT)
                 || (s.length() > 2 && s.endsWith(LINE_CONT) && !("\\".equals(s.charAt(s.length() - 2))));
}


> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Assignee: Oliver Heger
>            Priority: Minor
>             Fix For: 1.6
>
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-324) INIConfiguration does not support line continuation

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595671#action_12595671 ] 

Emmanuel Bourg commented on CONFIGURATION-324:
----------------------------------------------

The parser for properties files can't be reused as is unfortunately, there are several differences between the two formats, values can be quoted in an INI file for example, and it's also possible to put a comment after the value.

I wonder how we should handle line continuations combined with end of line comments. I guess we should support this:

{code}
foo = bar \ ; comment
      baz
{code}

but not this:

{code}
foo = bar ; comment \
      baz
{code}

> INIConfiguration does not support line continuation
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-324
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-324
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Documentation, Format
>    Affects Versions: 1.5
>            Reporter: Charles Honton
>            Priority: Minor
>
> INIConfiguration does not support line continuation.  See http://en.wikipedia.org/wiki/INI_file#Escapes for a description.  Using INIConfiguration to read the following file:
> [section1]
> dotted.var1 = \
> 	foo
> var2 = doodle
> Produces the following contents:
>     section1.dotted.var1= \
>     section1.foo= 
> I expected the following contents:
>     section1.dotted.var1= foo

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.