Migrating to JDK 1.8
This commit is contained in:
		@@ -16,7 +16,7 @@
 | 
			
		||||
// LICENSE file.  Alternatively, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
//==============================================================================
 | 
			
		||||
 | 
			
		||||
package com.lyndir.masterpassword;
 | 
			
		||||
package com.lyndir.masterpassword.model;
 | 
			
		||||
 | 
			
		||||
import org.joda.time.format.DateTimeFormatter;
 | 
			
		||||
import org.joda.time.format.ISODateTimeFormat;
 | 
			
		||||
@@ -22,6 +22,7 @@ import static com.lyndir.lhunath.opal.system.util.ObjectUtils.*;
 | 
			
		||||
import static com.lyndir.lhunath.opal.system.util.StringUtils.*;
 | 
			
		||||
 | 
			
		||||
import com.lyndir.masterpassword.*;
 | 
			
		||||
import com.lyndir.masterpassword.model.MPConstant;
 | 
			
		||||
import javax.annotation.Nonnull;
 | 
			
		||||
import org.joda.time.Instant;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,7 @@ import com.lyndir.lhunath.opal.system.CodeUtils;
 | 
			
		||||
import com.lyndir.lhunath.opal.system.logging.Logger;
 | 
			
		||||
import com.lyndir.lhunath.opal.system.util.ConversionUtils;
 | 
			
		||||
import com.lyndir.masterpassword.*;
 | 
			
		||||
import com.lyndir.masterpassword.model.MPConstant;
 | 
			
		||||
import com.lyndir.masterpassword.model.MPIncorrectMasterPasswordException;
 | 
			
		||||
import java.io.*;
 | 
			
		||||
import java.util.regex.Matcher;
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.*;
 | 
			
		||||
import com.google.common.primitives.UnsignedInteger;
 | 
			
		||||
import com.lyndir.lhunath.opal.system.CodeUtils;
 | 
			
		||||
import com.lyndir.masterpassword.*;
 | 
			
		||||
import com.lyndir.masterpassword.model.MPConstant;
 | 
			
		||||
import com.lyndir.masterpassword.model.MPIncorrectMasterPasswordException;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import javax.annotation.Nullable;
 | 
			
		||||
 
 | 
			
		||||
@@ -87,7 +87,7 @@ public class MPTestSuite implements Callable<Boolean> {
 | 
			
		||||
                    if ("case".equals( qName ))
 | 
			
		||||
                        tests.cases.add( currentCase );
 | 
			
		||||
                    if ("algorithm".equals( qName ))
 | 
			
		||||
                        currentCase.algorithm = ConversionUtils.toInteger( text ).orNull();
 | 
			
		||||
                        currentCase.algorithm = ConversionUtils.toInteger( text ).orElse( null );
 | 
			
		||||
                    if ("fullName".equals( qName ))
 | 
			
		||||
                        currentCase.fullName = text;
 | 
			
		||||
                    if ("masterPassword".equals( qName ))
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								gradle/.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								gradle/.idea/misc.xml
									
									
									
										generated
									
									
									
								
							@@ -31,7 +31,7 @@
 | 
			
		||||
      </value>
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
 | 
			
		||||
    <output url="file://$PROJECT_DIR$/classes" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ThriftCompiler">
 | 
			
		||||
 
 | 
			
		||||
@@ -5,8 +5,8 @@ allprojects {
 | 
			
		||||
    version = 'GIT-SNAPSHOT'
 | 
			
		||||
 | 
			
		||||
    tasks.withType(JavaCompile) {
 | 
			
		||||
        sourceCompatibility = '1.7'
 | 
			
		||||
        targetCompatibility = '1.7'
 | 
			
		||||
        sourceCompatibility = '1.8'
 | 
			
		||||
        targetCompatibility = '1.8'
 | 
			
		||||
    }
 | 
			
		||||
    tasks.withType(FindBugs) {
 | 
			
		||||
        reports {
 | 
			
		||||
 
 | 
			
		||||
@@ -2,11 +2,11 @@ apply plugin: 'com.android.application'
 | 
			
		||||
 | 
			
		||||
android {
 | 
			
		||||
    compileSdkVersion 25
 | 
			
		||||
    buildToolsVersion '25.0.0'
 | 
			
		||||
    buildToolsVersion '25.0.3'
 | 
			
		||||
 | 
			
		||||
    compileOptions {
 | 
			
		||||
        sourceCompatibility JavaVersion.VERSION_1_7
 | 
			
		||||
        targetCompatibility JavaVersion.VERSION_1_7
 | 
			
		||||
        sourceCompatibility JavaVersion.VERSION_1_8
 | 
			
		||||
        targetCompatibility JavaVersion.VERSION_1_8
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    defaultConfig {
 | 
			
		||||
@@ -15,6 +15,7 @@ android {
 | 
			
		||||
        targetSdkVersion 25
 | 
			
		||||
        versionCode 20501
 | 
			
		||||
        versionName '2.5.1'
 | 
			
		||||
        jackOptions.enabled true
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // release with: STORE_PW=$(mpw masterpassword.keystore) KEY_PW=$(mpw masterpassword-android) gradle assembleRelease
 | 
			
		||||
 
 | 
			
		||||
@@ -38,6 +38,7 @@ import com.google.common.primitives.UnsignedInteger;
 | 
			
		||||
import com.google.common.util.concurrent.ListeningExecutorService;
 | 
			
		||||
import com.google.common.util.concurrent.MoreExecutors;
 | 
			
		||||
import com.lyndir.lhunath.opal.system.logging.Logger;
 | 
			
		||||
import com.lyndir.masterpassword.model.MPConstant;
 | 
			
		||||
import java.text.MessageFormat;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.concurrent.Executors;
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
package com.lyndir.masterpassword.gui;
 | 
			
		||||
 | 
			
		||||
import com.lyndir.lhunath.opal.system.util.ConversionUtils;
 | 
			
		||||
import com.lyndir.masterpassword.MPConstant;
 | 
			
		||||
import com.lyndir.masterpassword.model.MPConstant;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -35,6 +35,6 @@ public class Config {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean checkForUpdates() {
 | 
			
		||||
        return ConversionUtils.toBoolean( System.getenv( MPConstant.env_checkUpdates ) ).or( true );
 | 
			
		||||
        return ConversionUtils.toBoolean( System.getenv( MPConstant.env_checkUpdates ) ).orElse( true );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,6 @@ package com.lyndir.masterpassword.gui;
 | 
			
		||||
import static com.lyndir.lhunath.opal.system.util.StringUtils.*;
 | 
			
		||||
 | 
			
		||||
import com.google.common.base.Charsets;
 | 
			
		||||
import com.google.common.base.Optional;
 | 
			
		||||
import com.google.common.io.CharSource;
 | 
			
		||||
import com.google.common.io.Resources;
 | 
			
		||||
import com.lyndir.lhunath.opal.system.logging.Logger;
 | 
			
		||||
@@ -34,6 +33,7 @@ import java.lang.reflect.InvocationTargetException;
 | 
			
		||||
import java.net.URI;
 | 
			
		||||
import java.net.URL;
 | 
			
		||||
import java.util.Enumeration;
 | 
			
		||||
import java.util.Optional;
 | 
			
		||||
import java.util.jar.*;
 | 
			
		||||
import javax.swing.*;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,9 +19,13 @@
 | 
			
		||||
package com.lyndir.masterpassword.gui.model;
 | 
			
		||||
 | 
			
		||||
import com.google.common.collect.ImmutableList;
 | 
			
		||||
import com.google.common.primitives.UnsignedInteger;
 | 
			
		||||
import com.lyndir.masterpassword.MPAlgorithm;
 | 
			
		||||
import com.lyndir.masterpassword.MPResultType;
 | 
			
		||||
import com.lyndir.masterpassword.model.*;
 | 
			
		||||
import com.lyndir.masterpassword.model.impl.MPBasicSite;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import javax.annotation.Nullable;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -31,8 +35,14 @@ public class IncognitoSite extends MPBasicSite {
 | 
			
		||||
 | 
			
		||||
    private final IncognitoUser user;
 | 
			
		||||
 | 
			
		||||
    public IncognitoSite(final IncognitoUser user, final String siteName) {
 | 
			
		||||
        super( siteName, user.getAlgorithm() );
 | 
			
		||||
    public IncognitoSite(final IncognitoUser user, final String name) {
 | 
			
		||||
        this( user, name, null, null, null, null );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public IncognitoSite(final IncognitoUser user, final String name,
 | 
			
		||||
                         @Nullable final MPAlgorithm algorithm, @Nullable final UnsignedInteger counter,
 | 
			
		||||
                         @Nullable final MPResultType resultType, @Nullable final MPResultType loginType) {
 | 
			
		||||
        super( name, (algorithm == null)? user.getAlgorithm(): algorithm, counter, resultType, loginType );
 | 
			
		||||
 | 
			
		||||
        this.user = user;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -87,7 +87,7 @@ public class IncognitoAuthenticationPanel extends AuthenticationPanel<IncognitoU
 | 
			
		||||
            @Override
 | 
			
		||||
            protected IncognitoSite createSite(final IncognitoUser user, final String siteName, final UnsignedInteger siteCounter,
 | 
			
		||||
                                               final MPResultType resultType, final MPAlgorithm algorithm) {
 | 
			
		||||
                return new IncognitoSite( user, siteName, siteCounter, resultType, algorithm );
 | 
			
		||||
                return new IncognitoSite( user, siteName, algorithm, siteCounter, resultType, null );
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user