Search code examples
androidfill-parentfind-replace

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 is deprecated so I'm switching everything to match_parent. You can probably guess what happened next...

I was wreckless with the Android Studio find & replace tool. 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. 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?


Solution

  • 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. That being said, Apple saved the day on this one.

    Time Macine

    auto backup was 10 minutes before the "mishap"

    If you're not familiar, Time Machine is a product that Apple created to combat issues like the one I ran into today. 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. 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.