Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fix for [PAXSB-54] ServiceLookup.getService() returns invalid Service instances #1

Merged
merged 4 commits into from about 2 years ago

2 participants

Timo Naroska Andreas Pieber
Timo Naroska
Collaborator

No description provided.

...a/org/ops4j/pax/swissbox/framework/ServiceLookup.java
@@ -96,7 +96,8 @@
96 96 {
97 97 throw new ServiceLookupException( "gave up waiting for service " + className );
98 98 }
99   - return (T) svc;
  99 + // increment the service use count to keep it valid after the ServiceTracker is closed
2
Andreas Pieber Owner
anpieber added a note

does it look only strange in this browser or is there really a formatting issue? (spaces/tabs)

Timo Naroska Collaborator
tnaroska added a note

You're right. Thanks for catching this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Andreas Pieber
Owner

pls check the formatting; otherwise I've given you push access to the project (well, ops4j == open participation software for java :-))

Timo Naroska tnaroska merged commit 7ea9bac into from
Timo Naroska tnaroska closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
6 pax-swissbox-framework/src/main/java/org/ops4j/pax/swissbox/framework/ServiceLookup.java
@@ -96,7 +96,8 @@
96 96 {
97 97 throw new ServiceLookupException( "gave up waiting for service " + className );
98 98 }
99   - return (T) svc;
  99 + // increment the service use count to keep it valid after the ServiceTracker is closed
  100 + return (T) bc.getService(tracker.getServiceReference());
100 101 }
101 102 catch ( InterruptedException exc )
102 103 {
@@ -121,7 +122,8 @@
121 122 {
122 123 throw new ServiceLookupException( "gave up waiting for service " + className );
123 124 }
124   - return (T) svc;
  125 + // increment the service use count to keep it valid after the ServiceTracker is closed
  126 + return (T) bc.getService(tracker.getServiceReference());
125 127 }
126 128 catch ( InterruptedException exc )
127 129 {
2  samples/manifest-extender/pom.xml
@@ -6,7 +6,7 @@
6 6 <parent>
7 7 <groupId>org.ops4j.pax.swissbox</groupId>
8 8 <artifactId>samples</artifactId>
9   - <version>1.5.0-SNAPSHOT</version>
  9 + <version>1.6.0-SNAPSHOT</version>
10 10 <relativePath>../pom.xml</relativePath>
11 11 </parent>
12 12
4 samples/pom.xml
@@ -6,13 +6,13 @@
6 6 <parent>
7 7 <groupId>org.ops4j.pax</groupId>
8 8 <artifactId>swissbox</artifactId>
9   - <version>1.5.0-SNAPSHOT</version>
  9 + <version>1.6.0-SNAPSHOT</version>
10 10 <relativePath>../pom.xml</relativePath>
11 11 </parent>
12 12
13 13 <groupId>org.ops4j.pax.swissbox</groupId>
14 14 <artifactId>samples</artifactId>
15   - <version>1.5.0-SNAPSHOT</version>
  15 + <version>1.6.0-SNAPSHOT</version>
16 16 <packaging>pom</packaging>
17 17
18 18 <name>OPS4J Pax Swissbox :: Samples</name>

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.