Fix for accepting Java code when a method is selected and full class source us shown (default for now)
--- a/Tools__NewSystemBrowser.st Tue Aug 12 21:05:57 2014 +0200
+++ b/Tools__NewSystemBrowser.st Sun Aug 17 12:32:41 2014 +0200
@@ -59550,6 +59550,19 @@
ifTrue:[self selectedMethodsValue first programmingLanguage]
ifFalse:[cls programmingLanguage]].
+ "/ A special kludge for Java, sigh.
+ "/ When Java is code is about to be accepted AND a method is (was) selected,
+ "/ we end up here. However, when Java is configured to show full source
+ "/ (a default so far), then we would like to all #doAcceptJavaClassDefinition:
+ "/ so all modified states and so on are updated correctly. If we won't, then
+ "/ all the modified state and delayed code update is confused since it assumes
+ "/ only a method has changed (which may not be true, one could add a field
+ "/ meanwhile,... So tricky. I (JV) should review fullClassSource mode...
+ (language isJavaLike and:[ JavaMethod showFullSource ]) ifTrue:[
+ "/ Q: Maybe we should preserve method selection if possible...
+ ^ self doAcceptJavaClassDefinition: code.
+ ].
+
"/ a quick parse for the selector, to check if we overwrite an existing method...
newSelector := self selectorOfMethodFromCode:code in:cls.
existingMethod := cls compiledMethodAt:newSelector ifAbsent:[].
@@ -59885,7 +59898,7 @@
"Created: / 30-12-2009 / 20:01:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 02-08-2012 / 09:37:29 / cg"
- "Modified: / 08-05-2014 / 14:55:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 17-08-2014 / 10:12:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
askForInitialApplicationCodeFor:aClass
@@ -60324,10 +60337,10 @@
^true.
].
- self warn:'Accept of Java classes is not yet implemented'.
+ self warn:'No JavaCompiler found, so accepting Java code is not possible.'.
^ false
- "Modified: / 09-08-2013 / 00:57:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 17-08-2014 / 09:50:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
doAcceptMethod:theCode language: languageOrNil
@@ -61868,11 +61881,11 @@
!NewSystemBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2102 2014-08-12 12:22:13 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2103 2014-08-17 10:32:41 vrany Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2102 2014-08-12 12:22:13 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.2103 2014-08-17 10:32:41 vrany Exp $'
!
version_HG
@@ -61881,7 +61894,7 @@
!
version_SVN
- ^ '$Id: Tools__NewSystemBrowser.st,v 1.2102 2014-08-12 12:22:13 vrany Exp $'
+ ^ '$Id: Tools__NewSystemBrowser.st,v 1.2103 2014-08-17 10:32:41 vrany Exp $'
! !