问题描述
按照这篇文章最后的步骤进行转换:http://wenku.baidu.com/view/df24e5020740be1e650e9a23.html我从公司项目里随便拿了个工具类出来进行逆向转换,结果报如下错:[时间]Syntaxerror(文件名)Description:UnrecoverableParseErrorLocation:35Line19Column代码对应地址是publicstatic【这里】List<String>getTableSuffix(DatestartDate,DateendDate){我以为是不识别List类,于是我把List<String>随便改成了String又转换了一次,报错还是如上,只是定位在另外一个地方如下:List<String>dateList=newAr【这里】rayList<String>();我感觉很奇怪,第一次报错还能理解成不识别List,第二个错就难理解了。请问应该“逆向工程”功能如何使用呢?
解决方案
解决方案二:
有可能是编码的问题。你可以参考下C#的。So,IwasreverseengineeringsomeC#codethatIhaddevelopedinVisualStudiotocreatesomeUMLclassdiagrams.RunningStarUMLiranintothefollowingerror:UnrecoverableParseError1Line0Column
AfterpokingarounditseemsStarUMLdoesnotliketheUTF-8ByteOrderMark(BOM)thatVisualStudioaddstothebeginningofthefilebydefault.TheByteOrderMarkisaunicodecharacterplacedatthebeginningofaunicodetextfiletoindicatetheendiannessofthemulti-bytecharacters.ForUTF-8itisathreebytesequence0xEF,0xBB,0xBF.ThebyteordermarkforUTF-8isnotrequiredsinceendiannessisnotanissuewiththe8-bitencodingformat.However,forsomereasonMicrosoftthinksit’sagoodideatoputitthereanyway.ThismarkmustberemovedfromthefilebeforeStarUMLwillbeabletoparseit.Thereareafewwaystoremovethismark.VisualStudiowillremovetheBOMbygoingtoSaveAs…andselecting“SaveWithEncoding…”andselecting“UTF-8withoutsignature”.OnceitissavedwithouttheBOM,VisualStudiowillnotadditagain.Unfortunately,thereisnowaytomakethisdefaultforallfilesinVisualStudioanditmustbedonemanuallyeachtimeafileissavedforthefirsttime.IfyouhaveaccesstoaLinuxmachineorCygwininstalledyoucanbatchmodifyexistingfileswiththislittlescript:find.-name"*.cpp"-execvim-c"setnobomb"-cwq!{};Or,ifyoudon’thaveCygwinbutyoudohavevimyoucanusethisbatchscript.for%%fin(*.cpp)docallvim-c"setnobomb"-cwq!%%fNote,doingthisinabatchscript,itseemsIneedtohit[return]eachtimevimexitswhichisn’tthecasewiththeCygwinversion.ThisproblemofcourseisnotlimitedtoStarUMLasthebyteordermarkcancauseproblemsinmanyotherprogramsaswell.ItjustsohappenedthatIwasusingStarUMLwhenIdiscoveredthisissue.TherootcauseisMicrosoftaddingthisunnecessarymark.Thefixhoweverwouldbeforapplications,includingStarUML,tohandlethemarkproperlysincethestandarddoessayit“could”bethereeventhoughitisnotnecessaryorevenrecommended.
解决方案三:
啊,我没有看清你的问题,算了,直接无视吧
解决方案四:
泛型的原因吧
解决方案五:
由于staruml只支持jdk1.3的,所以当代码中有泛型或者注解forin等高级特性时,生成类图会失败
解决方案六:
引用4楼yuzhangkai的回复:
由于staruml只支持jdk1.3的,所以当代码中有泛型或者注解forin等高级特性时,生成类图会失败
就是这个原因了,功能不够强大。还是用eclipsemodelingframework比较合适