Skip to content

Commit

Permalink
[1976] Clean Session lead to exceptions
Browse files Browse the repository at this point in the history
Bug: 1976
Change-Id: Ifb2666b641a9ae6a527629851da191175392e200
Signed-off-by: Philippe DUL <philippe.dul@thalesgroup.com>
  • Loading branch information
pdulth committed Mar 13, 2018
1 parent dcccfa3 commit 4cc9d69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -12,6 +12,7 @@

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

Expand Down Expand Up @@ -194,7 +195,6 @@ protected void closeSession(Session session, boolean saveIsNeeded) {
SessionCloseManager.closeUISession(uiSession, saveIsNeeded);
}
SessionCloseManager.closeSession(session);
SessionCloseManager.cleanSession(session);
}

/**
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -32,8 +32,7 @@ public static void saveSession(Session session) {
}

public static IEditingSession getUISession(Session session) {
IEditingSession editingSession = SessionUIManager.INSTANCE.getUISession(session);
return editingSession;
return SessionUIManager.INSTANCE.getUISession(session);
}

public static void closeUISession(IEditingSession uiSession, boolean saveIsNeeded) {
Expand All @@ -50,7 +49,7 @@ public static boolean isDirty(Session session) {
}

public static void closeSession(Session session) {
closeSession(session, null);
closeSession(session, new NullProgressMonitor());
}

public static void closeSession(Session session, IProgressMonitor monitor) {
Expand All @@ -59,7 +58,8 @@ public static void closeSession(Session session, IProgressMonitor monitor) {

// Ensure proper close of session because when a session is not opened but have been getted (by SessionManager.getSession), the close does not unload the aird
// resource.
// Workaround until TIG will be aligned on Sirius
// Workaround until TIG will be aligned on Sirius (fix since v0.8.x)
@Deprecated
public static void cleanSession(Session session) {
TransactionalEditingDomain editingDomain = TransactionHelper.getEditingDomain(session);

Expand Down

0 comments on commit 4cc9d69

Please sign in to comment.