[B136] QA Framework Bug Fix

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

[B136] QA Framework Bug Fix

Postby g.cotelli » Wed Feb 24, 2010 10:26 am

Hi,

I found the following bug into an EsCompiler extension defined in SqaParsingExtensionsES.

Original Code:
Code: Select all
sqaParse: aString
   environment: aNameEnvironment
   errorHandler: anExceptionHandler
   fullCompile: compileFlag

   "Compile the sourceString aString in the Context aClass informing anErrorHandler with the blocks
    aWarningBlock and failBlock if warnings or errors occur.

   PARAMETERS
      None

   RETURN VALUE
      <EmCompilationResult>"

   | method cm warningLevelCheckers result |

   errorHandler := anExceptionHandler.
   sourceString := aString.

   result := EsCompilationResult new.
   result sourceString: aString.
   exitBlock := [:error | ^result error: error].

   nameEnvironment := self internalNameEnvironmentFor: aNameEnvironment.

   method := self parse: aString messagePattern: eval not scanComments: false.
   eval ifTrue: [method asDoit].
   result parseTree: method.
   method
      sourceClass: nameEnvironment sourceClass;
      resolveNamesIn: nil with: nameEnvironment.

   compileFlag ifTrue: [cm := method compiledMethodFor: self].

   warningLevelCheckers := #(performLevel1ChecksOf: performLevel2ChecksOf: performLevel3ChecksOf:).

   "Perform each level of warning check from lowest to increasing level of severity."
   1 to: (errorHandler warningLevel min: warningLevelCheckers size) do: [:w |
      self perform: (warningLevelCheckers at: w) with: method].
   ^result
      method: cm;
      yourself


Fixed Code:
Code: Select all
sqaParse: aString
   environment: aNameEnvironment
   errorHandler: anExceptionHandler
   fullCompile: compileFlag

   "Compile the sourceString aString in the Context aClass informing anErrorHandler with the blocks
    aWarningBlock and failBlock if warnings or errors occur.

   PARAMETERS
      None

   RETURN VALUE
      <EmCompilationResult>"

   | method cm warningLevelCheckers result |

   errorHandler := anExceptionHandler.
   sourceString := aString.

   result := EsCompilationResult new.
   result sourceString: aString.
   exitBlock := [:error | ^result errorObject: error].

   nameEnvironment := self internalNameEnvironmentFor: aNameEnvironment.

   method := self parse: aString messagePattern: eval not scanComments: false.
   eval ifTrue: [method asDoit].
   result parseTree: method.
   method
      sourceClass: nameEnvironment sourceClass;
      resolveNamesIn: nil with: nameEnvironment.

   compileFlag ifTrue: [cm := method compiledMethodFor: self].

   warningLevelCheckers := #(performLevel1ChecksOf: performLevel2ChecksOf: performLevel3ChecksOf:).

   "Perform each level of warning check from lowest to increasing level of severity."
   1 to: (errorHandler warningLevel min: warningLevelCheckers size) do: [:w |
      self perform: (warningLevelCheckers at: w) with: method].
   ^result
      method: cm;
      yourself


The difference is in: "exitBlock := [:error | ^result errorObject: error]." . Previously result (an EsCompilationResult instance) understood #error: (as an accessor) but this was later removed (I think because collisions with Object>>error: ). So changing it to errorObject: seems to work Ok.

I don't remember now how to reproduce the problem who lead me to this fix. Maybe doing some kind of measure with the QA Framework.

Regards,
Gabriel
g.cotelli
 
Posts: 13
Joined: Wed Feb 24, 2010 9:30 am

Re: [B136] QA Framework Bug Fix

Postby wembley » Mon Mar 08, 2010 12:52 pm

Gabriel -

Thanks for reporting this. I have confirmed the bug -- Case 45578 has been opened.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest