Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » The return of the missing prefs
The return of the missing prefs [message #381329] Wed, 26 November 2008 23:03 Go to next message
Guillaume Chatelet is currently offline Guillaume ChateletFriend
Messages: 146
Registered: July 2009
Senior Member
Hello,

Within Eclipse, using the subclipse plugin I'm trying to resolve a
query. It fails while trying to read
..settings/org.eclipse.buckminster.core.prefs#HEAD which actually doesn't
exists. The .settings folder exists but not the pref file.

I tracked the bug down to this piece of code, in
/org.eclipse.buckminster.core/src/java/org/eclipse/buckminst er/core/reader/AbstractCatalogReader.java
l.88

> public synchronized IEclipsePreferences readBuckminsterPreferences(IProgressMonitor monitor) throws CoreException
> {
> if(m_prefStateKnown)
> {
> MonitorUtils.complete(monitor);
> return m_preferences;
> }
>
> try
> {
> m_preferences = readFile(EclipsePreferencesReader.BUCKMINSTER_PROJECT_PREFS_ PATH, EclipsePreferencesReader.INSTANCE, monitor);
> return m_preferences;
> }
> catch(FileNotFoundException e)
> {
> return null;
> }
> catch(IOException e)
> {
> throw BuckminsterException.wrap(e);
> }
> finally
> {
> m_prefStateKnown = true;
> }
> }

What is expected to happen is that readFile should fail and throw a
FileNotFoundException but actually this function throws an IOException
which cancels the resolution.

Actually this IOException is thrown from a much deeper piece of code, in
/org.eclipse.buckminster.subclipse/src/java/org/eclipse/buck minster/subclipse/internal/SvnRemoteFileReader.java,
function innerGetContents, l.219

In this function the line that throws the exception is the following (l.255)
input = clientAdapter.getContent(url, revision);

This lines throws a SVNClientException which is catched and rethrown as
IOException.

Thomas, I can fix this but I'm not sure where the fix should be ?

Best regards,
Guillaume
Re: The return of the missing prefs [message #381331 is a reply to message #381329] Thu, 27 November 2008 07:31 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Guillaume,

Guillaume Chatelet wrote:
> This lines throws a SVNClientException which is catched and rethrown as
> IOException.
>
> Thomas, I can fix this but I'm not sure where the fix should be ?
>
This is where you see exception messages in French that doesn't match any of the messages
that the catch code uses to trigger the FileNotFoundException, correct?

We are currently in progress of externalizing strings into message bundles. It seems to me
that what's needed here is the ability to add message bundles for other languages that
will match the exception messages. I don't know any other way since there's nothing else
to use to distinguish a missing entry from say, a network failure.

The externalization will be completed in a day or two. Meanwhile, perhaps you could track
down the source of the messages so that we have something to start with when adding other
languages?

Regards,
Thomas Hallgren
Re: The return of the missing prefs [message #381332 is a reply to message #381331] Thu, 27 November 2008 08:00 Go to previous messageGo to next message
Guillaume Chatelet is currently offline Guillaume ChateletFriend
Messages: 146
Registered: July 2009
Senior Member
Thomas Hallgren wrote :
>
> The externalization will be completed in a day or two. Meanwhile,
> perhaps you could track down the source of the messages so that we have
> something to start with when adding other languages?
>
> Regards,
> Thomas Hallgren

This is quite easy indeed as subversion uses GetText.

Here is how I did.
-1- Download the sources ( http://subversion.tigris.org/servlets/ProjectDocumentList?fo lderID=260&expandFolder=74 )
-2- unpack
-3- go into subversion_archive_folder/subervsion/po
-4- run these commands :
grep -A1 "msgid \"'%s' path not found\"" *.po
grep -A1 "msgid \"Unable to find repository location for '%s' in revision %ld\"" *.po

And you'll get all the translations. I don't put them here because it will surely break the character encoding and so it would be useless.
However I have an issue with the first string you're testing : "file not found"
Actually this string doesn't appear directly within the po files. I have these possibilities (containing "not found"):

> msgid "Activity not found"
> msgid "Property not found"
> msgid "Path '%s' not found in revision %ld"
> msgid "Path '%s' not found in head revision"
> msgid "'%s' was not found in the repository at revision %ld"
> msgid "The VCC property was not found on the resource"
> msgid "The relative-path property was not found on the resource"
> msgid "The UUID property was not found on the resource or any of its parents"
> msgid "'%s' path not found"
> msgid "'%s' not found in filesystem"
> msgid "'%s' not found"
> msgid "Property '%s' not found on revision %ld"
> msgid "Property '%s' not found on path '%s' in revision %ld"
> msgid "Property '%s' not found on path '%s' in transaction %s"

Tell me which are relevant.

Cheers,
Guillaume
Re: The return of the missing prefs [message #381635 is a reply to message #381332] Sat, 13 December 2008 15:38 Go to previous message
Guillaume Chatelet is currently offline Guillaume ChateletFriend
Messages: 146
Registered: July 2009
Senior Member
I created this issue in Bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=258734 and committed a fix.

At first I used NLS i18n system but I quickly had to face it would not work.
It seems SVN Client and NLS doesn't use the same scheme to choose local language so NLS were loading the default version (english) and SVN client were using french error messages. So I wrote my own classes to handle the issue.

I then created a class ( org.eclipse.buckminster.subversion.utilities.ExceptionExtrac tor ) to parse subversion sources and extract interesting parts of relevant error messages. This code can parse at once multiple versions of subversion's source code and gathers the relevant error parts into a property file ( svn_exception_messages.properties ). I generated this code for all languages of subversion version 1.4.2 (current javahl version) and 1.5.4. We can regenerate this file easily as new error messages are identified and new subversion version are released.

This file is then loaded as needed and used to see if an exception contains parts belonging to an identified error message.
It's then easy to test if an exception is a "file not found" or "path not found" or none of the messages we're interested in.
Actually, for the moment I'm just testing if the exception's message contains identified error, I'm not testing for a particular one.

This fixes my issue with french svn client and the few other queries I've tested are still working properly.

Thomas, can I ask you to run a few tests and close the bug if you're ok with my work ?

Best regards,
Guillaume

Guillaume Chatelet wrote :
> Thomas Hallgren wrote :
>> The externalization will be completed in a day or two. Meanwhile,
>> perhaps you could track down the source of the messages so that we have
>> something to start with when adding other languages?
>>
>> Regards,
>> Thomas Hallgren
>
> This is quite easy indeed as subversion uses GetText.
>
> Here is how I did.
> -1- Download the sources ( http://subversion.tigris.org/servlets/ProjectDocumentList?fo lderID=260&expandFolder=74 )
> -2- unpack
> -3- go into subversion_archive_folder/subervsion/po
> -4- run these commands :
> grep -A1 "msgid \"'%s' path not found\"" *.po
> grep -A1 "msgid \"Unable to find repository location for '%s' in revision %ld\"" *.po
>
> And you'll get all the translations. I don't put them here because it will surely break the character encoding and so it would be useless.
> However I have an issue with the first string you're testing : "file not found"
> Actually this string doesn't appear directly within the po files. I have these possibilities (containing "not found"):
>
>> msgid "Activity not found"
>> msgid "Property not found"
>> msgid "Path '%s' not found in revision %ld"
>> msgid "Path '%s' not found in head revision"
>> msgid "'%s' was not found in the repository at revision %ld"
>> msgid "The VCC property was not found on the resource"
>> msgid "The relative-path property was not found on the resource"
>> msgid "The UUID property was not found on the resource or any of its parents"
>> msgid "'%s' path not found"
>> msgid "'%s' not found in filesystem"
>> msgid "'%s' not found"
>> msgid "Property '%s' not found on revision %ld"
>> msgid "Property '%s' not found on path '%s' in revision %ld"
>> msgid "Property '%s' not found on path '%s' in transaction %s"
>
> Tell me which are relevant.
>
> Cheers,
> Guillaume
Previous Topic:[Announce] Model Driven PDE Builds - a fresh perspective
Next Topic:Problems with generating CSpec
Goto Forum:
  


Current Time: Wed Sep 25 02:29:29 GMT 2024

Powered by FUDForum. Page generated in 0.05354 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top