Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
correct source formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BeckerFrank committed Nov 29, 2022
1 parent 01a73dc commit a86ce89
Show file tree
Hide file tree
Showing 275 changed files with 1,454 additions and 1,306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public String getInputType() {
@Override
/**
* Return the bug_status string to be sent to the server.
*
*/
public abstract String toString();
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ public IRepositoryPerson getRepositoryPerson(TaskAttribute taskAttribute) {

@Override
public Map<String, String> getOptions(TaskAttribute attribute) {
RepositoryConfiguration configuration = connector.getRepositoryConfiguration(getTaskRepository().getRepositoryUrl());
RepositoryConfiguration configuration = connector
.getRepositoryConfiguration(getTaskRepository().getRepositoryUrl());
if (configuration != null) {
TaskAttribute attributeProduct = attribute.getTaskData()
.getRoot()
Expand Down Expand Up @@ -331,7 +332,7 @@ public boolean equals(TaskAttribute newAttribute, TaskAttribute oldAttribute) {
&& (BugzillaAttribute.RESOLUTION.getKey().equals(id)
|| BugzillaAttribute.BUG_FILE_LOC.getKey().equals(id)
|| BugzillaAttribute.STATUS_WHITEBOARD.getKey().equals(id) //
|| BugzillaAttribute.KEYWORDS.getKey().equals(id))) {
|| BugzillaAttribute.KEYWORDS.getKey().equals(id))) {
if (oldAttribute.getValue().length() == 0 && newAttribute.getValue().length() == 0
&& oldAttribute.getValues().size() <= 1 && newAttribute.getValues().size() <= 1) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public BugzillaClient getClient(TaskRepository taskRepository, IProgressMonitor
try {
client = createClient(taskRepository);
} catch (MalformedURLException e) {
throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
"Malformed Repository Url", e)); //$NON-NLS-1$
throw new CoreException(
new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, "Malformed Repository Url", e)); //$NON-NLS-1$
}
clientByUrl.put(taskRepository.getRepositoryUrl(), client);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public InputStream getContent(TaskRepository repository, ITask task, TaskAttribu
client = connector.getClientManager().getClient(repository, monitor);
return client.getAttachmentData(attachment.getAttachmentId(), monitor);
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
"Unable to retrieve attachment", e)); //$NON-NLS-1$
throw new CoreException(
new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, "Unable to retrieve attachment", e)); //$NON-NLS-1$
} finally {
monitor.done();
}
Expand All @@ -76,8 +76,8 @@ public void postContent(TaskRepository repository, ITask task, AbstractTaskAttac
TaskAttribute attachmentAttribute, IProgressMonitor monitor) throws CoreException {
try {
monitor.beginTask(Messages.BugzillaTaskAttachmentHandler_Sending_attachment, IProgressMonitor.UNKNOWN);
BugzillaClient client = connector.getClientManager().getClient(repository,
new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
BugzillaClient client = connector.getClientManager()
.getClient(repository, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));

client.postAttachment(task.getTaskId(), comment, source, attachmentAttribute, monitor);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ void migrate(TaskRepository repository, TaskData data, BugzillaRepositoryConnect
// Old actions not saved so recreate them upon migration
// delete legacy operations:
Set<TaskAttribute> operationsToRemove = new HashSet<TaskAttribute>();
for (TaskAttribute attribute : data.getAttributeMapper().getAttributesByType(data,
TaskAttribute.TYPE_OPERATION)) {
for (TaskAttribute attribute : data.getAttributeMapper()
.getAttributesByType(data, TaskAttribute.TYPE_OPERATION)) {
operationsToRemove.add(attribute);
}
for (TaskAttribute taskAttribute : operationsToRemove) {
data.getRoot().removeAttribute(taskAttribute.getId());
}
RepositoryConfiguration configuration = connector.getRepositoryConfiguration(repository.getRepositoryUrl());
RepositoryConfiguration configuration = connector
.getRepositoryConfiguration(repository.getRepositoryUrl());
if (configuration != null) {
configuration.addValidOperations(data);
}
Expand Down Expand Up @@ -155,7 +156,8 @@ void migrate(TaskRepository repository, TaskData data, BugzillaRepositoryConnect
@Override
void migrate(TaskRepository repository, TaskData data, BugzillaRepositoryConnector connector) {
// migrate custom attributes
RepositoryConfiguration configuration = connector.getRepositoryConfiguration(repository.getRepositoryUrl());
RepositoryConfiguration configuration = connector
.getRepositoryConfiguration(repository.getRepositoryUrl());

if (configuration == null) {
return;
Expand Down Expand Up @@ -474,7 +476,8 @@ public boolean initializeTaskData(TaskRepository repository, TaskData taskData,
return true;

} else {
boolean shortLogin = Boolean.parseBoolean(repository.getProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN));
boolean shortLogin = Boolean
.parseBoolean(repository.getProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN));
repositoryConfiguration.configureTaskData(taskData, shortLogin, connector);
}
// boolean updateConfig = false;
Expand Down Expand Up @@ -533,10 +536,10 @@ private boolean initializeNewTaskDataAttributes(RepositoryConfiguration reposito
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
attributeStatus.setValue(repositoryConfiguration.getStartStatus());
} else {
if (repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString())
|| repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) {
if (repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS)
.contains(BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString())
|| repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS)
.contains(BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) {

attributeStatus.setValue(IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.START.toString());
repositoryConfiguration.addValidOperations(taskData);
Expand Down Expand Up @@ -641,7 +644,8 @@ private boolean initializeNewTaskDataAttributes(RepositoryConfiguration reposito
TaskAttribute attributeAssignedTo = createAttribute(taskData, BugzillaAttribute.ASSIGNED_TO);
attributeAssignedTo.setValue(""); //$NON-NLS-1$

if (BugzillaUtil.getTaskPropertyWithDefaultTrue(taskRepository, IBugzillaConstants.BUGZILLA_PARAM_USEQACONTACT)) {
if (BugzillaUtil.getTaskPropertyWithDefaultTrue(taskRepository,
IBugzillaConstants.BUGZILLA_PARAM_USEQACONTACT)) {
TaskAttribute attributeQAContact = createAttribute(taskData, BugzillaAttribute.QA_CONTACT);
attributeQAContact.setValue(""); //$NON-NLS-1$
}
Expand Down Expand Up @@ -754,8 +758,8 @@ public boolean initializeSubTaskData(TaskRepository repository, TaskData subTask
keywords.setValue(""); //$NON-NLS-1$
}
subTaskData.getRoot().getAttribute(BugzillaAttribute.BLOCKED.getKey()).setValue(parentTaskData.getTaskId());
TaskAttribute parentAttributeAssigned = parentTaskData.getRoot().getMappedAttribute(
TaskAttribute.USER_ASSIGNED);
TaskAttribute parentAttributeAssigned = parentTaskData.getRoot()
.getMappedAttribute(TaskAttribute.USER_ASSIGNED);
subTaskData.getRoot()
.getAttribute(BugzillaAttribute.ASSIGNED_TO.getKey())
.setValue(parentAttributeAssigned.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class BugzillaUtil {
private static boolean getParamValue(TaskRepository taskRepository, String propertyName, boolean trueIfUndefined) {
boolean result;
String useParam = taskRepository.getProperty(propertyName);
result = trueIfUndefined ? (useParam == null || (useParam != null && useParam.equals("true"))) //$NON-NLS-1$
result = trueIfUndefined
? (useParam == null || (useParam != null && useParam.equals("true"))) //$NON-NLS-1$
: (useParam != null && useParam.equals("true")); //$NON-NLS-1$
return result;
}
Expand Down Expand Up @@ -75,15 +76,15 @@ public static boolean getTaskPropertyWithDefaultTrue(TaskRepository taskReposito
return (useParam == null || (useParam != null && useParam.equals("true"))); //$NON-NLS-1$
}

private static final Pattern TIME_STAMP_PATTERN = Pattern.compile(
"[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
private static final Pattern TIME_STAMP_PATTERN = Pattern
.compile("[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$

public static String removeTimezone(String timeWithTimezone) throws CoreException {
Matcher matcher = TIME_STAMP_PATTERN.matcher(timeWithTimezone);
if (matcher.find()) {
return matcher.group();
}
throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, NLS.bind(
"{0} is not a valid time", timeWithTimezone))); //$NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
NLS.bind("{0} is not a valid time", timeWithTimezone))); //$NON-NLS-1$
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,10 @@ public void parse(IProgressMonitor monitor, BugzillaXmlRpcClient xmlClient) thro
setValid(true);
} catch (XmlRpcException e) {
setValid(false);
String message = e.linkedException == null ? e.getMessage() : e.getMessage() + ">" //$NON-NLS-1$
+ e.linkedException.getMessage();
String message = e.linkedException == null
? e.getMessage()
: e.getMessage() + ">" //$NON-NLS-1$
+ e.linkedException.getMessage();
throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, 1,
"Error parsing xmlrpc response.\n\n" + message, e)); //$NON-NLS-1$
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static public BugzillaServerVersion fromString(String version) {
// Default values for keys

static final String[] DEFAULT_STATUS_VALUES = { "Unconfirmed", "New", "Assigned", "Reopened", "Resolved", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$
"Verified", "Closed" }; //$NON-NLS-1$//$NON-NLS-2$
"Verified", "Closed" }; //$NON-NLS-1$//$NON-NLS-2$

static final String[] DEFAULT_PRESELECTED_STATUS_VALUES = { "New", "Assigned", "Reopened" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

Expand All @@ -174,15 +174,15 @@ static public BugzillaServerVersion fromString(String version) {
// "Worksforme", "Moved" };

static final String[] DEFAULT_SEVERITY_VALUES = { "blocker", "critical", "major", "normal", "minor", "trivial", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
"enhancement" }; //$NON-NLS-1$
"enhancement" }; //$NON-NLS-1$

static final String[] DEFAULT_PRIORITY_VALUES = { "P1", "P2", "P3", "P4", "P5" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$

static final String[] DEFAULT_HARDWARE_VALUES = { "All", "Macintosh", "PC", "Power PC", "Sun", "Other" }; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$

static final String[] DEFAULT_OS_VALUES = { "All", "AIX Motif", "Windows 95", "Windows 98", "Windows CE", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$
"Windows ME", "Windows 2000", "Windows NT", "Windows XP", "Windows All", "MacOS X", "Linux", "Linux-GTK", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
"Linux-Motif", "HP-UX", "Neutrino", "QNX-Photon", "Solaris", "Unix All", "other" }; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$//$NON-NLS-6$//$NON-NLS-7$
"Windows ME", "Windows 2000", "Windows NT", "Windows XP", "Windows All", "MacOS X", "Linux", "Linux-GTK", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
"Linux-Motif", "HP-UX", "Neutrino", "QNX-Photon", "Solaris", "Unix All", "other" }; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$//$NON-NLS-6$//$NON-NLS-7$

static final String[] DEFAULT_PRODUCT_VALUES = {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,37 +1064,45 @@ public void addOperation(TaskData bugReport, AbstractBugzillaOperation op) {
}
//set the Tooltip
if (op.toString().equals(BugzillaOperation.none.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_none);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION, Messages.RepositoryConfiguration_Operation_Tooltip_none);
} else if (op.toString().equals(BugzillaOperation.new_default.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_new_default);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_new_default);
} else if (op.toString().equals(BugzillaOperation.unconfirmed.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_unconfirmed);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_unconfirmed);
} else if (op.toString().equals(BugzillaOperation.confirmed.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_confirmed);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_confirmed);
} else if (op.toString().equals(BugzillaOperation.in_progress.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_in_progress);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_in_progress);
} else if (op.toString().equals(BugzillaOperation.resolve.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_resolve);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_resolve);
} else if (op.toString().equals(BugzillaOperation.verify.toString())
|| op.toString().equals(BugzillaOperation.verify_with_resolution.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_veryfy);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_veryfy);
} else if (op.toString().equals(BugzillaOperation.duplicate.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_duplicate);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_duplicate);
} else if (op.toString().equals(BugzillaOperation.reopen.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_reopen);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_reopen);
} else if (op.toString().equals(BugzillaOperation.close.toString())
|| op.toString().equals(BugzillaOperation.close_with_resolution.toString())) {
attribute.getMetaData().putValue(TaskAttribute.META_DESCRIPTION,
Messages.RepositoryConfiguration_Operation_Tooltip_close);
attribute.getMetaData()
.putValue(TaskAttribute.META_DESCRIPTION, Messages.RepositoryConfiguration_Operation_Tooltip_close);
}

}
Expand Down Expand Up @@ -1240,10 +1248,10 @@ public String getStartStatus() {
return version.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0
|| !(getOptionValues(BugzillaAttribute.BUG_STATUS)
.contains(BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString())
|| getOptionValues(BugzillaAttribute.BUG_STATUS)
.contains(BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString()))
? IBugzillaConstants.BUGZILLA_REPORT_STATUS.NEW.toString()
: IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString();
|| getOptionValues(BugzillaAttribute.BUG_STATUS)
.contains(BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString()))
? IBugzillaConstants.BUGZILLA_REPORT_STATUS.NEW.toString()
: IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString();
} else {
return validTransitions.getStartStatus();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
public class RepositoryConfigurationFactory extends AbstractReportFactory {

@Deprecated
public RepositoryConfigurationFactory(InputStream inStream, String encoding, BugzillaRepositoryConnector connector) {
public RepositoryConfigurationFactory(InputStream inStream, String encoding,
BugzillaRepositoryConnector connector) {
super(inStream, encoding);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public class SaxBugzillaQueryContentHandler extends DefaultHandler {

private TaskData taskData;

public SaxBugzillaQueryContentHandler(String repositoryUrl, TaskDataCollector collector, TaskAttributeMapper mapper) {
public SaxBugzillaQueryContentHandler(String repositoryUrl, TaskDataCollector collector,
TaskAttributeMapper mapper) {
this.repositoryUrl = repositoryUrl;
this.collector = collector;
this.mapper = mapper;
Expand Down
Loading

0 comments on commit a86ce89

Please sign in to comment.