diff options
author | ddunne | 2010-07-29 19:36:48 +0000 |
---|---|---|
committer | ddunne | 2010-07-29 19:36:48 +0000 |
commit | 4d289081d25179d7b389abd1c42483b6ab509d72 (patch) | |
tree | 93312290cd95061aa3ed605a186d52438354a996 /plugins | |
parent | 202faae0584e59b350432a42e222c71fa533d50c (diff) | |
download | org.eclipse.osee-4d289081d25179d7b389abd1c42483b6ab509d72.tar.gz org.eclipse.osee-4d289081d25179d7b389abd1c42483b6ab509d72.tar.xz org.eclipse.osee-4d289081d25179d7b389abd1c42483b6ab509d72.zip |
resolve code warnings
Diffstat (limited to 'plugins')
3 files changed, 17 insertions, 19 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java index 598402794e6..8ef341aef0c 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java @@ -80,7 +80,9 @@ public abstract class Attribute<T> { * * @throws OseeCoreException */ + @SuppressWarnings("unused") protected void uponInitialize() throws OseeCoreException { + // provided for subclass implementation } public void internalInitialize(IAttributeType attributeType, Artifact artifact, ModificationType modificationType, int attributeId, int gammaId, boolean markDirty, boolean setDefaultValue) throws OseeCoreException { @@ -89,7 +91,7 @@ public abstract class Attribute<T> { this.gammaId = gammaId; } - private void markAsNewOrChanged() throws OseeStateException { + private void markAsNewOrChanged() { if (isInDb()) { markAsChanged(ModificationType.MODIFIED); } else { @@ -192,7 +194,7 @@ public abstract class Attribute<T> { return dirty; } - protected void markAsChanged(ModificationType modificationType) throws OseeStateException { + protected void markAsChanged(ModificationType modificationType) { setDirtyFlag(true); this.modificationType = modificationType; @@ -270,7 +272,7 @@ public abstract class Attribute<T> { * * @throws OseeStateException */ - public final void setArtifactDeleted() throws OseeStateException { + public final void setArtifactDeleted() { markAsChanged(ModificationType.ARTIFACT_DELETED); } @@ -279,7 +281,7 @@ public abstract class Attribute<T> { * * @throws OseeStateException */ - public final void delete() throws OseeStateException { + public final void delete() { markAsChanged(ModificationType.DELETED); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java index 87c20a07e39..4fcddb53d6f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java @@ -14,8 +14,11 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.logging.Level; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.Strings; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.framework.skynet.core.internal.Activator; /** * @author Robert A. Fisher @@ -59,6 +62,7 @@ public class DateAttribute extends CharacterBackedAttribute<Date> { toReturn = format.parse(rawValue); break; } catch (ParseException ex) { + OseeLog.log(Activator.class, Level.SEVERE, ex); } } return toReturn; @@ -100,4 +104,5 @@ public class DateAttribute extends CharacterBackedAttribute<Date> { Date date = getValue(); return date != null ? dateFormat.format(getValue()) : ""; } + }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java index 74f0a793fe3..b2999605990 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/AttributesComposite.java @@ -21,7 +21,6 @@ import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerEditor;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -38,7 +37,6 @@ import org.eclipse.swt.events.MenuEvent; import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -254,22 +252,14 @@ public class AttributesComposite extends Composite { deleteItem = new MenuItem(parentMenu, SWT.PUSH);
deleteItem.setImage(null);
deleteItem.setText("Delete");
- deleteItem.addSelectionListener(new SelectionListener() {
+ deleteItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Attribute<?> attribute = getSelectedAttribute();
- try {
- attribute.delete();
- editor.onDirtied();
- notifyModifyAttribuesListeners();
- tableViewer.refresh();
- } catch (OseeStateException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
+ attribute.delete();
+ editor.onDirtied();
+ notifyModifyAttribuesListeners();
+ tableViewer.refresh();
}
});
}
@@ -286,6 +276,7 @@ public class AttributesComposite extends Composite { public class AttributeMenuListener implements MenuListener {
@Override
public void menuHidden(MenuEvent e) {
+ // do nothing
}
@Override
|