/*
 * Copyright 2012-2014 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ajoberstar.gradle.git.auth;

import java.io.Serializable;

import org.ajoberstar.grgit.Credentials;

import org.gradle.api.artifacts.repositories.PasswordCredentials;

/**
 * Basic implementation of {@link PasswordCredentials}.
 * @since 0.1.0
 */
public class BasicPasswordCredentials implements PasswordCredentials, Serializable {
	private static final long serialVersionUID = 1L;
	private String username;
	private String password;

	/**
	 * Constructs credentials with {@code null} username and password.
	 */
	public BasicPasswordCredentials() {
		this(null, null);
	}

	/**
	 * Constructs credentials with the given arguments.
	 * @param username the username to set
	 * @param password the password to set
	 */
	public BasicPasswordCredentials(String username, String password) {
		this.username = username;
		this.password = password;
	}

	/**
	 * {@inheritDoc}
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * {@inheritDoc}
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * {@inheritDoc}
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * {@inheritDoc}
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * Converts to credentials for use in Grgit.
	 * @return {@code null} if both username and password are {@code null},
	 * otherwise returns credentials in Grgit format.
	 */
	public Credentials toGrgit() {
		if (username && password) {
			return new Credentials(username, password)
		} else {
			return null
		}
	}
}

@@ -2072,16 +2072,24 @@
 sername 
+!= null 
 && passw
@@ -2087,24 +2087,32 @@
  && password
+ != null
 ) %7B%0A%09%09%09retur
@@ -2148,16 +2148,17 @@
 assword)
+;
 %0A%09%09%7D els
@@ -2175,16 +2175,17 @@
 urn null
+;
 %0A%09%09%7D%0A%09%7D%0A

Fix compile error