Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
bed79dcf
Commit
bed79dcf
authored
Dec 08, 2015
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-995: Parent plugin identification should not be case-sensitive.
parent
2b95af59
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
42 deletions
+18
-42
PluginManager.java
...va/org/jivesoftware/openfire/container/PluginManager.java
+18
-42
No files found.
src/java/org/jivesoftware/openfire/container/PluginManager.java
View file @
bed79dcf
...
...
@@ -44,18 +44,7 @@ import java.nio.file.Paths;
import
java.nio.file.SimpleFileVisitor
;
import
java.nio.file.StandardCopyOption
;
import
java.nio.file.attribute.BasicFileAttributes
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.StringTokenizer
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.*
;
import
java.util.concurrent.CopyOnWriteArraySet
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
...
...
@@ -105,14 +94,14 @@ public class PluginManager {
*/
public
PluginManager
(
File
pluginDir
)
{
this
.
pluginDirectory
=
pluginDir
.
toPath
();
plugins
=
new
ConcurrentHashMap
<>(
);
plugins
=
new
TreeMap
<>(
String
.
CASE_INSENSITIVE_ORDER
);
pluginDirs
=
new
HashMap
<>();
pluginFiles
=
new
HashMap
<>(
);
pluginFiles
=
new
TreeMap
<>(
String
.
CASE_INSENSITIVE_ORDER
);
classloaders
=
new
HashMap
<>();
pluginDevelopment
=
new
HashMap
<>();
parentPluginMap
=
new
HashMap
<>();
childPluginMap
=
new
HashMap
<>();
devPlugins
=
new
HashSet
<>(
);
devPlugins
=
new
TreeSet
<>(
String
.
CASE_INSENSITIVE_ORDER
);
pluginMonitor
=
new
PluginMonitor
();
}
...
...
@@ -330,33 +319,13 @@ public class PluginManager {
}
else
{
// See if the parent plugin exists but just hasn't been loaded yet.
// This can only be the case if this plugin name is alphabetically before
// the parent.
if
(
pluginName
.
compareTo
(
parentPlugin
)
<
0
)
{
// See if the parent exists.
Path
file
=
pluginDir
.
getParent
().
resolve
(
parentPlugin
+
".jar"
);
if
(
Files
.
exists
(
file
))
{
final
Set
<
String
>
plugins
=
new
TreeSet
<>(
String
.
CASE_INSENSITIVE_ORDER
);
plugins
.
addAll
(
Arrays
.
asList
(
pluginDir
.
getParent
().
toFile
().
list
()
)
);
if
(
plugins
.
contains
(
parentPlugin
+
".jar"
)
||
plugins
.
contains
(
parentPlugin
+
".war"
)
)
{
// Silently return. The child plugin will get loaded up on the next
// plugin load run after the parent.
return
;
}
else
{
file
=
pluginDir
.
getParent
().
resolve
(
parentPlugin
+
".war"
);
if
(
Files
.
exists
(
file
))
{
// Silently return. The child plugin will get loaded up on the next
// plugin load run after the parent.
return
;
}
else
{
String
msg
=
"Ignoring plugin "
+
pluginName
+
": parent plugin "
+
parentPlugin
+
" not present."
;
Log
.
warn
(
msg
);
System
.
out
.
println
(
msg
);
return
;
}
}
}
else
{
}
else
{
String
msg
=
"Ignoring plugin "
+
pluginName
+
": parent plugin "
+
parentPlugin
+
" not present."
;
Log
.
warn
(
msg
);
...
...
@@ -423,6 +392,13 @@ public class PluginManager {
// If this is a child plugin, register it as such.
if
(
parentPluginNode
!=
null
)
{
String
parentPlugin
=
parentPluginNode
.
getTextTrim
();
// The name of the parent plugin as specified in plugin.xml might have incorrect casing. Lookup the correct name.
for
(
Map
.
Entry
<
String
,
Plugin
>
entry
:
plugins
.
entrySet
()
)
{
if
(
entry
.
getKey
().
equalsIgnoreCase
(
parentPlugin
)
)
{
parentPlugin
=
entry
.
getKey
();
break
;
}
}
List
<
String
>
childrenPlugins
=
parentPluginMap
.
get
(
plugins
.
get
(
parentPlugin
));
if
(
childrenPlugins
==
null
)
{
childrenPlugins
=
new
ArrayList
<>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment