-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A large number of small changes to improve readability and maintainability #28
base: master
Are you sure you want to change the base?
Conversation
The process of adding comments to code that I read helps me make sense of it even if I never read them again. Comments that are just a question mark are place holders to return to when I have a better idea of what that piece of code is for.
Added Security Enum, WIP to get rid of literal code numbers in configuration and replace with enum names.
…s no longer a need for a switch statement to find them.
… describe what has been done.
Thanks, very good idea. Noury
|
…to cast. Moved notes.org to root.
…ot reuse variables and so that we do not compile them every time.
…ved code inside try in some cases, use Log.d instead of exception.printStackTrace. Suppress MessagingException when closing connection because the connection is always closed after the call even if the execption is thrown.
…do not need to cast or convert.
…roper comunication between activities.
…dded CreateLocalDirectories and ClearHomeDir to Account class to reduce repetition and put them closer to the data that is used by them. Moved various declarations nearer to first use. Upgraded buildtoos to 23.0.3.
…have the vector clocks and history we can remove this an allow the user to retrieve old versions instead.
…account to view or edit"
…to get rid of the Sticky note stuff as it no longer makes sense.
…to get rid of the Sticky note stuff as it no longer makes sense. Added flag for AutomaticMerge. This should probably be an enum together with the stickynotes because they are mutually exclusive. Added Db and associated classes as a container for the various classes representing tables because we now have two more tables to deal with to support the vector clocks. Moved NotesDbHelper to the new Db class. Added MakeMessageWithAttachment function to begin storing messages in attachments instead of inline this should simplify the business of handling composite documents. Added @nonnull to some argument lists.
… of an error message. Added the Result type to return both the message and the success flag instead of modifying the statusMessage field which allows the message to be final.
… Now all fields can be final.
… Now all fields can be final.
…int out the problem.
… and a strange error in the logcat, See http://stackoverflow.com/questions/2850573/activity-has-leaked-window-that-was-originally-added.
…moved imapnotes2Account field from ImapNotes2 class because it was only used in one call so it can be local to the caller.
…elsewhere. Added function to validate synchronization interval. Moved creation of progress dialog to LogIn thread as it is the only user.
…on that mutates the state of the object, use constructors instead. Get some data from ImapNotes2Account instance instead of using AccountManager because ImapNotes2Account instance should already have them. Use int instead of long for sync interval. Added ShowToast function that shows a toast for a caller defined number of seconds.
…tion because it is now not possible for it to be invalid.
…ecessary getter, use final field instead.
I'm using this project as a way of becoming more familiar with both Android and Java.
My personal way of doing this is to do a code review exercise.
I have made a lot of small changes all aimed at making the code easier to read and safer to maintain. The largest change is the introduction of an enum called Security that allows the switch statements that define proto and acceptcrt to be eliminated along with several other if statements. I have tried to use strong typed fields and methods instead of using strings.
It seems to work but I can't claim to have tested it extensively.
Anyway, if you think it is useful here it is.