Skip to content

Commit

Permalink
Update embedded org.osgi.util.tracker sources from 1.5.3 to 1.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Nov 6, 2023
1 parent 49b8e24 commit 7ab85da
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 43 deletions.
2 changes: 1 addition & 1 deletion bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Export-Package: org.eclipse.core.runtime.adaptor;x-friends:="org.eclipse.core.ru
org.osgi.service.resolver;version="1.1.1";uses:="org.osgi.resource",
org.osgi.service.startlevel;version="1.1.1";uses:="org.osgi.framework",
org.osgi.service.url;version="1.0.1",
org.osgi.util.tracker;version="1.5.3";uses:="org.osgi.framework"
org.osgi.util.tracker;version="1.5.4";uses:="org.osgi.framework"
Provide-Capability: osgi.service; objectClass:List<String>="org.osgi.service.log.LogReaderService,org.eclipse.equinox.log.ExtendedLogReaderService"; uses:="org.osgi.service.log",
osgi.service; objectClass:List<String>="org.osgi.service.log.LoggerFactory,org.osgi.service.log.LogService,org.eclipse.equinox.log.ExtendedLogService"; uses:="org.osgi.service.log",
osgi.service; objectClass:List<String>="org.osgi.service.log.admin.LoggerAdmin"; uses:="org.osgi.service.log.admin",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* Copyright (c) OSGi Alliance (2007, 2013). All Rights Reserved.
*
/*******************************************************************************
* Copyright (c) Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*
* SPDX-License-Identifier: Apache-2.0
*******************************************************************************/

package org.osgi.util.tracker;

Expand All @@ -34,7 +36,7 @@
* @param <T> The value mapped to the tracked item.
* @param <R> The reason the tracked item is being tracked or untracked.
* @ThreadSafe
* @author $Id$
* @author $Id: 687685a4755f24def9382a8132fb0740323669fe $

This comment has been minimized.

Copy link
@iloveeclipse

iloveeclipse Nov 10, 2023

Member

This change (and similar changes in all files in this commit) break git.
Checkout latest state and call git status

git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/AbstractTracked.java
        modified:   bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTracker.java
        modified:   bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTrackerCustomizer.java
        modified:   bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/ServiceTracker.java
        modified:   bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/ServiceTrackerCustomizer.java
        modified:   bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/package-info.java

The problem is that git expands $Id$ if .gitattributes contains ident attribute (and this is the case)...

This prevents me from rebasing any branch on master because git wants to undo "changes" first - but it fails to do so... https://stackoverflow.com/questions/21990758/way-to-disable-git-attribute-id-filter

This comment has been minimized.

Copy link
@tjwatson

tjwatson Nov 10, 2023

Contributor

#400 should fix this. Once merged you likely will need to do a fetch of master and force the local branch to update to it. I think Hannes must have used eGit/jGit to commit. Seem they still do not pay attention to .gitattributes for ident: https://bugs.eclipse.org/bugs/show_bug.cgi?id=452968

* @since 1.4
*/
abstract class AbstractTracked<S, T, R> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* Copyright (c) OSGi Alliance (2007, 2017). All Rights Reserved.
*
/*******************************************************************************
* Copyright (c) Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*
* SPDX-License-Identifier: Apache-2.0
*******************************************************************************/

package org.osgi.util.tracker;

Expand Down Expand Up @@ -46,7 +48,7 @@
*
* @param <T> The type of the tracked object.
* @ThreadSafe
* @author $Id$
* @author $Id: 3682b0c1b257ec7c6760e9c4e5d62a3eda567451 $
* @since 1.4
*/
@ConsumerType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* Copyright (c) OSGi Alliance (2007, 2013). All Rights Reserved.
*
/*******************************************************************************
* Copyright (c) Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*
* SPDX-License-Identifier: Apache-2.0
*******************************************************************************/

package org.osgi.util.tracker;

Expand Down Expand Up @@ -43,7 +45,7 @@
*
* @param <T> The type of the tracked object.
* @ThreadSafe
* @author $Id$
* @author $Id: f2733a974918984537676e30a7a96e7056244d98 $
* @since 1.4
*/
@ConsumerType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
/*
* Copyright (c) OSGi Alliance (2000, 2017). All Rights Reserved.
/*******************************************************************************
* Copyright (c) Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*
* SPDX-License-Identifier: Apache-2.0
*******************************************************************************/

package org.osgi.util.tracker;

import java.lang.reflect.Array;
import java.util.Collections;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;

import org.osgi.annotation.versioning.ConsumerType;
import org.osgi.framework.AllServiceListener;
Expand Down Expand Up @@ -54,7 +57,7 @@
* @param <S> The type of the service being tracked.
* @param <T> The type of the tracked object.
* @ThreadSafe
* @author $Id$
* @author $Id: 67bfe046ad3b548a1f062cb5e2f7efd3d1707d90 $
*/
@ConsumerType
public class ServiceTracker<S, T> implements ServiceTrackerCustomizer<S, T> {
Expand Down Expand Up @@ -484,16 +487,16 @@ public void removedService(ServiceReference<S> reference, T service) {
* @throws IllegalArgumentException If the value of timeout is negative.
*/
public T waitForService(long timeout) throws InterruptedException {
if (timeout < 0) {
if (timeout < 0L) {
throw new IllegalArgumentException("timeout value is negative");
}

T object = getService();
if (object != null) {
return object;
}

final long endTime = (timeout == 0) ? 0 : (System.currentTimeMillis() + timeout);
final long timebound = timeout;
final long startTime = System.nanoTime();
do {
final Tracked t = tracked();
if (t == null) { /* if ServiceTracker is not open */
Expand All @@ -505,9 +508,10 @@ public T waitForService(long timeout) throws InterruptedException {
}
}
object = getService();
if (endTime > 0) { // if we have a timeout
timeout = endTime - System.currentTimeMillis();
if (timeout <= 0) { // that has expired
if (timebound > 0L) { // if we have a time bound
final long elapsed = System.nanoTime() - startTime;
timeout = timebound - TimeUnit.NANOSECONDS.toMillis(elapsed);
if (timeout <= 0L) { // time bound has expired
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* Copyright (c) OSGi Alliance (2000, 2013). All Rights Reserved.
*
/*******************************************************************************
* Copyright (c) Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*
* SPDX-License-Identifier: Apache-2.0
*******************************************************************************/

package org.osgi.util.tracker;

Expand Down Expand Up @@ -46,7 +48,7 @@
* @param <S> The type of the service being tracked.
* @param <T> The type of the tracked object.
* @ThreadSafe
* @author $Id$
* @author $Id: 4617b2c5a0fba74a1a48db7188a3c946c672fefb $
*/
@ConsumerType
public interface ServiceTrackerCustomizer<S, T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*
* Copyright (c) OSGi Alliance (2010, 2020). All Rights Reserved.
*
/*******************************************************************************
* Copyright (c) Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*
* SPDX-License-Identifier: Apache-2.0
*******************************************************************************/

/**
* Tracker Package Version 1.5.
Expand All @@ -26,10 +28,10 @@
* <p>
* {@code Import-Package: org.osgi.util.tracker; version="[1.5,2.0)"}
*
* @author $Id$
* @author $Id: 525c871316f48c75de552961b6e34b621bad047a $
*/

@Version("1.5.3")
@Version("1.5.4")
package org.osgi.util.tracker;

import org.osgi.annotation.versioning.Version;
Expand Down

0 comments on commit 7ab85da

Please sign in to comment.