Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing synchronized #1099

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public synchronized <T extends Resource> ResourceNode<T> insertNode( ResourceMet
return node;
}

public <T extends Resource> void removeNode (ResourceIdentifier<T> id) {
public synchronized <T extends Resource> void removeNode (ResourceIdentifier<T> id) {
nodeMap.remove( id );
updateDependencies();
}
Expand Down Expand Up @@ -140,7 +140,7 @@ private void updateDependencies() {
*
* @return a sorted list of resource metadata objects, never <code>null</code>
*/
public List<ResourceMetadata<? extends Resource>> toSortedList() {
public synchronized List<ResourceMetadata<? extends Resource>> toSortedList() {
// sketch: first add resources without dependencies, then add resources whose dependencies are met until done
HashSet<ResourceNode<? extends Resource>> nodes = new HashSet<ResourceNode<?>>( nodeMap.values() );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Occam Labs UG (haftungsbeschränkt)
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

/**
Expand Down Expand Up @@ -138,7 +137,7 @@ public void testResourceGraph() {
Assert.assertFalse( "Expected broken dependencies.", node.areDependenciesAvailable() );
}

@Test @Ignore
@Test
public void testDestroySingle() {
FeatureStore fs = workspace.getResource( FeatureStoreProvider.class, "simplesql-ok" );
Assert.assertNotNull( "Feature store is expected to be created.", fs );
Expand All @@ -150,7 +149,7 @@ public void testDestroySingle() {
Assert.assertNull( "Connection provider is expected to be destroyed.", prov );
}

@Test @Ignore
@Test
public void testDestroyInitializeSingle() {
FeatureStore fs = workspace.getResource( FeatureStoreProvider.class, "simplesql-ok" );
Assert.assertNotNull( "Feature store is expected to be created.", fs );
Expand All @@ -164,7 +163,7 @@ public void testDestroyInitializeSingle() {
Assert.assertNotNull( "Connection provider is expected to be re-initialized.", prov );
}

@Test @Ignore
@Test
public void testReinitializeChain() {
FeatureStore fs = workspace.getResource( FeatureStoreProvider.class, "simplesql-ok" );
Assert.assertNotNull( "Feature store is expected to be created.", fs );
Expand Down