Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Preference setValue problem
Preference setValue problem [message #56961] Sat, 18 April 2009 22:52 Go to next message
Papic Milan is currently offline Papic MilanFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,

i have the problem that when i set two string values thw output is not the
same.

Here my code:

Preferences store = Activator.getDefault().getPluginPreferences();

store.setValue(PreferenceConstants.OAUTH_TOKEN, token.getToken());
System.out.println("A1:"+store.getString(PreferenceConstants.OAUTH_TOKEN));

store.setValue(PreferenceConstants.OAUTH_TOKENSECRET,token.g etTokenSecret());
System.out.println("B1:"+store.getString(PreferenceConstants.OAUTH_TOKENSECRET));

String a = store.getString(PreferenceConstants.OAUTH_TOKEN);
String b = store.getString(PreferenceConstants.OAUTH_TOKENSECRET);
System.out.println("A:"+a);
System.out.println("B:"+b);


The thing is that my output for A: and B: shows the same values not like
for A1: and B1:

Here the result:

A1: 2000-52566-36D555252352352523525
B1: vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777

A:vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777
B:vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777

what am i missing ...
Regards
Ivan
Re: Preference setValue problem [message #56987 is a reply to message #56961] Sun, 19 April 2009 04:44 Go to previous message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
Papic Milan wrote:
> Hello,
> i have the problem that when i set two string values thw output is not
> the same.
>
> Here my code:
> Preferences store = Activator.getDefault().getPluginPreferences();
> store.setValue(PreferenceConstants.OAUTH_TOKEN, token.getToken());
> System.out.println("A1:"+store.getString(PreferenceConstants.OAUTH_TOKEN));
>
> store.setValue(PreferenceConstants.OAUTH_TOKENSECRET,token.g etTokenSecret());
> System.out.println("B1:"+store.getString(PreferenceConstants.OAUTH_TOKENSECRET));
>
> String a = store.getString(PreferenceConstants.OAUTH_TOKEN);
> String b = store.getString(PreferenceConstants.OAUTH_TOKENSECRET);
> System.out.println("A:"+a);
> System.out.println("B:"+b);
>
>
> The thing is that my output for A: and B: shows the same values not like
> for A1: and B1:
>
> Here the result:
>
> A1: 2000-52566-36D555252352352523525
> B1: vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777
>
> A:vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777
> B:vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777
> what am i missing ... Regards
> Ivan
>

1. One possibility is that PreferenceConstants.OAUTH_TOKEN and PreferenceConstants.OAUTH_TOKENSCERT
constants refer to same string.

2. Whats your eclipse verion? Preferences has been deprecated and IEclipsePreferences is the new
recommended way to manage the preferences.

--
hth,
Ankur..
Re: Preference setValue problem [message #595857 is a reply to message #56961] Sun, 19 April 2009 04:44 Go to previous message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
Papic Milan wrote:
> Hello,
> i have the problem that when i set two string values thw output is not
> the same.
>
> Here my code:
> Preferences store = Activator.getDefault().getPluginPreferences();
> store.setValue(PreferenceConstants.OAUTH_TOKEN, token.getToken());
> System.out.println("A1:"+store.getString(PreferenceConstants.OAUTH_TOKEN));
>
> store.setValue(PreferenceConstants.OAUTH_TOKENSECRET,token.g etTokenSecret());
> System.out.println("B1:"+store.getString(PreferenceConstants.OAUTH_TOKENSECRET));
>
> String a = store.getString(PreferenceConstants.OAUTH_TOKEN);
> String b = store.getString(PreferenceConstants.OAUTH_TOKENSECRET);
> System.out.println("A:"+a);
> System.out.println("B:"+b);
>
>
> The thing is that my output for A: and B: shows the same values not like
> for A1: and B1:
>
> Here the result:
>
> A1: 2000-52566-36D555252352352523525
> B1: vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777
>
> A:vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777
> B:vbXDDhhka67aRDk5fhPcDJ1j7dppxRR46777
> what am i missing ... Regards
> Ivan
>

1. One possibility is that PreferenceConstants.OAUTH_TOKEN and PreferenceConstants.OAUTH_TOKENSCERT
constants refer to same string.

2. Whats your eclipse verion? Preferences has been deprecated and IEclipsePreferences is the new
recommended way to manage the preferences.

--
hth,
Ankur..
Previous Topic:Preference setValue problem
Next Topic:Problem with headless build on Eclipse 3.4.2
Goto Forum:
  


Current Time: Thu Jun 24 10:35:02 GMT 2021

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

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

Back to the top