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

#removeCategory: removes methods leaving rowan in bad state #324

Closed
ericwinger opened this issue Aug 15, 2018 · 1 comment
Closed

#removeCategory: removes methods leaving rowan in bad state #324

ericwinger opened this issue Aug 15, 2018 · 1 comment
Assignees
Labels
bug Something isn't working First Release For July 31st deadline

Comments

@ericwinger
Copy link
Member

To reproduce:

  1. Create a new method category in a class (MyClass) called 'tempCategory'.
  2. Create a method in that category, methodInTempCategory.
  3. Execute in workspace - MyClass removeCategory: 'tempCategory'.

At this point, category tempCategory and method methodInTempCategory are removed from the class. (We can debate whether that's proper later)

However, the method isn't really gone. Two bad things happen next.

  • If you try to compile the same method again, you get Stack A (below).
  • If you try to reload your project you get Stack B (below).

----- Stack A --------
a UserDefinedError occurred (error 2318), reason:halt, Duplicate definition.
UserDefinedError (AbstractException) >> _signalWith: @5 line 25
UserDefinedError (AbstractException) >> signal @2 line 47
RwClassDefinition (Object) >> error: @6 line 7
RwClassDefinition (RwDefinition) >> addDefinition:to: @6 line 6
RwClassDefinition (RwAbstractClassDefinition) >> addInstanceMethodDefinition: @2 line 3
[] in ExecBlock2 (RwPrjBrowserTool) >> addOrUpdateMethod:inProtocol:forClassNamed:isMeta:inPackageNamed: @5 line 29
[] in ExecBlock3 (RwPrjBrowserTool) >> addOrUpdateMethod:inProtocol:forClassNamed:isMeta:inPackageNamed: @5 line 72
[] in ExecBlock1 (RwAbstractTool) >> definitionsForClassNamed:ifFound:ifAbsent: @14 line 11
RwGsImage class >> loadedClassNamed:ifFound:ifAbsent: @9 line 11
RwPrjBrowserTool (RwAbstractTool) >> definitionsForClassNamed:ifFound:ifAbsent: @3 line 4
RwPrjBrowserTool >> addOrUpdateMethod:inProtocol:forClassNamed:isMeta:inPackageNamed: @12 line 69
RwPrjBrowserTool >> addOrUpdateMethod:inProtocol:forClassNamed:isMeta: @13 line 37
RowanAnsweringService class (Behavior) >> rwCompileMethod:category: @9 line 4
[] in ExecBlock0 (RowanClassService) >> compileMethod:behavior:symbolList:inCategory: @2 line 6
ExecBlock0 (ExecBlock) >> on:do: @3 line 42
[] in ExecBlock0 (RowanClassService) >> compileMethod:behavior:symbolList:inCategory: @2 line 6
ExecBlock0 (ExecBlock) >> on:do: @3 line 42
RowanClassService >> compileMethod:behavior:symbolList:inCategory: @2 line 8
RowanClassService >> saveMethodSource:category: @12 line 7
[] in ExecBlock1 (JadeServer) >> updateFromSton: @9 line 11
Array (Collection) >> do: @5 line 10
JadeServer64bit32 (JadeServer) >> updateFromSton: @7 line 6
GsNMethod class >> _gsReturnToC @1 line 1

------Stack B ------

a UserDefinedError occurred (error 2318), reason:halt, internal error - compiled method not present in method dictionary
UserDefinedError (AbstractException) >> _signalWith: @5 line 25
UserDefinedError (AbstractException) >> signal @2 line 47
RwGsMethodDeletionSymbolDictPatch (Object) >> error: @6 line 7
[] in ExecBlock0 (RwGsMethodPatch) >> compiledMethod @2 line 10
GsMethodDictionary (AbstractDictionary) >> _reportKeyNotFound:with: @5 line 6
GsMethodDictionary >> at:ifAbsent: @30 line 28
aKey = #'test1' - one of the problem methods.
RwGsMethodDeletionSymbolDictPatch (RwGsMethodPatch) >> compiledMethod @7 line 9
RwGsMethodDeletionSymbolDictPatch >> symbolDictionary @3 line 5
RwGsMethodDeletionSymbolDictPatch (RwGsPatch) >> symbolDictionaryRegistry @2 line 3
RwGsMethodDeletionSymbolDictPatch >> deleteMethodNewClasses:andExistingClasses: @5 line 9
[] in ExecBlock1 (RwGsPatchSet_254) >> removeDeletedMethods @4 line 7
[] in ExecBlock1 (Set) >> do: @2 line 11
[] in ExecBlock2 (KeyValueDictionary) >> keysDo: @2 line 7
KeyValueDictionary >> keysAndValuesDo: @23 line 20
KeyValueDictionary >> keysDo: @2 line 6
Set >> do: @3 line 11
RwGsPatchSet_254 >> removeDeletedMethods @2 line 4
RwGsPatchSet_254 >> apply @24 line 26
RwGsImage class >> applyModification_254:visitorClass:instanceMigrator: @10 line 9
RwGsImage class >> applyModification_254:instanceMigrator: @7 line 7
RwPrjLoadTool >> _loadProjectSetDefinition_254:instanceMigrator: @15 line 14
[] in ExecBlock0 (RwPrjLoadTool) >> _doProjectSetLoad_254:instanceMigrator:originalProjectSet:processedClassNames: @2 line 4
ExecBlock0 (ExecBlock) >> on:do: @3 line 42
RwPrjLoadTool >> _doProjectSetLoad_254:instanceMigrator:originalProjectSet:processedClassNames: @2 line 6
RwPrjLoadTool >> loadProjectNamed:instanceMigrator: @7 line 9
RwPrjLoadTool >> loadProjectNamed: @4 line 5
[] in ExecBlock0 (RowanProjectService) >> reloadProject @4 line 3
ExecBlock0 (ExecBlock) >> on:do: @3 line 42
RowanProjectService >> reloadProject @2 line 4
[] in ExecBlock1 (JadeServer) >> updateFromSton: @9 line 11
Array (Collection) >> do: @5 line 10
JadeServer64bit32 (JadeServer) >> updateFromSton: @7 line 6
GsNMethod class >> _gsReturnToC @1 line 1

@dalehenrich
Copy link
Member

This is actually not aRowan bug ... Jadeite should be using the Rowan API for this rwRemoveCategory: not removeCategory

@dalehenrich dalehenrich removed this from the candidateV1 milestone Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working First Release For July 31st deadline
Projects
None yet
Development

No branches or pull requests

2 participants