[英]Find/Replace broke my application (reckless mistake)
Out of patience I did one of the things that you're not supposed to do unless you are ABSOLUTELY SURE . 出于耐心,我做了一件事,除非你绝对确定,否则你不应该做。 I wasn't absolutely sure and now I'm paying for it. 我不是很确定,现在我要为此付出代价。
What Happened 发生了什么
My outdated app is using fill_parent
as an attribute for android:layout_height
. 我过时的应用程序将fill_parent
用作android:layout_height
的属性。 fill_parent
is deprecated so I'm switching everything to match_parent
. fill_parent
已弃用,因此我将所有内容都切换为match_parent
。 You can probably guess what happened next... 您可能会猜到接下来发生了什么...
I was wreckless with the Android Studio
find & replace tool. 我对Android Studio
查找和替换工具一无所知。 Wreckless "undo" is limited. 鲁“的“撤消”是有限的。 To make it worse I did another find & replace to reverse the situation so here is what is going on: 更糟的是,我又进行了一次查找和替换以扭转这种情况,所以这是怎么回事:
The Problem 问题
error: cannot find symbol variable fill_parent
I replaced fill_parent
with match_parent
and by doubling back and replacing match_parent
with fill_parent
I've ended up replacing much needed deep-level references of to the point where fill_parent
isn't even recognized anymore. 我用match_parent
替换了fill_parent
,并加倍并用fill_parent
替换了match_parent
,我最终替换了很多需要的深层引用, fill_parent
不再识别fill_parent
。 Worst case I will make a copy of where I'm at, grab the previous version in the repo, and figure out what all changed. 最坏的情况是,我将复制自己所在的位置,在存储库中获取以前的版本,然后找出所有更改。 Is there a less time-consuming way to do this or am I stuck? 有没有一种更省时的方式来完成此操作,还是我被卡住了?
I have all the Apple products because we work with them most but I love the competition Google / Samsung / Microsoft bring and collectively I like the competition better. 我拥有所有Apple产品,因为我们与他们合作最多,但是我喜欢Google / Samsung / Microsoft带来的竞争,并且总的来说,我更喜欢竞争。 That being said, Apple saved the day on this one. 话虽如此,苹果公司还是为此节省了一天。
auto backup was 10 minutes before the "mishap" 自动备份是在“灾难”发生前10分钟
If you're not familiar, Time Machine is a product that Apple created to combat issues like the one I ran into today. 如果您不熟悉, Time Machine是Apple专门为解决类似我今天遇到的问题而开发的产品。 Most consumers don't have the know-how of GIT
/ SVN
so when they delete files they are permanently gone unless they have luck with a drive deep scan . 大多数使用者没有GIT
/ SVN
的专业知识,因此,当他们删除文件时,除非他们对驱动器深度扫描有好运,否则它们将永久消失。 Time Machine
is a good project and if you use OS X
then I strongly suggest you purchase and external drive and make it a Time Machine
backup. Time Machine
是一个很好的项目,如果您使用OS X
则强烈建议您购买外部驱动器,并使其成为Time Machine
备份。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.