From 6ffb2dc80f28ccc6455691070baf4c206fc6d9b9 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 7 Oct 2019 15:56:54 +0300 Subject: [PATCH] fixed bugzilla time tracking GitOrigin-RevId: 4ea7d8d0a8a1dd6c246837319f51063ff5aca40c --- .../src/com/intellij/tasks/TaskRepository.java | 2 +- .../intellij/tasks/bugzilla/BugzillaRepository.java | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/platform/tasks-platform-api/src/com/intellij/tasks/TaskRepository.java b/platform/tasks-platform-api/src/com/intellij/tasks/TaskRepository.java index 1f012619e547..91d90056b14a 100644 --- a/platform/tasks-platform-api/src/com/intellij/tasks/TaskRepository.java +++ b/platform/tasks-platform-api/src/com/intellij/tasks/TaskRepository.java @@ -61,7 +61,7 @@ public abstract class TaskRepository { */ public static final int NATIVE_SEARCH = 0x0010; - public static final Pattern TIME_SPENT_PATTERN = Pattern.compile("([0-9]+)d ([0-9]+)h ([0-9]+)m"); + public static final Pattern TIME_SPENT_PATTERN = Pattern.compile("([0-9]+)h ([0-9]+)m"); /** * URL of the server to be used in requests. For more human-readable name of repository (e.g. some imaginary URL containing name of diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/bugzilla/BugzillaRepository.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/bugzilla/BugzillaRepository.java index 0591e02c1082..80f7ea3772d5 100644 --- a/plugins/tasks/tasks-core/src/com/intellij/tasks/bugzilla/BugzillaRepository.java +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/bugzilla/BugzillaRepository.java @@ -30,12 +30,9 @@ public class BugzillaRepository extends BaseRepositoryImpl { private static final Logger LOG = Logger.getInstance(BugzillaRepository.class); - // Copied from SendTimeTrackingInformationDialog private Version myVersion; - private boolean myAuthenticated; private String myAuthenticationToken; - private String myProductName = ""; private String myComponentName = ""; @@ -245,14 +242,13 @@ public class BugzillaRepository extends BaseRepositoryImpl { task.getLastPost(), task.getTimeSpentFromLastPost(), timeSpent)); Matcher matcher = TIME_SPENT_PATTERN.matcher(timeSpent); if (matcher.find()) { - int days = Integer.valueOf(matcher.group(1)); - int hours = Integer.valueOf(matcher.group(2)); - int minutes = Integer.valueOf(matcher.group(3)); + int hours = Integer.valueOf(matcher.group(1)); + int minutes = Integer.valueOf(matcher.group(2)); BugzillaXmlRpcRequest request = new BugzillaXmlRpcRequest("Bug.update") .requireAuthentication(true) .withParameter("ids", newVector(task.getId())) // the number of hours worked on the bug as double - .withParameter("work_time", days * 24 + hours + minutes / 60.0); + .withParameter("work_time", hours + minutes / 60.0); if (!StringUtil.isEmptyOrSpaces(comment)) { request.withParameter("comment", newHashTable("body", comment, "is_private", false)); }