summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoFactory.java3
-rw-r--r--gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoNotAvailableException.java5
-rw-r--r--gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/AccountGeneralPreferences.java5
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/ChangeUtil.java18
-rw-r--r--tools/gwtui_dbg.launch8
5 files changed, 29 insertions, 10 deletions
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoFactory.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoFactory.java
index b62dd8ff3d..a686a095e0 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoFactory.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoFactory.java
@@ -54,6 +54,9 @@ public class ChangeSetInfoFactory {
final List<ChangeSetElement> changeSetElements = db.changeSetElements().byChangeSet(csId).toList();
// Our data source will be the last change in the ChangeSet
//
+ if(changeSetElements.isEmpty()){
+ throw new ChangeSetInfoNotAvailableException();
+ }
final Change.Id changeId = changeSetElements.get(changeSetElements.size() - 1).getChangeId();
final Change change = db.changes().get(changeId);
final PatchSet patchSet = db.patchSets().get(change.currentPatchSetId());
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoNotAvailableException.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoNotAvailableException.java
index 90426304a4..902c444e7b 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoNotAvailableException.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/topic/ChangeSetInfoNotAvailableException.java
@@ -16,9 +16,14 @@ package com.google.gerrit.httpd.rpc.topic;
public final class ChangeSetInfoNotAvailableException extends Exception {
private static final long serialVersionUID = 1L;
+ public static final String MESSAGE = "No change set elements in list";
public ChangeSetInfoNotAvailableException(Exception cause) {
super(cause);
}
+ public ChangeSetInfoNotAvailableException() {
+ super(MESSAGE);
+ }
+
}
diff --git a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/AccountGeneralPreferences.java b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/AccountGeneralPreferences.java
index a551ebb84b..ebaf0c8076 100644
--- a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/AccountGeneralPreferences.java
+++ b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/AccountGeneralPreferences.java
@@ -43,7 +43,10 @@ public final class AccountGeneralPreferences {
US("MM/dd", "MM/dd/yy"),
/** ISO style dates: 2010-02-14 */
- ISO("MM-dd", "yyyy-MM-dd");
+ ISO("MM-dd", "yyyy-MM-dd"),
+
+ /** European style dates: 27. Apr, 27.04.2010 */
+ EURO("d. MMM", "dd.MM.yyyy");
private final String shortFormat;
private final String longFormat;
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/ChangeUtil.java b/gerrit-server/src/main/java/com/google/gerrit/server/ChangeUtil.java
index f1e2b08454..960af5c9a3 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/ChangeUtil.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/ChangeUtil.java
@@ -67,6 +67,8 @@ import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.util.Base64;
import org.eclipse.jgit.util.NB;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
@@ -79,6 +81,8 @@ import java.util.regex.Matcher;
public class ChangeUtil {
private static int uuidPrefix;
private static int uuidSeq;
+ private static final Logger log = LoggerFactory
+ .getLogger(ChangeUtil.class);
/**
* Generate a new unique identifier for change message entities.
@@ -280,11 +284,15 @@ public class ChangeUtil {
}
db.patchSetApprovals().update(approvals);
- // Email the reviewers
- final AbandonedSender cm = senderFactory.create(updatedChange);
- cm.setFrom(user.getAccountId());
- cm.setChangeMessage(cmsg);
- cm.send();
+ if (senderFactory != null) {
+ // Email the reviewers
+ final AbandonedSender cm = senderFactory.create(updatedChange);
+ cm.setFrom(user.getAccountId());
+ cm.setChangeMessage(cmsg);
+ cm.send();
+ } else {
+ log.error("Abandoned sender factory is null!");
+ }
hooks.doChangeAbandonedHook(updatedChange, user.getAccount(), message);
}
diff --git a/tools/gwtui_dbg.launch b/tools/gwtui_dbg.launch
index 58f5ec8c55..ecb43c7cb1 100644
--- a/tools/gwtui_dbg.launch
+++ b/tools/gwtui_dbg.launch
@@ -20,17 +20,17 @@
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gerrit-reviewdb/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gerrit-common/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gerrit-gwtui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER&quot; path=&quot;3&quot; type=&quot;4&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER&quot; path=&quot;3&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gwtexpui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gwtjsonrpc/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gwtorm/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/gerrit-gwtui/target/classes&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-startupUrl /&#10;-war ${resource_loc:/gerrit-gwtui/target}/gwt-hosted-mode&#10;-server com.google.gerrit.gwtdebug.GerritDebugLauncher&#10;com.google.gerrit.GerritGwtUI"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="gerrit-gwtdebug"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx256M&#10;&#10;-Dgerrit.site_path=${resource_loc:/gerrit-parent}/../test_site"/>
-</launchConfiguration>
+</launchConfiguration> \ No newline at end of file