Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 84877 Details for
Bug 206499
Symptom catalog import not showing error message when incorrect import format is chosen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Updated patch
Bug206499.txt (text/plain), 24.79 KB, created by
Alex Nan
on 2007-12-10 11:40:49 EST
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Alex Nan
Created:
2007-12-10 11:40:49 EST
Size:
24.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.models.lta >Index: src-sdb/org/eclipse/hyades/models/internal/sdb/loader/IConstants.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.models.lta/src-sdb/org/eclipse/hyades/models/internal/sdb/loader/IConstants.java,v >retrieving revision 1.2 >diff -u -r1.2 IConstants.java >--- src-sdb/org/eclipse/hyades/models/internal/sdb/loader/IConstants.java 1 Dec 2007 00:08:17 -0000 1.2 >+++ src-sdb/org/eclipse/hyades/models/internal/sdb/loader/IConstants.java 10 Dec 2007 16:38:54 -0000 >@@ -23,4 +23,6 @@ > public static final String V5_SOLUTION_CLASS = "solution"; > public static final String V5_MATCH_PATTERN_CLASS = "matchPattern"; > public static final String V5_DIRECTIVE_CLASS = "directive"; >+ public static final String V5_ROOT_ELEMENT_NAME = "symptomDatabase"; >+ public static final String ROOT_ELEMENT_NAME = "symrecv"; > } >#P org.eclipse.hyades.sdb >Index: src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/handler/util/messages.properties >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.sdb/src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/handler/util/messages.properties,v >retrieving revision 1.6 >diff -u -r1.6 messages.properties >--- src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/handler/util/messages.properties 7 May 2007 03:29:08 -0000 1.6 >+++ src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/handler/util/messages.properties 10 Dec 2007 16:38:55 -0000 >@@ -14,9 +14,9 @@ > # NLS_ENCODING=UTF-8 > > # Plugin >-_62 = IWAT0039E An exception occured during the import. >+_62 = IWAT0039E An exception occurred during the import. > _63 = Unable to find source file {0}. >-_64 = An input-output exception occured during the import. >+_64 = An input-output exception occurred during the import. > _93 = IWAT0043E File couldn't be exported. Ensure that file paths and names are correct, and try again. > _94 = IWAT0044E An exception occurred. The symptom catalog cannot be exported. > _182 = Export from <Symptom Version 2.0> format to <IBM WebSphere Application Server Version 4.x> format is not supported. >@@ -35,3 +35,6 @@ > _10040 = Validating contents of symptom catalog... > _10090 = Successfully imported {0} > _10100 = The symptom catalog {0} is being imported by another background job. Please choose another file name. >+ >+_10200 = Invalid symptom catalog document. The symptom catalog you are trying to import is not in Websphere proprietary format. >+_10250 = Invalid symptom catalog document. The symptom catalog you are trying to import is not in Symptom 2.0 format. >Index: src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/importing/handler/Symptom2ImportHandler.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.sdb/src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/importing/handler/Symptom2ImportHandler.java,v >retrieving revision 1.9 >diff -u -r1.9 Symptom2ImportHandler.java >--- src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/importing/handler/Symptom2ImportHandler.java 7 May 2007 03:29:07 -0000 1.9 >+++ src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/importing/handler/Symptom2ImportHandler.java 10 Dec 2007 16:38:55 -0000 >@@ -12,10 +12,12 @@ > > import java.io.BufferedInputStream; > import java.io.BufferedOutputStream; >+import java.io.ByteArrayInputStream; > import java.io.File; > import java.io.FileInputStream; > import java.io.FileNotFoundException; > import java.io.FileOutputStream; >+import java.io.FilterInputStream; > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; >@@ -23,9 +25,15 @@ > import java.net.URLConnection; > import java.util.logging.Logger; > >+import javax.xml.parsers.ParserConfigurationException; >+import javax.xml.parsers.SAXParser; >+import javax.xml.parsers.SAXParserFactory; >+ >+import org.eclipse.hyades.models.util.ModelDebugger; > import org.eclipse.tptp.monitoring.symptom.provisional.handler.util.LogSDBMessages; > import org.eclipse.tptp.monitoring.symptom.provisional.handler.util.SdbConstants; > import org.eclipse.tptp.monitoring.symptom.provisional.handler.util.SymptomCoreUtil; >+import org.eclipse.tptp.monitoring.symptom.provisional.models.util.InvalidFormatException; > import org.eclipse.tptp.platform.models.symptom.util.SymptomUtils; > import org.eclipse.tptp.platform.provisional.correlation.common.IOperationContext; > import org.eclipse.tptp.platform.provisional.correlation.common.IOperationMonitor; >@@ -33,6 +41,9 @@ > import org.eclipse.tptp.platform.provisional.correlation.common.OperationStatusImpl; > import org.eclipse.tptp.platform.provisional.symptom.handlers.ISymptomImportHandler; > import org.eclipse.tptp.platform.provisional.symptom.handlers.SymptomHandlerConstants; >+import org.xml.sax.Attributes; >+import org.xml.sax.SAXException; >+import org.xml.sax.helpers.DefaultHandler; > > > /** >@@ -112,6 +123,7 @@ > }else{ > // bugzilla 137186 > if (monitor.isCanceled()) { >+ input.close(); > return; > } > >@@ -129,7 +141,15 @@ > } > > BufferedOutputStream bufferedOutput = new BufferedOutputStream(new FileOutputStream(file), 64*1024); >- copyFiles(bufferedInput,bufferedOutput); >+ IOperationStatus validStatus = validate(input); >+ if(validStatus.isOK()){ >+ copyFiles(bufferedInput,bufferedOutput); >+ }else{ >+ bufferedInput.close(); >+ bufferedOutput.close(); >+ context.setStatus(validStatus); >+ return; >+ } > } > }catch(FileNotFoundException e){ > log(e); >@@ -154,7 +174,7 @@ > > } > >- private void copyFiles(InputStream in, OutputStream out) throws IOException >+ protected void copyFiles(InputStream in, OutputStream out) throws IOException > { > // bugzilla 137186 > long processedSize = 0; >@@ -162,11 +182,14 @@ > monitor.subTask(LogSDBMessages.getString("_10030")); > } > byte [] buffer = new byte[64*1024]; >- int length; >+ int length; > while ((length = in.read(buffer)) >= 0) > { > // bugzilla 137186 > if ((monitor != null) && monitor.isCanceled()) { >+ out.flush(); >+ out.close(); >+ in.close(); > break; > } > out.write(buffer, 0, length); >@@ -190,7 +213,7 @@ > } > out.flush(); > out.close(); >- >+ in.close(); > // bugzilla 137186 > if (monitor != null) { > // proceed to 100 at the end >@@ -247,7 +270,15 @@ > BufferedOutputStream output = new BufferedOutputStream(new FileOutputStream(destFile), 64 * 1024); > // bugzilla 137186 > totalSize = sourceFile.length(); >- copyFiles(input,output); >+ IOperationStatus validStatus = validate(input); >+ if(validStatus.isOK()){ >+ copyFiles(input,output); >+ }else{ >+ input.close(); >+ output.close(); >+ context.setStatus(validStatus); >+ return; >+ } > } > > }catch(FileNotFoundException e){ >@@ -266,15 +297,24 @@ > LogSDBMessages.getString("_64"), ex)); > return; > } >- > context.setStatus(new OperationStatusImpl(OperationStatusImpl.OK, > SdbConstants.COMPONENT_NAME, OperationStatusImpl.OK, > "", null)); > } > > public IOperationStatus validate(URL sourcePath) { >- // TODO Auto-generated method stub >- return null; >+ URLConnection connection; >+ try { >+ connection = sourcePath.openConnection(); >+ InputStream input = connection.getInputStream(); >+ return validate(input); >+ } catch (IOException e) { >+ // TODO Auto-generated catch block >+ return new OperationStatusImpl(OperationStatusImpl.ERROR, >+ SdbConstants.COMPONENT_NAME, OperationStatusImpl.ERROR, >+ "", e); >+ } >+ > } > > /** >@@ -289,7 +329,7 @@ > return versions; > } > >- private void initializeLogger(IOperationContext context){ >+ protected void initializeLogger(IOperationContext context){ > try{ > defaultLogger = (org.eclipse.emf.common.util.Logger)context.getAdapter(org.eclipse.emf.common.util.Logger.class); > }catch(Throwable e){ >@@ -300,7 +340,7 @@ > } > } > >- private void log(Throwable e) >+ protected void log(Throwable e) > { > if( defaultLogger != null) > { >@@ -312,6 +352,63 @@ > > } > >+ protected IOperationStatus validate(InputStream io){ >+ boolean isMarkSupported = io.markSupported(); >+ if(isMarkSupported){ >+ io.mark((int)totalSize); >+ } >+ FilterInputStream fio = new FilterInputStream(io){ >+ public void close() throws IOException { >+ // ignore to avoid closing of the input stream by the parser >+ } >+ }; >+ SAXParserFactory f = SAXParserFactory.newInstance(); >+ f.setValidating(false); >+ f.setNamespaceAware(true); >+ InvalidFormatException invalidFormat = null; >+ try { >+ SAXParser parser = f.newSAXParser(); >+ parser.parse(fio, new DefaultHandler(){ >+ >+ public void startElement(String uri, String localName, >+ String name, Attributes attributes) throws SAXException { >+ // TODO Auto-generated method stub >+ if(!(localName.equals("symptomCatalog") && uri.equals("http://www.eclipse.org/tptp/symptom"))){ >+ throw new SAXException(new InvalidFormatException(LogSDBMessages.getString("_10250"))); >+ }else{ >+ throw new SAXException(); >+ } >+ } >+ >+ }); >+ } catch (ParserConfigurationException e) { >+ if(ModelDebugger.INSTANCE.debug){ >+ log(e); >+ } >+ } catch (SAXException e) { >+ if(e.getException() != null && e.getException() instanceof InvalidFormatException){ >+ invalidFormat = (InvalidFormatException)e.getException() ; >+ } >+ }catch(IOException ioe){ >+ if(ModelDebugger.INSTANCE.debug){ >+ log(ioe); >+ } >+ >+ }finally{ >+ try { >+ io.reset(); >+ } catch (IOException e) { >+ if(ModelDebugger.INSTANCE.debug){ >+ log(e); >+ } >+ } >+ } >+ return invalidFormat == null ? new OperationStatusImpl(IOperationStatus.OK, >+ SdbConstants.COMPONENT_NAME, >+ IOperationStatus.OK, "", null) : new OperationStatusImpl(IOperationStatus.ERROR, >+ SdbConstants.COMPONENT_NAME, >+ IOperationStatus.ERROR, LogSDBMessages.getString("_62"), invalidFormat); > >+ } > > } >Index: src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/importing/handler/WASImportZipHandler.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.sdb/src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/importing/handler/WASImportZipHandler.java,v >retrieving revision 1.8 >diff -u -r1.8 WASImportZipHandler.java >--- src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/importing/handler/WASImportZipHandler.java 20 Apr 2007 05:17:46 -0000 1.8 >+++ src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/importing/handler/WASImportZipHandler.java 10 Dec 2007 16:38:55 -0000 >@@ -143,9 +143,9 @@ > inputStream.close(); > } catch (Exception ioe) { > if(CommunicationDebug.INSTANCE.debug){ >- log(ioe); >- return new OperationStatusImpl(OperationStatusImpl.ERROR, SdbConstants.COMPONENT_NAME, OperationStatusImpl.ERROR, ioe.getLocalizedMessage() !=null ? ioe.getLocalizedMessage() : "" , ioe); >+ log(ioe); > } >+ return new OperationStatusImpl(OperationStatusImpl.ERROR, SdbConstants.COMPONENT_NAME, OperationStatusImpl.ERROR, ioe.getLocalizedMessage() !=null ? ioe.getLocalizedMessage() : "" , ioe); > } > return multiStatus!=null ? multiStatus : new OperationStatusImpl(OperationStatusImpl.OK, SdbConstants.COMPONENT_NAME, OperationStatusImpl.OK, "", null); > } >Index: src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/SDBLoader.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.sdb/src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/SDBLoader.java,v >retrieving revision 1.8 >diff -u -r1.8 SDBLoader.java >--- src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/SDBLoader.java 21 Mar 2007 23:00:36 -0000 1.8 >+++ src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/SDBLoader.java 10 Dec 2007 16:38:55 -0000 >@@ -72,7 +72,7 @@ > private long totalSize = -1; > private long readBytes = 0; > private int currentPercent = 0; >- >+ > //~ Constructors ------------------------------------------------------------------------------- > > public SDBLoader() { >@@ -103,7 +103,7 @@ > * Receive notification of the end of an element. > */ > public void endElement(String namespaceURI, String localName, String qName) throws SAXException { >- if (qName.equals(MATCH_PATTERN_CLASS)) { >+ if (qName.equals(MATCH_PATTERN_CLASS)) { > createMatchPattern(); > } else if (qName.equals(SOLUTION_CLASS)) { > createSolution(); >@@ -182,11 +182,11 @@ > } > > try { >- Map options = new HashMap(); >- >- options.put(XMIResource.OPTION_DECLARE_XML, Boolean.TRUE); >- _symptomDB.eResource().save(options); >- >+ if (errMsg == null) { >+ Map options = new HashMap(); >+ options.put(XMIResource.OPTION_DECLARE_XML, Boolean.TRUE); >+ _symptomDB.eResource().save(options); >+ } > } catch (Exception exc) { > errMsg = exc.toString(); > // bugzilla 137186 >@@ -253,11 +253,11 @@ > > try { > is.close(); >- Map options = new HashMap(); >- >- options.put(XMIResource.OPTION_DECLARE_XML, Boolean.TRUE); >- _symptomDB.eResource().save(options); >- >+ if (errMsg == null) { >+ Map options = new HashMap(); >+ options.put(XMIResource.OPTION_DECLARE_XML, Boolean.TRUE); >+ _symptomDB.eResource().save(options); >+ } > } catch (Exception exc) { > errMsg = exc.toString(); > // bugzilla 137186 >@@ -286,7 +286,11 @@ > return; > } > >- parse(is); >+ try { >+ parse(is); >+ } finally { >+ is.close(); >+ } > } > > protected SAXParser makeParser() throws ParserConfigurationException, SAXException { >@@ -382,16 +386,15 @@ > //// parser.setContentHandler(this); > // parser.parse(inputSource); > parser.parse(inputSource, this); >- > } catch (SAXException se) { > errMsg = se.getMessage(); > ModelDebugger.log(se); >- >+ throw se; > //errMsg = se.toString(); > } catch (IOException ioe) { > errMsg = ioe.getMessage(); > ModelDebugger.log(ioe); >- >+ throw ioe; > //errMsg = ioe.toString(); > } > } >@@ -400,20 +403,23 @@ > * Receive notification of the beginning of an element. > */ > public void startElement(String namespaceURI, String localName, String elementName, Attributes atts) throws SAXException { >- if (elementName.equals(V5_RUNTIME_CLASS)) { >+ if (elementName.equals(V5_RUNTIME_CLASS)) { > createRuntime(atts); >- } else if (elementName.equals(V5_MATCH_PATTERN_CLASS)) { >+ } else if (elementName.equals(V5_MATCH_PATTERN_CLASS)) { > createMatchPattern(atts); >- } else if (elementName.equals(V5_SOLUTION_CLASS)) { >+ } else if (elementName.equals(V5_SOLUTION_CLASS)) { > createSolution(atts); >- } else if (elementName.equals(V5_SYMPTOM_CLASS)) { >+ } else if (elementName.equals(V5_SYMPTOM_CLASS)) { > createSymptom(atts); >- } else if (elementName.equals(V5_DIRECTIVE_CLASS)) { >+ } else if (elementName.equals(V5_DIRECTIVE_CLASS)) { > createDirective(atts); >- } else if (elementName.equals(SYMPTOM_CLASS)) { >+ } else if (elementName.equals(SYMPTOM_CLASS)) { > createV4Symptom(atts); >- } >- >+ } else if (!(elementName.equals(ROOT_ELEMENT_NAME) || elementName.equals(RUNTIME_CLASS) || elementName.equals(V5_ROOT_ELEMENT_NAME) || elementName.equals(MATCH_PATTERN_CLASS) || elementName.equals(SOLUTION_CLASS))) { >+ //Bug 206499 >+ // detected unknown element, conclude that this is not a supported format >+ throw new SAXException(LogSDBMessages.getString("_10200")); >+ } > // bugzilla 137186 > if (_monitor != null) { > if (currentPercent < 100) { >Index: src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/SymptomLoader.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.sdb/src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/SymptomLoader.java,v >retrieving revision 1.15 >diff -u -r1.15 SymptomLoader.java >--- src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/SymptomLoader.java 6 Dec 2007 08:27:07 -0000 1.15 >+++ src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/SymptomLoader.java 10 Dec 2007 16:38:55 -0000 >@@ -4,7 +4,7 @@ > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * $Id >+ * $Id$ > * > * Contributors: > * IBM - Initial API and implementation >@@ -91,7 +91,6 @@ > private long readBytes = 0; > private int currentPercent = 0; > >- > public SymptomLoader() { > super(); > Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("symptom", new SymptomResourceFactoryImpl()); >@@ -114,9 +113,9 @@ > * Receive notification of the end of an element. > */ > public void endElement(String namespaceURI, String localName, String qName) throws SAXException { >- if (qName.equals(MATCH_PATTERN_CLASS)) { >+ if (qName.equals(MATCH_PATTERN_CLASS)) { > createMatchPattern(); >- } else if (qName.equals(SOLUTION_CLASS)) { >+ } else if (qName.equals(SOLUTION_CLASS)) { > createSolution(); > } > >@@ -192,8 +191,10 @@ > } > > try { >- >- saveResource(container.eResource()); >+ >+ if(errMsg == null){ >+ saveResource(container.eResource()); >+ } > > } catch (Exception exc) { > errMsg = exc.toString(); >@@ -267,8 +268,12 @@ > } > > try { >- is.close(); >- saveResource(container.eResource()); >+ is.close(); >+ //save only if no exception occurred >+ if(errMsg == null){ >+ saveResource(container.eResource()); >+ } >+ > } catch (Exception exc) { > errMsg = exc.toString(); > // bugzilla 137186 >@@ -296,7 +301,11 @@ > return; > } > >- parse(is); >+ try { >+ parse(is); >+ } finally { >+ is.close(); >+ } > } > > protected SAXParser makeParser() throws ParserConfigurationException, SAXException { >@@ -396,16 +405,16 @@ > xPathExpression.setLength(0); > processingXPath = false; > } >- > } catch (SAXException se) { > errMsg = se.getMessage(); > ModelDebugger.log(se); >+ throw se; > > //errMsg = se.toString(); > } catch (IOException ioe) { > errMsg = ioe.getMessage(); > ModelDebugger.log(ioe); >- >+ throw ioe; > //errMsg = ioe.toString(); > } > } >@@ -414,19 +423,24 @@ > * Receive notification of the beginning of an element. > */ > public void startElement(String namespaceURI, String localName, String elementName, Attributes atts) throws SAXException { >- if (elementName.equals(V5_RUNTIME_CLASS)) { >+ if (elementName.equals(V5_RUNTIME_CLASS)) { > createContainer(atts); >- } else if (elementName.equals(V5_MATCH_PATTERN_CLASS)) { >+ } else if (elementName.equals(V5_MATCH_PATTERN_CLASS)) { > createMatchPattern(atts); >- } else if (elementName.equals(V5_SOLUTION_CLASS)) { >+ } else if (elementName.equals(V5_SOLUTION_CLASS)) { > createSolution(atts); >- } else if (elementName.equals(V5_SYMPTOM_CLASS)) { >+ } else if (elementName.equals(V5_SYMPTOM_CLASS)) { > createSymptom(atts); >- } else if (elementName.equals(V5_DIRECTIVE_CLASS)) { >+ } else if (elementName.equals(V5_DIRECTIVE_CLASS)) { > createDirective(atts); >- } else if (elementName.equals(SYMPTOM_CLASS)) { >+ } else if (elementName.equals(SYMPTOM_CLASS)) { > createV4Symptom(atts); >- } >+ } else if (!(elementName.equals(ROOT_ELEMENT_NAME) || elementName.equals(RUNTIME_CLASS) || elementName.equals(V5_ROOT_ELEMENT_NAME) || elementName.equals(MATCH_PATTERN_CLASS) || elementName.equals(SOLUTION_CLASS))) { >+ //Bug 206499 >+ // detected unknown element, conclude that this is not a supported format >+ throw new SAXException(LogSDBMessages.getString("_10200")); >+ } >+ > > // bugzilla 137186 > if (monitor != null) { >Index: src/org/eclipse/hyades/sdb/internal/wizard/ImportSymptomDBPage2.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.sdb/src/org/eclipse/hyades/sdb/internal/wizard/ImportSymptomDBPage2.java,v >retrieving revision 1.57 >diff -u -r1.57 ImportSymptomDBPage2.java >--- src/org/eclipse/hyades/sdb/internal/wizard/ImportSymptomDBPage2.java 24 Nov 2007 03:02:42 -0000 1.57 >+++ src/org/eclipse/hyades/sdb/internal/wizard/ImportSymptomDBPage2.java 10 Dec 2007 16:38:55 -0000 >@@ -163,7 +163,7 @@ > private IWorkbenchWindow job_window = null; > private static List targetFileList = new ArrayList(); > >- private boolean isTargetFileNameModifiedByUser = false; >+ private boolean isTargetFileNameModifiedByUser = false; > > /** > * Creates an instance of this class >@@ -1039,7 +1039,7 @@ > * Background job class which performs import operation. > */ > class ImportSymptomDatabaseJob extends Job { >- >+ > public ImportSymptomDatabaseJob(String name) { > super(name); > } >@@ -1059,6 +1059,12 @@ > job_container.refreshLocal(IResource.DEPTH_ONE, null); > targetFile.delete(true, null); > } else if(fError!=null && fError.trim().length() > 0 && fException != null){ >+ >+ if (job_extPattern.equals(SdUIConstants.SYMPTOM_20_EXT)) { >+ job_container.refreshLocal(IResource.DEPTH_ONE, null); >+ targetFile.delete(true, null); >+ } >+ > status = new Status(IStatus.ERROR, SymptomEditPlugin.INSTANCE.getSymbolicName(), fError, fException); > }else{ > // perform post import operation >@@ -1080,17 +1086,18 @@ > } > > protected IStatus postOperate(IProgressMonitor monitor) throws Exception { >+ >+ job_container.refreshLocal(IResource.DEPTH_ONE, null); >+ > if (job_extPattern.equals(SdUIConstants.SYMPTOM_20_EXT)) { > monitor.subTask(LogSDBMessages.getString("_10040")); >- if (!validate(targetFile)) { >+ if (!validate(targetFile)) { > targetFile.delete(true, null); > return new Status(IStatus.ERROR, SymptomEditPlugin.INSTANCE.getSymbolicName(), LogMessages._194); > } > } > monitor.worked(5); >- >- job_container.refreshLocal(IResource.DEPTH_ONE, null); >- >+ > /* save imported sdb in preference store */ > if ((fError == null) || (fError.length() == 0)) { > // Bugzilla 158873 >Index: src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/InvalidFormatException.java >=================================================================== >RCS file: src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/InvalidFormatException.java >diff -N src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/InvalidFormatException.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-symptom-handler/org/eclipse/tptp/monitoring/symptom/provisional/models/util/InvalidFormatException.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,38 @@ >+/********************************************************************** >+ * Copyright (c) 2007 IBM Corporation and others. >+ * 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id$ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.monitoring.symptom.provisional.models.util; >+ >+/** >+ * Signals that the specified file is not supported by the importer. >+ * >+ * @author ygotoh >+ */ >+public class InvalidFormatException extends Exception { >+ >+ public InvalidFormatException() { >+ super(); >+ } >+ >+ public InvalidFormatException(String message, Throwable cause) { >+ super(message, cause); >+ } >+ >+ public InvalidFormatException(String message) { >+ super(message); >+ } >+ >+ public InvalidFormatException(Throwable cause) { >+ super(cause); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 206499
:
84718
|
84794
|
84795
| 84877