Skip to content

Commit c57f9e5

Browse files
committed
Fix #113 - the class loading should also catch linkage errors, which can potentially arise in very valid situations.
1 parent 9dc43dd commit c57f9e5

File tree

3 files changed

+34
-40
lines changed

3 files changed

+34
-40
lines changed

CHANGES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# IDEA Community VCS Integration for Perforce
22

3+
## ::v0.7.9::
4+
5+
### Overview
6+
7+
* Bug fixes.
8+
9+
### Details
10+
11+
* Bug fixes.
12+
* Android Studio and other non-JRE 8 IDEs can fail to load the
13+
plugin. Now, all the class loading errors should be caught
14+
when loading the compatibility libraries. (#113)
15+
16+
317
## ::v0.7.8::
418

519
### Overview

idea-compat/src/net/groboclown/idea/p4ic/compat/CompatFactoryLoader.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,21 @@ public static CompatFactory loadCompatFactory() {
8282
private static CompatFactory loadCompatFactory(@NotNull String apiVersion, ClassLoader[] loaders) {
8383
CompatFactory best = null;
8484
for (ClassLoader loader: loaders) {
85-
try
86-
{
87-
for (CompatFactory factory : ServiceLoader.load(CompatFactory.class, loader))
88-
{
89-
if (isCompatible(apiVersion, factory) && isBetterVersion(best, factory))
90-
{
85+
try {
86+
for (CompatFactory factory : ServiceLoader.load(CompatFactory.class, loader)) {
87+
if (isCompatible(apiVersion, factory) && isBetterVersion(best, factory)) {
9188
best = factory;
9289
}
9390
}
94-
}
95-
catch (ServiceConfigurationError e)
96-
{
91+
} catch (ServiceConfigurationError e) {
9792
LOG.error(e);
93+
} catch (LinkageError e) {
94+
// bug #113
95+
// The IDE classes aren't matching up with the expected signatures,
96+
// the classes are compiled with an incompatible JRE,
97+
// or any number of other issues that shouldn't stop
98+
// the plugin from loading.
99+
LOG.warn(e);
98100
}
99101
}
100102
return best;

plugin/META-INF/plugin.xml

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
<idea-plugin version="2">
22
<name>Perforce IDEA Community Integration</name>
33
<id>PerforceIC</id>
4-
<version>0.7.8</version>
4+
<version>0.7.9</version>
55
<idea-version since-build="IC-135.1286"/>
66
<category>VCS Integration</category>
77
<change-notes><![CDATA[
88
<ol>
9+
<li><em>0.7.9</em>
10+
<ol>
11+
<li>Android Studio and other non-JRE 8 IDEs can
12+
fail to load the plugin. Now, all the class
13+
loading errors should be caught when loading the
14+
compatibility libraries.</li>
15+
</ol>
16+
</li>
917
<li><em>0.7.8</em>
1018
<ol>
1119
<li>Initial project VCS setup no longer
@@ -17,36 +25,6 @@
1725
reported by the server.</li>
1826
</ol>
1927
</li>
20-
<li><em>0.7.7</em>
21-
<ol>
22-
<li>Fixed an issue where the user may be
23-
told repeatedly that their password is wrong,
24-
even though it's correct.</li>
25-
</ol>
26-
</li>
27-
<li><em>0.7.6</em>
28-
<ol>
29-
<li>Switched to using MD5 hash codes when comparing if a file is actually
30-
edited but not checked out.</li>
31-
<li>Added user preference to disable server-side file comparison when checking
32-
for edited but not checked out status.</li>
33-
<li>Added user preference for switching between showing revision numbers and
34-
changelist numbers.</li>
35-
<li>Fixed compilation errors against the latest IDEA version of the
36-
primary plugin. This may result in you needing to reload your
37-
Perforce configuration.</li>
38-
<li>Should now always authenticate once the server reports that the
39-
user requires authentication. This should also fix the
40-
issue where the plugin can continuously ask for the password;
41-
this could happen if you use the configuration file without
42-
specifying an authentication ticket or a password.</li>
43-
<li>Fixed a deadlock associated with initial startup when asking the
44-
user for the master IDEA password.</li>
45-
<li>Fixed submit issue where only the error would be reported;
46-
now, all messages are reported to the user.</li>
47-
<li>Fixed ignored tick marks (') in messages.</li>
48-
</ol>
49-
</li>
5028
</ol>
5129
]]></change-notes>
5230
<description><![CDATA[

0 commit comments

Comments
 (0)