Community
Participate
Working Groups
3.1 RC1 Steps to reproduce: - Create standard plugin-project, using manifest.mf - Set line delimiter preference on plugin-project to something else than the platform default - Create a new extension (generates the plugin.xml) -> Regardless of the line delimiter preference, plugin.xml always contains platform line delimiters
To fix this bug, we must have something like write(String indent, String lineSeparator, PrintWriter writer) in the org.eclipse.pde.core.IWritable API
Without digging into the code, don't we have an IWritableDelimiter kicking around somewhere? Can't we just modify that?
I'm afraid that IWritableDelimiter#writeDelimiter isn't to be used to write new lines ; here is the javadoc (whose meaning is confirmed by a quick look at the call hierarchy of the method) /* Write a customized delimeter to the serialized stream that delimits the * text representation of multiple model objects selected. * This is applicable when serializing multiple objects for copy, cut and * paste operations. */ What happens is that every org.eclipse.pde.core.IWritable#write(indent, writer) implementor (e.g. org.eclipse.pde.internal.core.plugin.Plugin) makes call to writer.println(xxxxx) ; instead, it should call something like writer.print(xxxx + lineSeparator).
ah, duh, we need something like a IWritableLineDelimiter :P A patch against IWritable or creating a new IWritableLineDelimiter is fine with me.
*** Bug 222389 has been marked as a duplicate of this bug. ***
*** Bug 176014 has been marked as a duplicate of this bug. ***
It's the PrintWriter that's used to create the line separators. We should be able to create a subclass of PrintWriter that does the write thing when "println()" is called.
Created attachment 132983 [details] patch Here's a quick patch. However, this code path is not used at all when saving. Instaed the editor's document is saved in via the text framework. I'm not even sure this is an issue anymore - the text framework should be doing the right thing.
The print writer is not even used anymore. Closing as INVALID.
The steps from comment 0 still reproduce that problem. This bug was only about wrong initial line delimiters in the newly created plugin.xml. Bug 176014 is a problem with mixed line delimiters but without steps to reproduce. In the setup from comment 0, I could not reproduce mixed delimiters, even when I added another extension. Bug 222389 is probably unrelated to this bug. That problem is still reproducible and should be fixed since it introduces mixed line delimiters (in a command that should not touch the file at all).
Still an issue and build.properties is also wrong.
http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=18980200e4c26ca26e14ece96f915da84e43001f
Thx Dani!