Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libjitsi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZRTP
libjitsi
Commits
291d28a0
Commit
291d28a0
authored
11 years ago
by
Damian Minkov
Browse files
Options
Downloads
Patches
Plain Diff
Fixes removing properties with partial match, and adds tests for it.
parent
3ca63030
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/org/jitsi/impl/configuration/ConfigurationServiceImpl.java
+33
-18
33 additions, 18 deletions
...rg/jitsi/impl/configuration/ConfigurationServiceImpl.java
with
33 additions
and
18 deletions
src/org/jitsi/impl/configuration/ConfigurationServiceImpl.java
+
33
−
18
View file @
291d28a0
...
@@ -332,9 +332,34 @@ public void removeProperty(String propertyName)
...
@@ -332,9 +332,34 @@ public void removeProperty(String propertyName)
//remove all properties
//remove all properties
for
(
String
pName
:
childPropertyNames
)
for
(
String
pName
:
childPropertyNames
)
{
{
removeProperty
(
pName
);
removeProperty
Internal
(
pName
);
}
}
try
{
storeConfiguration
();
}
catch
(
IOException
ex
)
{
logger
.
error
(
"Failed to store configuration after "
+
"a property change"
);
}
}
/**
* Removes the property with the specified name. Calling
* this method would first trigger a PropertyChangeEvent that will
* be dispatched to all VetoableChangeListeners. In case no complaints
* (PropertyVetoException) have been received, the property will be actually
* changed and a PropertyChangeEvent will be dispatched.
* All properties with prefix propertyName will also be removed.
* <p>
* Does not store anything.
*
* @param propertyName the name of the property to change.
*/
private
void
removePropertyInternal
(
String
propertyName
)
{
Object
oldValue
=
getProperty
(
propertyName
);
Object
oldValue
=
getProperty
(
propertyName
);
//first check whether the change is ok with everyone
//first check whether the change is ok with everyone
if
(
changeEventDispatcher
.
hasVetoableChangeListeners
(
propertyName
))
if
(
changeEventDispatcher
.
hasVetoableChangeListeners
(
propertyName
))
...
@@ -352,16 +377,6 @@ public void removeProperty(String propertyName)
...
@@ -352,16 +377,6 @@ public void removeProperty(String propertyName)
if
(
changeEventDispatcher
.
hasPropertyChangeListeners
(
propertyName
))
if
(
changeEventDispatcher
.
hasPropertyChangeListeners
(
propertyName
))
changeEventDispatcher
.
firePropertyChange
(
changeEventDispatcher
.
firePropertyChange
(
propertyName
,
oldValue
,
null
);
propertyName
,
oldValue
,
null
);
try
{
storeConfiguration
();
}
catch
(
IOException
ex
)
{
logger
.
error
(
"Failed to store configuration after "
+
"a property change"
);
}
}
}
/**
/**
...
@@ -508,21 +523,21 @@ private Set<String> getPropertyNamesByPrefix(
...
@@ -508,21 +523,21 @@ private Set<String> getPropertyNamesByPrefix(
{
{
for
(
String
key
:
names
)
for
(
String
key
:
names
)
{
{
int
ix
=
key
.
lastIndexOf
(
'.'
);
if
(
exactPrefixMatch
)
{
int
ix
=
key
.
lastIndexOf
(
'.'
);
if
(
ix
==
-
1
)
if
(
ix
==
-
1
)
continue
;
continue
;
String
keyPrefix
=
key
.
substring
(
0
,
ix
);
String
keyPrefix
=
key
.
substring
(
0
,
ix
);
if
(
exactPrefixMatch
)
{
if
(
prefix
.
equals
(
keyPrefix
))
if
(
prefix
.
equals
(
keyPrefix
))
resultSet
.
add
(
key
);
resultSet
.
add
(
key
);
}
}
else
else
{
{
if
(
key
Prefix
.
startsWith
(
prefix
))
if
(
key
.
startsWith
(
prefix
))
resultSet
.
add
(
key
);
resultSet
.
add
(
key
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment