So I wanted to try out converting our backend API source code which is written in Java and see how it looks (IIRC there is a preview before converting), but once I did it it automatically started converting all the files in the selected folders, and in the end it asked for code corrections, which I responded with no as I wanted to cancel it and now I am stuck with a broken code base with no other options than:
Reverting to the last git commit and reimplementing all the changes done from my side (I could have prevented it but committing before the conversion but oh well)
Continue using Kotlin to code in but I have code errors which I don't know how to fix
What I am asking instead is if there's anyway to convert Kotlin back to Java in IntelliJ IDEA? Thank you in advance
Intellij has a feature called Local History and it can be used to go back in time for things you did not commit to your source control system. This history is retained until you install a new version of IntelliJ IDEA or invalidate caches. Read more in the Intellij help for the feature.
Your source code constantly changes as you edit, test, or compile. Any version control system tracks the differences between the committed versions, but the local changes between commits pass unnoticed. Local History is your personal version control system that tracks changes to your source code on your computer and enables you to compare versions and roll changes back, if necessary. Local History is always at your disposal, no steps are required to enable it.
Local History is independent of external version control systems and works with the directories of your project even when they are not under any VCS control. It applies to any structural artifacts: a project, a directory or package, a file, a class, class members, tags, or selected fragment of text.
Related
Basically when I auto complete on Eclipse (By pressing CTRL+Space) the program laggs for about 5 seconds. This is getting really annoying because I use the auto complete alot. How do I fix this?
The workspace I'm working on is located on a NAS with a 1Gbit/s connection. Could this be causing it?
Thanks.
Check if problem exists with local resources too
Create a local workspace and open it with same eclipse instance. Now create a simple java project by new project wizard at your local machine inside this workapce and try code completion there. If it's still slow go to Step 2.
(by the way - I wouldn't store workspace information on remote side, but always local)
Check proposal kinds
If it's not a network issue and the problem still exists on a simple local workplace with local sources you should inspect your proposal setup as shown in next picture.Maybe one of the proposal kinds is slowing down your IDE. You can experiment with turning off proposal kinds sequential to find the problematic one.
System requirements
If you got stil the problem after doing Step 1-2 maybe your system has not enough power/memory to provide eclipse (but normally not the reason - I am using eclipse at Linux on an old T61 notebook with 4 GB Ram + SSD and it works fine!)
I tried to reimport my android project on eclipse to solve a problem but I accidently overwrote all my files in the project. All of them had been corrupted which means their size is now 0B...
I tried to use Local History but it's useless since my project is no longer in my workspace, same for .metadata.
I also tried to use Recuva (Software for recovering files) which see my files with their real size but when I try recover them, their size is always 0B...
I lost about 7 days of work and I don't really want to rewrite my code using Java Decompiler...
So my question is, is there any solution to recover that files ?
I wrote 200 lines of code and suddenly system restarted. I lost all code. But I recovered data from eclipse's local history. Right click on the file -->replace with-->previous from Local History
Eclipse has a local history, although by default it's set very low - one of my first tasks when setting up a new development machine is to up the values (in addition to my other version control)
If you do have a history you can right click on your class, and select compare with local history.
You could try decompiling with something like JD-GUI. It might not be as onerous as you think. Obfuscators exist for a reason.
It is not really programming question, but i had similar situation and "Mini Tool Power Data Recovery" tool helped me (it is paid tool, free version exists, but maybe you can search in this direction and find something open source). I tried some another tools then, but with no results.
I'm starting to use Play framework,
I've tried some examples and i wonder how exactly it acts on page refresh : does it recompile all files or just those which were modified?
You can read this article which explains how Play's hot reload works: http://jto.github.io/articles/play_anatomy_part2_sbt/
Basically, on file change SBT (building tool used in Play) recognise what to recompile and re-insert the new code in your instance.
Note that it only works in a state-less environnement, because it doesn't trash nor reinitiate old objects. In a stateless world, every request create all the objects it needs and keep nothing from outside. If you use websockets with Play, you may encounter some weird behaviours since websockets are stateful (you have to open a new socket to get the changes).
It only recompiles relevant files after your modification. Here's what Play official website says:
Running the server in development mode
In this mode, the server will be launched with the auto-reload feature enabled,
meaning that for each request Play will check your project and recompile required sources.
If needed the application will restart automatically.
As a side note, Play uses JNotify to monitor the changes in your file system.
Here's a link for JNotify: http://jnotify.sourceforge.net/
Play only compiles the whole project the first time you open your browser. This means that the first time you run it in browser it might be a little slow to load. I'm not exactly sure how play recognize which files that were modified from the last compile, but to answer your question it only compiles the modified files.
I am trying to add Commit Comment messages at end of the Java source file to keep track about the file revision whenever we commit the file to SVN.
Please let me know the syntax. I tried with $Log$: it is not working. one of my projects in the earlier date i remember i used. I don't whether it is Server specific.
You shouldn't do that. Really. SVN is there and has all the history of the file. And it's able to handle branches, which this strategy won't be able to handle.
It's not supported by SVN, for good reasons, explained here: http://subversion.apache.org/faq.html#log-in-source
I just had my app crash and now after alot of work its back to were I had it, I was wondering how would I back up the app so I can reInstall is again if this ever happens again?
u should use a version control system, example: git version control
http://git-scm.com/
happy coding!
use a version control system.. like svn or git ... in any case even if you were not using this, you should have taken backup of your code regularly... these version control system manages this for you easily...
This question is not specific to Java or Android, but rather, how to "backup" code properly. As others have already mentioned, you should be using source control systems such as Git or Subversion. Not only will this "backup" your code, it will allow you to track the changes you make to the code as well as maintain multiple versions of your code.