conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
List<SubmitStrategyOp> ops = new ArrayList<>(sorted.size());
boolean first = true;
=======
for (CodeReviewCommit c : sorted) {
if (c.getParentCount() > 1) {
// Since there is a merge commit, sort and prune again using
// MERGE_IF_NECESSARY semantics to avoid creating duplicate
// commits.
//
sorted = args.mergeUtil.reduceToMinimalMerge(args.mergeSorter, sorted);
break;
}
}
>>>>>>>
List<SubmitStrategyOp> ops = new ArrayList<>(sorted.size());
boolean first = true;
for (CodeReviewCommit c : sorted) {
if (c.getParentCount() > 1) {
// Since there is a merge commit, sort and prune again using
// MERGE_IF_NECESSARY semantics to avoid creating duplicate
// commits.
//
sorted = args.mergeUtil.reduceToMinimalMerge(args.mergeSorter, sorted);
break;
}
} |
<<<<<<<
import org.molgenis.data.meta.model.AttributeMetaData;
import org.molgenis.data.meta.model.EntityType;
=======
import org.molgenis.data.meta.model.Attribute;
import org.molgenis.data.meta.model.EntityMetaData;
>>>>>>>
import org.molgenis.data.meta.model.Attribute;
import org.molgenis.data.meta.model.EntityType;
<<<<<<<
for (AttributeMetaData amd : entityType.getAtomicAttributes())
=======
for (Attribute amd : entityMetaData.getAtomicAttributes())
>>>>>>>
for (Attribute amd : entityType.getAtomicAttributes()) |
<<<<<<<
@DefaultMessage("Copy")
String copy();
@DefaultMessage("Copy text and paste into editor")
String copyTooltip();
=======
@DefaultMessage("Glossary Details")
String glossaryDetails();
@DefaultMessage("Dismiss")
String dismiss();
@DefaultMessage("Save")
String save();
@DefaultMessage("Last modified on {0}")
String lastModifiedOn(String date);
@DefaultMessage("Loading...")
String loading();
@DefaultMessage("Found no glossary results")
String foundNoGlossaryResults();
@DefaultMessage("Glossary save fail")
String saveGlossaryFailed();
>>>>>>>
@DefaultMessage("Copy")
String copy();
@DefaultMessage("Copy text and paste into editor")
String copyTooltip();
@DefaultMessage("Glossary Details")
String glossaryDetails();
@DefaultMessage("Dismiss")
String dismiss();
@DefaultMessage("Save")
String save();
@DefaultMessage("Last modified on {0}")
String lastModifiedOn(String date);
@DefaultMessage("Loading...")
String loading();
@DefaultMessage("Found no glossary results")
String foundNoGlossaryResults();
@DefaultMessage("Glossary save fail")
String saveGlossaryFailed(); |
<<<<<<<
import org.hibernate.validator.constraints.NotEmpty;
=======
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
>>>>>>>
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.search.annotations.Indexed;
<<<<<<<
@Size(max = 80)
=======
private List<HProjectIteration> projectIterations = new ArrayList<HProjectIteration>();
@OneToMany(mappedBy = "project")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public List<HProjectIteration> getProjectIterations()
{
return projectIterations;
}
public void addIteration(HProjectIteration iteration)
{
projectIterations.add(iteration);
iteration.setProject(this);
}
@Length(max = 80)
>>>>>>>
private List<HProjectIteration> projectIterations = new ArrayList<HProjectIteration>();
@OneToMany(mappedBy = "project")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public List<HProjectIteration> getProjectIterations()
{
return projectIterations;
}
public void addIteration(HProjectIteration iteration)
{
projectIterations.add(iteration);
iteration.setProject(this);
}
@Size(max = 80)
<<<<<<<
@Size(max = 100)
@Field()
=======
@Enumerated(EnumType.STRING)
public ProjectType getDefaultProjectType()
{
return defaultProjectType;
}
@Length(max = 100)
@Field(index = Index.TOKENIZED)
>>>>>>>
@Enumerated(EnumType.STRING)
public ProjectType getDefaultProjectType()
{
return defaultProjectType;
}
@Size(max = 100)
@Field() |
<<<<<<<
import com.google.common.base.Optional;
=======
import com.google.common.collect.ImmutableList;
import lombok.AllArgsConstructor;
import lombok.Getter;
>>>>>>>
import com.google.common.collect.ImmutableList;
import com.google.common.base.Optional;
import lombok.AllArgsConstructor;
import lombok.Getter;
<<<<<<<
taskHandleOpt.get().incrementDocumentsProcessed();
=======
processHandle.setDocumentsProcessed(processHandle.getDocumentsProcessed() + 1);
>>>>>>>
taskHandleOpt.get().incrementDocumentsProcessed(); |
<<<<<<<
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
=======
>>>>>>>
import com.extjs.gxt.ui.client.widget.Text;
<<<<<<<
import com.extjs.gxt.ui.client.widget.layout.VBoxLayout;
import com.extjs.gxt.ui.client.widget.layout.VBoxLayoutData;
import com.extjs.gxt.ui.client.widget.layout.VBoxLayout.VBoxLayoutAlign;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
=======
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.weborient.codemirror.client.CodeMirrorConfiguration;
import com.weborient.codemirror.client.CodeMirrorEditorWidget;
>>>>>>>
import com.extjs.gxt.ui.client.widget.layout.VBoxLayout;
import com.extjs.gxt.ui.client.widget.layout.VBoxLayoutData;
import com.extjs.gxt.ui.client.widget.layout.VBoxLayout.VBoxLayoutAlign;
import com.google.gwt.user.client.Command;
import com.weborient.codemirror.client.CodeMirrorConfiguration;
import com.weborient.codemirror.client.CodeMirrorEditorWidget;
<<<<<<<
center.setScrollMode(Scroll.AUTOY);
=======
center.setScrollMode(Scroll.AUTOX);
sourceWidget = getEditorWidget(true);
center.add(sourceWidget);
>>>>>>>
center.setScrollMode(Scroll.AUTOY); |
<<<<<<<
// Credentials mockCredentials = new Credentials();
// mockCredentials.setInitialized(true);
// mockCredentials.setUsername( translator.getUsername() );
=======
Credentials mockCredentials = new Credentials();
mockCredentials.setInitialized(true);
mockCredentials.setUsername( translator.getUsername() );
>>>>>>>
// Credentials mockCredentials = new Credentials();
// mockCredentials.setInitialized(true);
// mockCredentials.setUsername( translator.getUsername() );
<<<<<<<
expect( transWorkerManager.getOrRegisterWorkspace( anyObject(WorkspaceId.class) ) ).andReturn( transWorkspace ).anyTimes();
// expect( mockIdentity.getCredentials() ).andReturn( mockCredentials ).anyTimes();
=======
expect(transWorkerManager.getOrRegisterWorkspace(anyObject(WorkspaceId.class))).andReturn( transWorkspace ).anyTimes();
expect( mockIdentity.getCredentials() ).andReturn( mockCredentials );
>>>>>>>
expect(transWorkerManager.getOrRegisterWorkspace(anyObject(WorkspaceId.class))).andReturn( transWorkspace ).anyTimes();
// expect( mockIdentity.getCredentials() ).andReturn( mockCredentials );
<<<<<<<
projectDAO,
// textFlowTargetHistoryDAO,
=======
seam.autowire(ProjectDAO.class),
seam.autowire(TextFlowTargetHistoryDAO.class),
>>>>>>>
seam.autowire(ProjectDAO.class),
// seam.autowire(TextFlowTargetHistoryDAO.class), |
<<<<<<<
synchronized (wiserLock) {
if (HasEmailRule.wiser == null) {
String port = PropertiesHolder.getProperty("smtp.port");
int portNum = Integer.parseInt(port);
HasEmailRule.wiser = new Wiser(portNum);
HasEmailRule.wiser.getServer().setBindAddress(
InetAddress.getByName("127.0.0.1"));
HasEmailRule.wiser.start();
// NB we never call wiser.stop() because we want the email
// server to stay running for all tests in this VM
}
=======
if (HasEmailRule.wiser == null) {
String port = PropertiesHolder.getProperty("smtp.port");
int portNum = Integer.parseInt(port);
Wiser w = new Wiser(portNum);
w.getServer().setBindAddress(InetAddress.getByName("127.0.0.1"));
try {
w.start();
} catch (RuntimeException e) {
if (Throwables.getRootCause(e) instanceof BindException) {
String processInfo =
ProcessPortInfo.getPortProcessInfo(portNum);
log.error("The following process is already listening " +
"to port {}:\n{}", portNum, processInfo);
throw new RuntimeException("Error binding port " +
portNum + ". See log for more info.", e);
}
}
HasEmailRule.wiser = w;
// NB we never call wiser.stop() because we want the email
// server to stay running for all tests in this VM
>>>>>>>
synchronized (wiserLock) {
if (HasEmailRule.wiser == null) {
String port = PropertiesHolder.getProperty("smtp.port");
int portNum = Integer.parseInt(port);
Wiser w = new Wiser(portNum);
w.getServer().setBindAddress(InetAddress.getByName("127.0.0.1"));
try {
w.start();
} catch (RuntimeException e) {
if (Throwables.getRootCause(e) instanceof BindException) {
String processInfo =
ProcessPortInfo.getPortProcessInfo(portNum);
log.error("The following process is already listening " +
"to port {}:\n{}", portNum, processInfo);
throw new RuntimeException("Error binding port " +
portNum + ". See log for more info.", e);
}
}
HasEmailRule.wiser = w;
// NB we never call wiser.stop() because we want the email
// server to stay running for all tests in this VM
} |
<<<<<<<
import com.google.common.base.Charsets;
=======
import com.google.common.collect.ImmutableList;
import com.google.gerrit.entities.BooleanProjectConfig;
>>>>>>>
import com.google.common.base.Charsets;
import com.google.gerrit.entities.BooleanProjectConfig;
<<<<<<<
public void modifyMessage(Repository repository, ChangeNotes notes, String newCommitMessage)
throws AuthException, IOException, InvalidChangeOperationException,
=======
public void modifyMessage(
Repository repository, Project.NameKey project, ChangeNotes notes, String newCommitMessage)
throws AuthException, IOException, UnchangedCommitMessageException,
>>>>>>>
public void modifyMessage(Repository repository, ChangeNotes notes, String newCommitMessage)
throws AuthException, IOException, InvalidChangeOperationException,
<<<<<<<
modifyCommit(
repository,
notes,
new ModificationIntention.LatestCommit(),
CommitModification.builder().newCommitMessage(newCommitMessage).build());
=======
assertCanEdit(notes);
newCommitMessage = CommitMessageUtil.checkAndSanitizeCommitMessage(newCommitMessage);
Optional<ChangeEdit> optionalChangeEdit = lookupChangeEdit(notes);
PatchSet basePatchSet = getBasePatchSet(optionalChangeEdit, notes);
RevCommit basePatchSetCommit = lookupCommit(repository, basePatchSet);
RevCommit baseCommit =
optionalChangeEdit.map(ChangeEdit::getEditCommit).orElse(basePatchSetCommit);
String currentCommitMessage = baseCommit.getFullMessage();
if (newCommitMessage.equals(currentCommitMessage)) {
throw new UnchangedCommitMessageException();
}
RevTree baseTree = baseCommit.getTree();
Timestamp nowTimestamp = TimeUtil.nowTs();
ObjectId newEditCommit =
createCommit(repository, basePatchSetCommit, baseTree, newCommitMessage, nowTimestamp);
ChangeUtil.ensureChangeIdIsCorrect(
projectCache
.get(project)
.orElseThrow(illegalState(project))
.is(BooleanProjectConfig.REQUIRE_CHANGE_ID),
notes.getChange().getKey().get(),
newCommitMessage);
if (optionalChangeEdit.isPresent()) {
updateEdit(
notes.getProjectName(),
repository,
optionalChangeEdit.get(),
newEditCommit,
nowTimestamp);
} else {
createEdit(repository, notes, basePatchSet, newEditCommit, nowTimestamp);
}
>>>>>>>
modifyCommit(
repository,
notes,
new ModificationIntention.LatestCommit(),
CommitModification.builder().newCommitMessage(newCommitMessage).build()); |
<<<<<<<
import java.io.Serializable;
import javax.persistence.Access;
import javax.persistence.AccessType;
=======
>>>>>>>
import java.io.Serializable;
<<<<<<<
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Type;
=======
>>>>>>>
<<<<<<<
public class HTermComment implements Serializable {
private static final long serialVersionUID = 1L;
=======
public class HTermComment {
private Long id;
private String comment;
private Integer pos;
private HGlossaryTerm glossaryTerm;
public HTermComment(String comment) {
this.comment = comment;
}
>>>>>>>
public class HTermComment implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String comment;
private Integer pos;
private HGlossaryTerm glossaryTerm;
public HTermComment(String comment) {
this.comment = comment;
} |
<<<<<<<
public void setTargets(ArrayList<String> targets)
=======
public void setSaveButtonTitle(String title)
{
Preconditions.checkState(editors.size() > 0);
lastEditor().setSaveButtonTitle(title);
}
private ToggleEditor lastEditor()
{
return editors.get(editors.size() - 1);
}
@Override
public void showButtons(boolean displayButtons)
{
for (ToggleEditor editor : editors)
{
editor.showButtons(displayButtons);
}
}
@Override
public void setTargets(List<String> targets)
>>>>>>>
public void setSaveButtonTitle(String title)
{
Preconditions.checkState(editors.size() > 0);
lastEditor().setSaveButtonTitle(title);
}
private ToggleEditor lastEditor()
{
return editors.get(editors.size() - 1);
}
@Override
public void showButtons(boolean displayButtons)
{
for (ToggleEditor editor : editors)
{
editor.showButtons(displayButtons);
}
}
@Override
public void setTargets(ArrayList<String> targets) |
<<<<<<<
// check if all gml:id are unique
XmlHelper.makeGmlIdsUnique(encodedObject.getDomNode());
LOGGER.debug("Encoded object {} is valid: {}", encodedObject.schemaType().toString(),
XmlHelper.validateDocument(encodedObject));
=======
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Encoded object {} is valid: {}", encodedObject.schemaType().toString(),
XmlHelper.validateDocument(encodedObject));
}
>>>>>>>
// check if all gml:id are unique
XmlHelper.makeGmlIdsUnique(encodedObject.getDomNode());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Encoded object {} is valid: {}", encodedObject.schemaType().toString(),
XmlHelper.validateDocument(encodedObject));
} |
<<<<<<<
private final @Nonnull Iterator<TU> tuIter;
private final @Nullable LocaleId targetLocale;
private final ExportTUStrategy<TU> exportTUStrategy;
=======
private final @Nonnull Iterator<? extends SourceContents> tuIter;
private final ExportTUStrategy exportTUStrategy;
>>>>>>>
private final @Nonnull Iterator<TU> tuIter;
private final ExportTUStrategy<TU> exportTUStrategy;
<<<<<<<
this.targetLocale = targetLocale;
this.exportTUStrategy = exportTUStrategy;
}
=======
this.exportTUStrategy = new ExportTUStrategy(targetLocale);
}
>>>>>>>
this.exportTUStrategy = exportTUStrategy;
} |
<<<<<<<
import org.zanata.webtrans.client.resources.NavigationMessages;
=======
import org.zanata.webtrans.client.ui.UserConfigConstants;
>>>>>>>
import org.zanata.webtrans.client.resources.NavigationMessages;
import org.zanata.webtrans.client.ui.UserConfigConstants;
<<<<<<<
public void setShowOperationButtons(boolean showButtons)
{
operationsPanel.setVisible(showButtons);
}
public void setNavMode(Map<ContentState, Boolean> configMap)
=======
public void setNavMode(Map<String, Boolean> configMap)
>>>>>>>
public void setShowOperationButtons(boolean showButtons)
{
operationsPanel.setVisible(showButtons);
}
public void setNavMode(Map<String, Boolean> configMap) |
<<<<<<<
state.useCodeMirrorEditor = true;
state.showSaveApprovedWarning = true;
=======
state.useCodeMirrorEditor = false;
>>>>>>>
state.useCodeMirrorEditor = false;
state.showSaveApprovedWarning = true; |
<<<<<<<
mockDisplay = createMock(AppPresenter.Display.class);
mockDocumentListPresenter = createMock(DocumentListPresenter.class);
mockDocumentsLink = createMock(HasClickHandlers.class);
mockErrorNotificationBtn = createMock(HasClickHandlers.class);
mockSearchButton = createMock(HasClickHandlers.class);
mockKeyShortcutButton = createMock(HasClickHandlers.class);
mockEventBus = createMock(EventBus.class);
mockHistory = createMock(History.class);
mockIdentity = createMock(Identity.class);
mockKeyShortcutPresenter = createMock(KeyShortcutPresenter.class);
mockMessages = createMock(WebTransMessages.class);
mockPerson = createMock(Person.class);
mockSearchResultsPresenter = createMock(SearchResultsPresenter.class);
mockTranslationPresenter = createMock(TranslationPresenter.class);
mockWindow = createMock(Window.class);
mockWindowLocation = createMock(Window.Location.class);
mockWorkspaceContext = createMock(WorkspaceContext.class);
mockNotificationPresenter = createMock(NotificationPresenter.class);
mockLayoutPresenter = createMock(LayoutSelectorPresenter.class);
mockDashboardPresenter = createMock(DashboardPresenter.class);
=======
createAllMocks();
createAllCaptures();
}
private void createAllMocks()
{
mockDisplay = createAndAddMock(AppPresenter.Display.class);
mockDocumentListPresenter = createAndAddMock(DocumentListPresenter.class);
mockDocumentsLink = createAndAddMock(HasClickHandlers.class);
mockErrorNotificationBtn = createAndAddMock(HasClickHandlers.class);
mockSearchButton = createAndAddMock(HasClickHandlers.class);
mockKeyShortcutButton = createAndAddMock(HasClickHandlers.class);
mockEventBus = createAndAddMock(EventBus.class);
mockHistory = createAndAddMock(History.class);
mockIdentity = createAndAddMock(Identity.class);
mockKeyShortcutPresenter = createAndAddMock(KeyShortcutPresenter.class);
mockLeaveWorkspaceMenuItem = createAndAddMock(HasCommand.class);
mockMessages = createAndAddMock(WebTransMessages.class);
mockPerson = createAndAddMock(Person.class);
mockSearchResultsPresenter = createAndAddMock(SearchResultsPresenter.class);
mockSignoutMenuItem = createAndAddMock(HasCommand.class);
mockTranslationPresenter = createAndAddMock(TranslationPresenter.class);
mockWindow = createAndAddMock(Window.class);
mockWindowLocation = createAndAddMock(Window.Location.class);
mockUserWorkspaceContext = createAndAddMock(UserWorkspaceContext.class);
mockWorkspaceContext = createAndAddMock(WorkspaceContext.class);
mockNotificationPresenter = createAndAddMock(NotificationPresenter.class);
mockHelpMenuItem = createAndAddMock(HasCommand.class);
}
private void createAllCaptures()
{
>>>>>>>
createAllMocks();
createAllCaptures();
}
private void createAllMocks()
{
mockDisplay = createAndAddMock(AppPresenter.Display.class);
mockDocumentListPresenter = createAndAddMock(DocumentListPresenter.class);
mockDocumentsLink = createAndAddMock(HasClickHandlers.class);
mockErrorNotificationBtn = createAndAddMock(HasClickHandlers.class);
mockSearchButton = createAndAddMock(HasClickHandlers.class);
mockKeyShortcutButton = createAndAddMock(HasClickHandlers.class);
mockEventBus = createAndAddMock(EventBus.class);
mockHistory = createAndAddMock(History.class);
mockIdentity = createAndAddMock(Identity.class);
mockKeyShortcutPresenter = createAndAddMock(KeyShortcutPresenter.class);
mockMessages = createAndAddMock(WebTransMessages.class);
mockPerson = createAndAddMock(Person.class);
mockSearchResultsPresenter = createAndAddMock(SearchResultsPresenter.class);
mockTranslationPresenter = createAndAddMock(TranslationPresenter.class);
mockWindow = createAndAddMock(Window.class);
mockWindowLocation = createAndAddMock(Window.Location.class);
mockUserWorkspaceContext = createAndAddMock(UserWorkspaceContext.class);
mockWorkspaceContext = createAndAddMock(WorkspaceContext.class);
mockNotificationPresenter = createAndAddMock(NotificationPresenter.class);
}
private void createAllCaptures()
{
<<<<<<<
=======
capturedSignoutLinkCommand = new Capture<Command>();
capturedLeaveWorkspaceLinkCommand = new Capture<Command>();
capturedHelpLinkCommand = new Capture<Command>();
>>>>>>>
<<<<<<<
resetAllMocks();
resetAllCaptures();
emptyProjectStats = new TranslationStats();
buildTestDocumentInfo();
setupDefaultMockExpectations();
appPresenter = new AppPresenter(mockDisplay, mockEventBus, mockDashboardPresenter, mockKeyShortcutPresenter, mockTranslationPresenter, mockDocumentListPresenter, mockSearchResultsPresenter, mockNotificationPresenter, mockLayoutPresenter, mockIdentity, mockWorkspaceContext, mockMessages, mockHistory, mockWindow, mockWindowLocation);
=======
resetAll();
appPresenter = new AppPresenter(mockDisplay, mockEventBus, mockKeyShortcutPresenter, mockTranslationPresenter, mockDocumentListPresenter, mockSearchResultsPresenter, mockNotificationPresenter, mockIdentity, mockUserWorkspaceContext, mockMessages, mockHistory, mockWindow, mockWindowLocation);
>>>>>>>
resetAll();
appPresenter = new AppPresenter(mockDisplay, mockEventBus, mockDashboardPresenter, mockKeyShortcutPresenter, mockTranslationPresenter, mockDocumentListPresenter, mockSearchResultsPresenter, mockNotificationPresenter, mockLayoutPresenter, mockIdentity, mockUserWorkspaceContext, mockMessages, mockHistory, mockWindow, mockWindowLocation);
<<<<<<<
mockLayoutPresenter.bind();
expectLastCall().once();
mockLayoutPresenter.setLayoutListener(mockTranslationPresenter);
expectLastCall().once();
mockDashboardPresenter.bind();
expectLastCall().once();
=======
>>>>>>>
mockLayoutPresenter.bind();
expectLastCall().once();
mockLayoutPresenter.setLayoutListener(mockTranslationPresenter);
expectLastCall().once();
mockDashboardPresenter.bind();
expectLastCall().once();
<<<<<<<
private void resetAllMocks()
{
reset(mockDisplay, mockDocumentListPresenter, mockDocumentsLink, mockErrorNotificationBtn);
reset(mockEventBus, mockHistory, mockIdentity, mockKeyShortcutPresenter);
reset(mockMessages, mockPerson, mockSearchResultsPresenter);
reset(mockTranslationPresenter, mockWindow, mockWindowLocation, mockWorkspaceContext);
reset(mockNotificationPresenter, mockLayoutPresenter, mockDashboardPresenter);
reset(mockSearchButton, mockKeyShortcutButton);
}
private void resetAllCaptures()
{
capturedDocumentLinkClickHandler.reset();
capturedDocumentSelectionEvent.reset();
capturedDocumentStatsUpdatedEventHandler.reset();
capturedHistoryTokenString.reset();
capturedHistoryValueChangeHandler.reset();
capturedKeyShortcuts.reset();
capturedProjectStatsUpdatedEventHandler.reset();
capturedSearchLinkClickHandler.reset();
capturedKeyShortcutButtonClickHandler.reset();
capturedWorkspaceContextUpdatedEventHandler.reset();
capturedPresenterRevealedHandler.reset();
capturedErrorNotificationBtnHandler.reset();
}
private void replayAllMocks()
{
replay(mockDisplay, mockDocumentListPresenter, mockDocumentsLink, mockErrorNotificationBtn);
replay(mockEventBus, mockHistory, mockIdentity, mockKeyShortcutPresenter);
replay(mockMessages, mockPerson, mockSearchResultsPresenter);
replay(mockTranslationPresenter, mockWindow, mockWindowLocation, mockWorkspaceContext);
replay(mockNotificationPresenter, mockLayoutPresenter, mockDashboardPresenter);
replay(mockSearchButton, mockKeyShortcutButton);
}
private void verifyAllMocks()
{
verify(mockDisplay, mockDocumentListPresenter, mockDocumentsLink, mockErrorNotificationBtn);
verify(mockEventBus, mockHistory, mockIdentity, mockKeyShortcutPresenter);
verify(mockMessages, mockPerson, mockSearchResultsPresenter);
verify(mockTranslationPresenter, mockWindow, mockWindowLocation, mockWorkspaceContext);
verify(mockNotificationPresenter, mockLayoutPresenter, mockDashboardPresenter);
verify(mockSearchButton, mockKeyShortcutButton);
}
=======
>>>>>>> |
<<<<<<<
@Nonnull AsyncTask<V, H> task) {
=======
AsyncTask<V, H> task, Runnable onComplete) {
>>>>>>>
@Nonnull AsyncTask<V, H> task, Runnable onComplete) { |
<<<<<<<
import org.zanata.rest.dto.DTOUtil;
import org.zanata.rest.dto.User;
import org.zanata.rest.editor.dto.Permission;
import org.zanata.rest.editor.service.UserService;
=======
import org.apache.deltaspike.jpa.api.transaction.Transactional;
>>>>>>>
import org.zanata.rest.dto.DTOUtil;
import org.apache.deltaspike.jpa.api.transaction.Transactional;
import org.zanata.rest.dto.User;
import org.zanata.rest.editor.dto.Permission;
import org.zanata.rest.editor.service.UserService; |
<<<<<<<
import javax.servlet.http.HttpServletRequest;
=======
import org.apache.deltaspike.jpa.api.transaction.Transactional;
>>>>>>>
import org.apache.deltaspike.jpa.api.transaction.Transactional;
import javax.servlet.http.HttpServletRequest; |
<<<<<<<
private List<String> contents;
=======
>>>>>>>
private List<String> contents;
<<<<<<<
this.contents = new ArrayList<String>(textFlow.getContents());
=======
setContents(textFlow.getContents());
>>>>>>>
this.contents = new ArrayList<String>(textFlow.getContents());
<<<<<<<
@Type(type = "text")
@AccessType("field")
@CollectionOfElements(fetch = FetchType.EAGER)
@JoinTable(name = "HTextFlowContentHistory",
joinColumns = @JoinColumn(name = "text_flow_history_id")
)
@IndexColumn(name = "pos", nullable = false)
@Column(name = "content", nullable = false)
@Override
public List<String> getContents()
{
return contents;
}
public void setContents(List<String> contents)
{
this.contents = contents;
}
=======
>>>>>>>
@NotEmpty
@Type(type = "text")
@AccessType("field")
@CollectionOfElements
@JoinTable(name = "HTextFlowContentHistory",
joinColumns = @JoinColumn(name = "text_flow_history_id")
)
@IndexColumn(name = "pos", nullable = false)
@Column(name = "content", nullable = false)
@Override
public List<String> getContents()
{
return contents;
}
public void setContents(List<String> contents)
{
this.contents = contents;
} |
<<<<<<<
selectedDocumentStats = new CommonContainerTranslationStatistics();
selectedDocumentStats.addStats(new TranslationStatistics(new TransUnitCount(1, 2, 3, 0, 0), LocaleId.EN_US.toString()));
selectedDocumentStats.addStats(new TranslationStatistics(new TransUnitWords(4, 5, 6, 0, 0), LocaleId.EN_US.toString()));
projectStats = new CommonContainerTranslationStatistics();
projectStats.addStats(new TranslationStatistics(new TransUnitCount(7, 8, 9, 0, 0), LocaleId.EN_US.toString()));
projectStats.addStats(new TranslationStatistics(new TransUnitWords(10, 11, 12, 0, 0), LocaleId.EN_US.toString()));
=======
selectedDocumentStats = new TranslationStats(new TransUnitCount(1, 2, 3), new TransUnitWords(4, 5, 6));
projectStats = new TranslationStats(new TransUnitCount(7, 8, 9), new TransUnitWords(10, 11, 12));
>>>>>>>
selectedDocumentStats = new CommonContainerTranslationStatistics();
selectedDocumentStats.addStats(new TranslationStatistics(new TransUnitCount(1, 2, 3, 0), LocaleId.EN_US.toString()));
selectedDocumentStats.addStats(new TranslationStatistics(new TransUnitWords(4, 5, 6, 0), LocaleId.EN_US.toString()));
projectStats = new CommonContainerTranslationStatistics();
projectStats.addStats(new TranslationStatistics(new TransUnitCount(7, 8, 9, 0), LocaleId.EN_US.toString()));
projectStats.addStats(new TranslationStatistics(new TransUnitWords(10, 11, 12, 0), LocaleId.EN_US.toString()));
<<<<<<<
CommonContainerTranslationStatistics newSelectedStats = new CommonContainerTranslationStatistics();
newSelectedStats.addStats(new TranslationStatistics(new TransUnitCount(1, 2, 3, 0, 0), LocaleId.EN_US.toString()));
newSelectedStats.addStats(new TranslationStatistics(new TransUnitWords(4, 5, 6, 0, 0), LocaleId.EN_US.toString()));
=======
TranslationStats newSelectedStats = new TranslationStats(new TransUnitCount(1, 2, 3), new TransUnitWords(4, 5, 6));
>>>>>>>
CommonContainerTranslationStatistics newSelectedStats = new CommonContainerTranslationStatistics();
newSelectedStats.addStats(new TranslationStatistics(new TransUnitCount(1, 2, 3, 0), LocaleId.EN_US.toString()));
newSelectedStats.addStats(new TranslationStatistics(new TransUnitWords(4, 5, 6, 0), LocaleId.EN_US.toString()));
<<<<<<<
CommonContainerTranslationStatistics newSelectedStats = new CommonContainerTranslationStatistics();
newSelectedStats.addStats(new TranslationStatistics(new TransUnitCount(1, 2, 3, 0, 0), LocaleId.EN_US.toString()));
newSelectedStats.addStats(new TranslationStatistics(new TransUnitWords(4, 5, 6, 0, 0), LocaleId.EN_US.toString()));
=======
TranslationStats newSelectedStats = new TranslationStats(new TransUnitCount(1, 2, 3), new TransUnitWords(4, 5, 6));
>>>>>>>
CommonContainerTranslationStatistics newSelectedStats = new CommonContainerTranslationStatistics();
newSelectedStats.addStats(new TranslationStatistics(new TransUnitCount(1, 2, 3, 0), LocaleId.EN_US.toString()));
newSelectedStats.addStats(new TranslationStatistics(new TransUnitWords(4, 5, 6, 0), LocaleId.EN_US.toString()));
<<<<<<<
CommonContainerTranslationStatistics newStats = new CommonContainerTranslationStatistics();
newStats.addStats(new TranslationStatistics(new TransUnitCount(9, 9, 9, 0, 0), LocaleId.EN_US.toString()));
newStats.addStats(new TranslationStatistics(new TransUnitWords(8, 8, 8, 0, 0), LocaleId.EN_US.toString()));
=======
TranslationStats newStats = new TranslationStats(new TransUnitCount(9, 9, 9), new TransUnitWords(8, 8, 8));
>>>>>>>
CommonContainerTranslationStatistics newStats = new CommonContainerTranslationStatistics();
newStats.addStats(new TranslationStatistics(new TransUnitCount(9, 9, 9, 0), LocaleId.EN_US.toString()));
newStats.addStats(new TranslationStatistics(new TransUnitWords(8, 8, 8, 0), LocaleId.EN_US.toString())); |
<<<<<<<
/**
* Shift focus to the page, in order to activate some elements that
* only exhibit behaviour on losing focus.
*/
public void defocus() {
getDriver().findElement(By.tagName("body")).click();
}
=======
public boolean hasNoCriticalErrors() {
return getDriver().findElements(By.id("errorMessage")).size() <= 0;
}
>>>>>>>
public boolean hasNoCriticalErrors() {
return getDriver().findElements(By.id("errorMessage")).size() <= 0;
}
/**
* Shift focus to the page, in order to activate some elements that
* only exhibit behaviour on losing focus.
*/
public void defocus() {
getDriver().findElement(By.tagName("body")).click();
} |
<<<<<<<
import java.util.List;
import net.customware.gwt.presenter.client.EventBus;
=======
>>>>>>>
import java.util.List;
import net.customware.gwt.presenter.client.EventBus;
<<<<<<<
=======
import com.allen_sauer.gwt.log.client.Log;
>>>>>>>
import com.allen_sauer.gwt.log.client.Log;
<<<<<<<
undoHandler.preUndo(updateInfoList);
undoHandler.executeUndo(updateInfoList);
=======
if (!canUndo)
{
return;
}
setText(messages.undoInProgress());
disableLink();
dispatcher.execute(revertAction, new AsyncCallback<UpdateTransUnitResult>()
{
@Override
public void onFailure(Throwable caught)
{
eventBus.fireEvent(new NotificationEvent(NotificationEvent.Severity.Error, messages.undoFailure()));
setText(messages.undo());
enableLink();
}
@Override
public void onSuccess(UpdateTransUnitResult result)
{
if (result.isAllSuccess())
{
eventBus.fireEvent(new NotificationEvent(NotificationEvent.Severity.Info, messages.undoSuccess()));
setText(messages.undone());
}
else
{
//most likely the undo link became stale i.e. entity state has changed on the server
Collection<TransUnitUpdateInfo> unsuccessful = Collections2.filter(result.getUpdateInfoList(), UnsuccessfulUpdatePredicate.INSTANCE);
int unsuccessfulCount = unsuccessful.size();
int successfulCount = result.getUpdateInfoList().size() - unsuccessfulCount;
Log.info("undo not all successful. #" + unsuccessfulCount + " unsucess and #" + successfulCount + " success");
eventBus.fireEvent(new NotificationEvent(NotificationEvent.Severity.Info, messages.undoUnsuccessful(unsuccessfulCount, successfulCount)));
setText("");
}
//we ensure the undo can only be click once.
handlerRegistration.removeHandler();
}
});
>>>>>>>
undoHandler.preUndo(updateInfoList);
undoHandler.executeUndo(updateInfoList); |
<<<<<<<
private static final String DOC_STATS_CACHE_NAME = BASE + ".docStatsCache";
=======
private static final String CACHE_NAME = BASE + ".filterCache";
private static final String TRANSLATED_TEXT_FLOW_CACHE_NAME = BASE + ".translatedTextFlowCache";
private static final String DOC_STATUS_CACHE_NAME = BASE + ".docStatusCache";
>>>>>>>
private static final String DOC_STATUS_CACHE_NAME = BASE + ".docStatusCache";
<<<<<<<
private CacheWrapper<TranslatedDocumentKey, DocumentStatus> docStatsCache;
=======
private CacheWrapper<LocaleId, TranslatedTextFlowFilter> filterCache;
private CacheWrapper<LocaleId, OpenBitSet> translatedTextFlowCache;
private CacheWrapper<TranslatedDocumentKey, DocumentStatus> docStatusCache;
>>>>>>>
private CacheWrapper<TranslatedDocumentKey, DocumentStatus> docStatusCache;
<<<<<<<
private CacheLoader<TranslatedDocumentKey, DocumentStatus> docStatsLoader;
=======
private CacheLoader<LocaleId, TranslatedTextFlowFilter> filterLoader;
private CacheLoader<LocaleId, OpenBitSet> bitsetLoader;
private CacheLoader<TranslatedDocumentKey, DocumentStatus> docStatusLoader;
>>>>>>>
private CacheLoader<TranslatedDocumentKey, DocumentStatus> docStatusLoader;
<<<<<<<
this.docStatsLoader = new HTextFlowTargetIdLoader();
=======
this.filterLoader = new FilterLoader();
this.bitsetLoader = new BitsetLoader();
this.docStatusLoader = new HTextFlowTargetIdLoader();
>>>>>>>
this.docStatusLoader = new HTextFlowTargetIdLoader();
<<<<<<<
public TranslationStateCacheImpl(
CacheLoader<TranslatedDocumentKey,
DocumentStatus> docStatsLoader,
CacheLoader<Long, Map<ValidationId, Boolean>> targetValidationLoader,
TextFlowTargetDAO textFlowTargetDAO,
ValidationService validationServiceImpl)
=======
public TranslationStateCacheImpl(CacheLoader<LocaleId, TranslatedTextFlowFilter> filterLoader,
CacheLoader<LocaleId, OpenBitSet> bitsetLoader,
CacheLoader<TranslatedDocumentKey, DocumentStatus> docStatsLoader,
CacheLoader<Long, Map<ValidationId, Boolean>> targetValidationLoader, TextFlowTargetDAO textFlowTargetDAO,
ValidationService validationServiceImpl)
>>>>>>>
public TranslationStateCacheImpl(
CacheLoader<TranslatedDocumentKey, DocumentStatus> docStatsLoader,
CacheLoader<Long, Map<ValidationId, Boolean>> targetValidationLoader,
TextFlowTargetDAO textFlowTargetDAO,
ValidationService validationServiceImpl)
<<<<<<<
this.docStatsLoader = docStatsLoader;
=======
this.filterLoader = filterLoader;
this.bitsetLoader = bitsetLoader;
this.docStatusLoader = docStatsLoader;
>>>>>>>
this.docStatusLoader = docStatsLoader;
<<<<<<<
docStatsCache = EhcacheWrapper.create(DOC_STATS_CACHE_NAME, cacheManager, docStatsLoader);
=======
filterCache = EhcacheWrapper.create(CACHE_NAME, cacheManager, filterLoader);
translatedTextFlowCache = EhcacheWrapper.create(TRANSLATED_TEXT_FLOW_CACHE_NAME, cacheManager, bitsetLoader);
docStatusCache = EhcacheWrapper.create(DOC_STATUS_CACHE_NAME, cacheManager, docStatusLoader);
>>>>>>>
docStatusCache = EhcacheWrapper.create(DOC_STATUS_CACHE_NAME, cacheManager, docStatusLoader);
<<<<<<<
public DocumentStatus getDocStats(Long documentId, LocaleId localeId)
=======
public Filter getFilter(LocaleId locale)
{
return filterCache.getWithLoader(locale);
}
@Override
public DocumentStatus getDocumentStatus(Long documentId, LocaleId localeId)
>>>>>>>
public DocumentStatus getDocumentStatus(Long documentId, LocaleId localeId)
<<<<<<<
private void invalidateDocLastTranslatedCache(Long documentId, LocaleId localeId)
=======
private void updateFilterCache(Long textFlowId, LocaleId localeId, ContentState newState)
{
TranslatedTextFlowFilter filter = filterCache.get(localeId);
if (filter != null)
{
filter.onTranslationStateChange(textFlowId, newState);
}
}
private void updateDocStatusCache(Long documentId, LocaleId localeId, Long updatedTargetId)
>>>>>>>
private void updateDocStatusCache(Long documentId, LocaleId localeId, Long updatedTargetId) |
<<<<<<<
Optional<Long> textFlowTargetId,
Class<?>... entities) {
=======
@Nonnull Class<?>... entityTypes) {
>>>>>>>
Optional<Long> textFlowTargetId,
@Nonnull Class<?>... entityTypes) {
<<<<<<<
targetLocaleId, maxResults, textFlowTargetId, entities);
=======
targetLocaleId, maxResults, entityTypes);
>>>>>>>
targetLocaleId, maxResults, textFlowTargetId, entityTypes); |
<<<<<<<
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.deltaspike.jpa.api.transaction.Transactional;
import org.zanata.security.annotations.Authenticated;
import org.zanata.security.annotations.CheckLoggedIn;
import org.zanata.security.annotations.CheckPermission;
=======
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Transactional;
import org.zanata.model.LanguageRequest;
import org.zanata.model.LocaleRole;
>>>>>>>
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.deltaspike.jpa.api.transaction.Transactional;
import org.zanata.security.annotations.Authenticated;
import org.zanata.model.LanguageRequest;
import org.zanata.model.LocaleRole;
<<<<<<<
@Inject
private UrlUtil urlUtil;
=======
@In
private RequestService requestServiceImpl;
@In
private Redirect redirect;
>>>>>>>
@Inject
private UrlUtil urlUtil; |
<<<<<<<
import org.fedorahosted.flies.rest.dto.DocumentInline;
import org.fedorahosted.flies.rest.dto.ProjectIteration;
=======
>>>>>>>
import org.fedorahosted.flies.rest.dto.DocumentInline;
import org.fedorahosted.flies.rest.dto.ProjectIteration;
<<<<<<<
public HProjectContainer(ProjectIteration project) {
}
=======
>>>>>>> |
<<<<<<<
/*
* Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source
=======
/**
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
>>>>>>>
/*
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source |
<<<<<<<
import org.apache.deltaspike.jpa.api.transaction.Transactional;
import org.jboss.seam.persistence.PersistenceProvider;
=======
import org.jboss.seam.annotations.Transactional;
>>>>>>>
import org.apache.deltaspike.jpa.api.transaction.Transactional; |
<<<<<<<
=======
public void saveAndMoveRow(NavigationType nav)
{
savePendingChange(true);
gotoRow(nav);
}
private boolean newMode = true, fuzzyMode = true;
>>>>>>>
public void saveAndMoveRow(NavigationType nav)
{
savePendingChange(true);
gotoRow(nav);
} |
<<<<<<<
public class AbstractPage
{
private final WebDriver driver;
private final FluentWait<WebDriver> ajaxWaitForTenSec;
public void deleteCookiesAndRefresh()
{
getDriver().manage().deleteAllCookies();
Set<Cookie> cookies = getDriver().manage().getCookies();
if (cookies.size() > 0)
{
log.warn("Failed to delete cookies: {}", cookies);
}
getDriver().navigate().refresh();
}
public AbstractPage(final WebDriver driver)
{
PageFactory.initElements(new AjaxElementLocatorFactory(driver, 10), this);
this.driver = driver;
ajaxWaitForTenSec = WebElementUtil.waitForTenSeconds(driver);
}
public WebDriver getDriver()
{
return driver;
}
public String getTitle()
{
return driver.getTitle();
}
public String getUrl()
{
return driver.getCurrentUrl();
}
public FluentWait<WebDriver> waitForTenSec()
{
return ajaxWaitForTenSec;
}
protected void clickAndCheckErrors(WebElement button)
{
button.click();
List<String> errors = getErrors();
if (!errors.isEmpty())
{
throw new RuntimeException(Joiner.on(";").join(errors));
}
}
protected void clickAndExpectErrors(WebElement button)
{
button.click();
refreshPageUntil(this, new Predicate<WebDriver>()
{
@Override
public boolean apply(WebDriver input)
{
return getErrors().size() > 0;
}
});
}
public List<String> getErrors()
{
List<WebElement> errorSpans = getDriver().findElements(By.xpath("//span[@class='errors']"));
return WebElementUtil.elementsToText(errorSpans);
}
/**
* Wait until expected number of errors presented on page or timeout.
*
* @param expectedNumber expected number of errors on page
* @return list of error message
*/
public List<String> getErrors(final int expectedNumber)
{
refreshPageUntil(this, new Predicate<WebDriver>()
{
@Override
public boolean apply(WebDriver input)
{
return getErrors().size() == expectedNumber;
}
});
return getErrors();
}
/**
* Wait for all necessary elements to be available on page.
*
* @param elementBys selenium search criteria for locating elements
*/
public void waitForPage(List<By> elementBys)
{
for (final By by : elementBys)
{
waitForTenSec().until(new Function<WebDriver, WebElement>()
{
=======
public class AbstractPage {
private final WebDriver driver;
private final FluentWait<WebDriver> ajaxWaitForTenSec;
public void deleteCookiesAndRefresh() {
getDriver().manage().deleteAllCookies();
Set<Cookie> cookies = getDriver().manage().getCookies();
if (cookies.size() > 0) {
log.warn("Failed to delete cookies: {}", cookies);
}
getDriver().navigate().refresh();
}
public AbstractPage(final WebDriver driver) {
PageFactory.initElements(new AjaxElementLocatorFactory(driver, 10),
this);
this.driver = driver;
ajaxWaitForTenSec = WebElementUtil.waitForTenSeconds(driver);
}
public WebDriver getDriver() {
return driver;
}
public String getTitle() {
return driver.getTitle();
}
public FluentWait<WebDriver> waitForTenSec() {
return ajaxWaitForTenSec;
}
protected void clickAndCheckErrors(WebElement button) {
button.click();
List<String> errors = getErrors();
if (!errors.isEmpty()) {
throw new RuntimeException(Joiner.on(";").join(errors));
}
}
protected void clickAndExpectErrors(WebElement button) {
button.click();
refreshPageUntil(this, new Predicate<WebDriver>() {
>>>>>>>
public class AbstractPage {
private final WebDriver driver;
private final FluentWait<WebDriver> ajaxWaitForTenSec;
public void deleteCookiesAndRefresh() {
getDriver().manage().deleteAllCookies();
Set<Cookie> cookies = getDriver().manage().getCookies();
if (cookies.size() > 0) {
log.warn("Failed to delete cookies: {}", cookies);
}
getDriver().navigate().refresh();
}
public AbstractPage(final WebDriver driver) {
PageFactory.initElements(new AjaxElementLocatorFactory(driver, 10),
this);
this.driver = driver;
ajaxWaitForTenSec = WebElementUtil.waitForTenSeconds(driver);
}
public WebDriver getDriver() {
return driver;
}
public String getTitle() {
return driver.getTitle();
}
public String getUrl() {
return driver.getCurrentUrl();
}
public FluentWait<WebDriver> waitForTenSec() {
return ajaxWaitForTenSec;
}
protected void clickAndCheckErrors(WebElement button) {
button.click();
List<String> errors = getErrors();
if (!errors.isEmpty()) {
throw new RuntimeException(Joiner.on(";").join(errors));
}
}
protected void clickAndExpectErrors(WebElement button) {
button.click();
refreshPageUntil(this, new Predicate<WebDriver>() { |
<<<<<<<
import static com.google.gerrit.server.project.ProjectCache.illegalState;
import com.google.gerrit.common.FooterConstants;
=======
>>>>>>>
import static com.google.gerrit.server.project.ProjectCache.illegalState;
<<<<<<<
sanitizedCommitMessage =
ensureChangeIdIsCorrect(
projectCache
.get(resource.getProject())
.orElseThrow(illegalState(resource.getProject()))
.is(BooleanProjectConfig.REQUIRE_CHANGE_ID),
resource.getChange().getKey().get(),
sanitizedCommitMessage);
=======
ChangeUtil.ensureChangeIdIsCorrect(
projectCache.checkedGet(resource.getProject()).is(BooleanProjectConfig.REQUIRE_CHANGE_ID),
resource.getChange().getKey().get(),
sanitizedCommitMessage);
>>>>>>>
ChangeUtil.ensureChangeIdIsCorrect(
projectCache
.get(resource.getProject())
.orElseThrow(illegalState(resource.getProject()))
.is(BooleanProjectConfig.REQUIRE_CHANGE_ID),
resource.getChange().getKey().get(),
sanitizedCommitMessage); |
<<<<<<<
import com.google.gwt.user.client.ui.HasVisibility;
=======
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
>>>>>>>
<<<<<<<
public void setLayoutMenuVisible(boolean visible)
{
layoutMenuItem.setVisible(visible);
layoutMenuSeperator.setVisible(visible);
}
@Override
public void setErrorNotificationText(int count)
=======
public void setNotificationText(int count, Severity severity)
>>>>>>>
public void setLayoutMenuVisible(boolean visible)
{
layoutMenuItem.setVisible(visible);
layoutMenuSeperator.setVisible(visible);
}
@Override
public void setNotificationText(int count, Severity severity) |
<<<<<<<
import org.fedorahosted.flies.webtrans.editor.WebTransEditorFooter;
import org.fedorahosted.flies.webtrans.editor.WebTransEditorHeader;
import org.fedorahosted.flies.webtrans.editor.WebTransEditorPresenter;
import org.fedorahosted.flies.webtrans.editor.WebTransEditorView;
import org.fedorahosted.flies.webtrans.editor.WebTransScrollTable;
=======
>>>>>>>
import org.fedorahosted.flies.webtrans.editor.WebTransEditorFooter;
import org.fedorahosted.flies.webtrans.editor.WebTransEditorHeader;
import org.fedorahosted.flies.webtrans.editor.WebTransEditorPresenter;
import org.fedorahosted.flies.webtrans.editor.WebTransEditorView; |
<<<<<<<
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.seam.core.Conversation;
=======
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.Conversation;
>>>>>>>
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.seam.core.Conversation;
import org.jboss.seam.core.Conversation;
<<<<<<<
@Named("loginAction")
@javax.faces.bean.ViewScoped
@Slf4j
=======
@Name("loginAction")
@Scope(ScopeType.PAGE)
@Slf4j
>>>>>>>
@Named("loginAction")
@javax.faces.bean.ViewScoped
@Slf4j
<<<<<<<
@Inject
private UserRedirectBean userRedirect;
=======
@In
private UserRedirectBean userRedirect;
>>>>>>>
@Inject
private UserRedirectBean userRedirect; |
<<<<<<<
import org.zanata.rest.client.IVersionResource;
=======
import org.zanata.rest.client.IVersion;
import org.zanata.rest.client.TestProxyFactory;
>>>>>>>
import org.zanata.rest.client.IVersionResource;
import org.zanata.rest.client.TestProxyFactory;
<<<<<<<
private static final String AUTH_KEY = "b6d7044e9ee3b2447c28fb7c50d86d98";
private static final String USERNAME = "admin";
private IVersionResource version;
=======
private IVersion version;
>>>>>>>
private IVersionResource version;
<<<<<<<
TestProxyFactory clientRequestFactory = new TestProxyFactory(new URI("http://example.com/"), USERNAME, AUTH_KEY, new SeamMockClientExecutor(this), new VersionInfo("SNAPSHOT", ""));
version = clientRequestFactory.createIVersionResource();
=======
TestProxyFactory clientRequestFactory = new TestProxyFactory(new SeamMockClientExecutor(this));
version = clientRequestFactory.createIVersion();
>>>>>>>
TestProxyFactory clientRequestFactory = new TestProxyFactory(new SeamMockClientExecutor(this));
version = clientRequestFactory.createIVersionResource(); |
<<<<<<<
void setErrorNotificationText(int count);
void setLayoutMenuVisible(boolean visible);
=======
void setNotificationText(int count, Severity severity);
>>>>>>>
void setLayoutMenuVisible(boolean visible);
void setNotificationText(int count, Severity severity);
<<<<<<<
layoutSelectorPresenter.bind();
layoutSelectorPresenter.setLayoutListener(translationPresenter);
notificationPresenter.setErrorLabelListener(this);
=======
notificationPresenter.setNotificationListener(this);
>>>>>>>
layoutSelectorPresenter.bind();
layoutSelectorPresenter.setLayoutListener(translationPresenter);
notificationPresenter.setNotificationListener(this); |
<<<<<<<
=======
public ManageUserPage cancelEditUser()
{
cancelButton.click();
return new ManageUserPage(getDriver());
}
public ManageUserAccountPage clearFields()
{
waitForTenSec().until(new Predicate<WebDriver>()
{
@Override
public boolean apply(WebDriver input)
{
input.findElement(usernameBy).clear();
return input.findElement(usernameBy).getAttribute("value").isEmpty();
}
});
passwordField.clear();
passwordConfirmField.clear();
return new ManageUserAccountPage(getDriver());
}
>>>>>>>
public ManageUserPage cancelEditUser()
{
cancelButton.click();
return new ManageUserPage(getDriver());
}
public ManageUserAccountPage clearFields()
{
waitForTenSec().until(new Predicate<WebDriver>()
{
@Override
public boolean apply(WebDriver input)
{
input.findElement(usernameBy).clear();
return input.findElement(usernameBy).getAttribute("value").isEmpty();
}
});
passwordField.clear();
passwordConfirmField.clear();
return new ManageUserAccountPage(getDriver());
} |
<<<<<<<
expect(mockMessages.thisIsAPublicChannel()).andReturn(PUBLIC_CHANNEL_WARN);
mockDisplay.appendChat(null, null, PUBLIC_CHANNEL_WARN, MESSAGE_TYPE.SYSTEM_WARNING);
expectLastCall().once();
expect(mockSessionService.getColor("sessionId1")).andReturn("color1");
expect(mockSessionService.getColor("sessionId2")).andReturn("color2");
expect(mockSessionService.getColor("sessionId3")).andReturn("color3");
=======
expect(mockSessionService.getColor(editorClientId1.getValue())).andReturn("color1");
expect(mockSessionService.getColor(editorClientId2.getValue())).andReturn("color2");
expect(mockSessionService.getColor(editorClientId3.getValue())).andReturn("color3");
>>>>>>>
expect(mockMessages.thisIsAPublicChannel()).andReturn(PUBLIC_CHANNEL_WARN);
mockDisplay.appendChat(null, null, PUBLIC_CHANNEL_WARN, MESSAGE_TYPE.SYSTEM_WARNING);
expectLastCall().once();
expect(mockSessionService.getColor(editorClientId1.getValue())).andReturn("color1");
expect(mockSessionService.getColor(editorClientId2.getValue())).andReturn("color2");
expect(mockSessionService.getColor(editorClientId3.getValue())).andReturn("color3"); |
<<<<<<<
=======
import com.google.common.util.concurrent.MoreExecutors;
import org.jboss.seam.Component;
>>>>>>>
import com.google.common.util.concurrent.MoreExecutors; |
<<<<<<<
=======
import javax.annotation.Nonnull;
>>>>>>>
import javax.annotation.Nonnull;
<<<<<<<
import org.hibernate.search.annotations.Analyze;
=======
>>>>>>>
import org.hibernate.search.annotations.Analyze;
<<<<<<<
import org.hibernate.validator.constraints.NotEmpty;
=======
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.hibernate.validator.constraints.NotEmpty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; |
<<<<<<<
PropWriter.write(docIn, TEST_OUTPUT_DIR, ISO_8859_1);
=======
PropWriter.write(docIn, new File("target/test-output"));
>>>>>>>
PropWriter.write(docIn, TEST_OUTPUT_DIR);
<<<<<<<
PropWriter.write(null, docIn, TEST_OUTPUT_DIR, "test", locale, ISO_8859_1);
assertInputAndOutputDocContentSame(docName);
}
/**
* Asserts that the content of the input document and output document are
* identical. Assumes filename is the same for both documents and that the
* output file is in TEST_OUTPUT_DIR.
*
* @param docName the name for both input and output files
* @throws FileNotFoundException
* @throws IOException
* @throws MalformedURLException
*/
private void assertInputAndOutputDocContentSame(String docName) throws FileNotFoundException, IOException, MalformedURLException
{
File newFile = new File(TEST_OUTPUT_DIR.getPath() + File.separator + docName);
InputStream newStream = newFile.toURI().toURL().openStream();
InputStream origStream = getResourceAsStream(docName);
String origContent = IOUtils.toString(origStream);
String newContent = IOUtils.toString(newStream);
=======
PropWriter.write(docIn, new File("target/test-output"), "test", locale);
>>>>>>>
PropWriter.write(null, docIn, TEST_OUTPUT_DIR, "test", locale);
assertInputAndOutputDocContentSame(docName);
}
/**
* Asserts that the content of the input document and output document are
* identical. Assumes filename is the same for both documents and that the
* output file is in TEST_OUTPUT_DIR.
*
* @param docName the name for both input and output files
* @throws FileNotFoundException
* @throws IOException
* @throws MalformedURLException
*/
private void assertInputAndOutputDocContentSame(String docName) throws FileNotFoundException, IOException, MalformedURLException
{
File newFile = new File(TEST_OUTPUT_DIR.getPath() + File.separator + docName);
InputStream newStream = newFile.toURI().toURL().openStream();
InputStream origStream = getResourceAsStream(docName);
String origContent = IOUtils.toString(origStream);
String newContent = IOUtils.toString(newStream); |
<<<<<<<
indexables.add(HProjectIteration.class);
=======
indexables.add(HTextFlowTarget.class);
>>>>>>>
indexables.add(HProjectIteration.class);
indexables.add(HTextFlowTarget.class); |
<<<<<<<
validateParentUpdate(ctl, input.parent, checkIfAdmin);
=======
String parentName = MoreObjects.firstNonNull(
Strings.emptyToNull(input.parent), allProjects.get());
validateParentUpdate(ctl, parentName, true);
IdentifiedUser user = (IdentifiedUser) ctl.getCurrentUser();
>>>>>>>
String parentName = MoreObjects.firstNonNull(
Strings.emptyToNull(input.parent), allProjects.get());
validateParentUpdate(ctl, parentName, checkIfAdmin); |
<<<<<<<
import org.zanata.webtrans.client.events.NavTransUnitEvent;
import org.zanata.webtrans.client.events.PublishWorkspaceChatEvent;
import org.zanata.webtrans.client.events.PublishWorkspaceChatEventHandler;
=======
import org.zanata.webtrans.client.events.NativeEvent;
>>>>>>>
import org.zanata.webtrans.client.events.NavTransUnitEvent;
<<<<<<<
import org.zanata.webtrans.client.rpc.CachingDispatchAsync;
import org.zanata.webtrans.client.service.NavigationController;
=======
>>>>>>>
import org.zanata.webtrans.client.service.NavigationController;
<<<<<<<
public TranslationPresenter(Display display, EventBus eventBus, CachingDispatchAsync dispatcher, final TargetContentsPresenter targetContentsPresenter, final WorkspaceUsersPresenter workspaceUsersPresenter, final TranslationEditorPresenter translationEditorPresenter, final OptionsPanelPresenter optionsPanelPresenter, final TransMemoryPresenter transMemoryPresenter, final GlossaryPresenter glossaryPresenter, final WebTransMessages messages, final UserWorkspaceContext userWorkspaceContext, final KeyShortcutPresenter keyShortcutPresenter, NavigationController navigationController)
=======
public TranslationPresenter(Display display, EventBus eventBus, final TargetContentsPresenter targetContentsPresenter, final TranslationEditorPresenter translationEditorPresenter, final TransMemoryPresenter transMemoryPresenter, final GlossaryPresenter glossaryPresenter, final WebTransMessages messages, final NativeEvent nativeEvent, final UserWorkspaceContext userWorkspaceContext, final KeyShortcutPresenter keyShortcutPresenter)
>>>>>>>
public TranslationPresenter(Display display, EventBus eventBus, final TargetContentsPresenter targetContentsPresenter, final TranslationEditorPresenter translationEditorPresenter, final TransMemoryPresenter transMemoryPresenter, final GlossaryPresenter glossaryPresenter, final WebTransMessages messages, final UserWorkspaceContext userWorkspaceContext, final KeyShortcutPresenter keyShortcutPresenter, NavigationController navigationController) |
<<<<<<<
=======
import java.util.HashMap;
import java.util.Map;
import net.customware.gwt.dispatch.client.DispatchAsync;
>>>>>>>
import java.util.HashMap;
import java.util.Map;
<<<<<<<
=======
import org.zanata.webtrans.client.events.ButtonDisplayChangeEvent;
import org.zanata.webtrans.client.events.FilterViewEvent;
import org.zanata.webtrans.client.events.FilterViewEventHandler;
import org.zanata.webtrans.client.events.UserConfigChangeEvent;
import org.zanata.webtrans.client.resources.EditorConfigConstants;
import org.zanata.webtrans.client.rpc.CachingDispatchAsync;
>>>>>>>
import org.zanata.webtrans.client.events.ButtonDisplayChangeEvent;
import org.zanata.webtrans.client.events.FilterViewEvent;
import org.zanata.webtrans.client.events.FilterViewEventHandler;
import org.zanata.webtrans.client.events.UserConfigChangeEvent;
import org.zanata.webtrans.client.resources.EditorConfigConstants;
<<<<<<<
=======
this.dispatcher = dispatcher;
configMap.put(EditorConfigConstants.BUTTON_ENTER, false);
configMap.put(EditorConfigConstants.BUTTON_ESC, false);
configMap.put(EditorConfigConstants.BUTTON_FUZZY, true);
configMap.put(EditorConfigConstants.BUTTON_UNTRANSLATED, true);
>>>>>>>
configMap.put(EditorConfigConstants.BUTTON_ENTER, false);
configMap.put(EditorConfigConstants.BUTTON_ESC, false);
configMap.put(EditorConfigConstants.BUTTON_FUZZY, true);
configMap.put(EditorConfigConstants.BUTTON_UNTRANSLATED, true); |
<<<<<<<
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.server.change.NotifyResolver;
=======
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.change.DeleteReviewerByEmailOp;
import com.google.gerrit.server.change.DeleteReviewerOp;
>>>>>>>
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.server.change.DeleteReviewerByEmailOp;
import com.google.gerrit.server.change.DeleteReviewerOp;
import com.google.gerrit.server.change.NotifyResolver; |
<<<<<<<
account.getPerson().getName(),
account.getPerson().getEmail(),
account.getAccountActivationKey().getKeyHash());
facesMessages.addGlobal(message);
=======
account.getPerson().getName(),
account.getPerson().getEmail(),
account.getAccountActivationKey().getKeyHash());
FacesMessages.instance().add(message);
}
>>>>>>>
account.getPerson().getName(),
account.getPerson().getEmail(),
account.getAccountActivationKey().getKeyHash());
facesMessages.addGlobal(message);
}
<<<<<<<
account.getPerson().setEmail(email);
facesMessages.addGlobal("Email updated.");
=======
getAccount().getPerson().setEmail(email);
FacesMessages.instance().add("Email updated.");
>>>>>>>
getAccount().getPerson().setEmail(email);
facesMessages.addGlobal("Email updated.");
<<<<<<<
facesMessages.addToControl("email",
"#{msgs['javax.faces.component.UIInput.REQUIRED']}");
=======
FacesMessages.instance().addToControl("email",
"#{msgs['javax.faces.component.UIInput.REQUIRED']}");
>>>>>>>
facesMessages.addToControl("email",
"#{msgs['javax.faces.component.UIInput.REQUIRED']}");
<<<<<<<
if (person != null && !person.getAccount().equals(account)) {
facesMessages.addToControl("email",
"This email address is already taken");
=======
if (person != null && !person.getAccount().equals(getAccount())) {
FacesMessages.instance().addToControl("email",
"This email address is already taken");
>>>>>>>
if (person != null && !person.getAccount().equals(getAccount())) {
facesMessages.addToControl("email",
"This email address is already taken"); |
<<<<<<<
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnits;
=======
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnit;
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnitResult;
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnitList;
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnitListResult;
>>>>>>>
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnit;
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnitResult;
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnitList;
import net.openl10n.flies.webtrans.shared.rpc.GetTransUnitListResult;
<<<<<<<
void startProcessing();
void stopProcessing();
=======
void setFindMessage(String findMessage);
>>>>>>>
void setFindMessage(String findMessage);
void startProcessing();
void stopProcessing(); |
<<<<<<<
final SuggestBox suggestBox = new SuggestBox(
new RemoteSuggestOracle(new SearchSuggestOracle()),
searchBox, suggestionDisplay);
searchBox.setStyleName("searchTextBox");
=======
final SuggestBox suggestBox =
new SuggestBox(new SearchSuggestOracle(), searchBox, suggestionDisplay);
searchBox.setStyleName("gwt-TextBox");
>>>>>>>
final SuggestBox suggestBox =
new SuggestBox(new SearchSuggestOracle(), searchBox, suggestionDisplay);
searchBox.setStyleName("searchTextBox"); |
<<<<<<<
import javax.inject.Inject;
import javax.inject.Named;
=======
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.zanata.common.ContentState;
>>>>>>>
import javax.inject.Inject;
import javax.inject.Named;
import org.zanata.common.ContentState;
<<<<<<<
@Named("copyTransWorkFactory")
@javax.enterprise.context.Dependent
=======
@Name("copyTransWorkFactory")
@Scope(ScopeType.STATELESS)
@Slf4j
>>>>>>>
@Named("copyTransWorkFactory")
@javax.enterprise.context.Dependent
@Slf4j
<<<<<<<
@Inject
// @Inject
=======
@In("textFlowTargetDAO")
>>>>>>>
@Inject |
<<<<<<<
import org.zanata.webtrans.client.service.UserColorService;
import org.zanata.webtrans.client.service.UserSessionService;
=======
>>>>>>>
import org.zanata.webtrans.client.service.UserColorService;
import org.zanata.webtrans.client.service.UserSessionService;
<<<<<<<
private final UserColorService translatorColorService;
=======
private boolean isModalNavEnabled;
>>>>>>>
private final UserColorService translatorColorService;
private boolean isModalNavEnabled; |
<<<<<<<
public class MediaTypes {
public static enum Format{
XML("xml"),
JSON("json");
private final String format;
private Format(String format) {
this.format = format;
}
public String toString() {
return "+" + format;
};
}
private static final String XML = "+xml";
private static final String JSON = "+json";
private static final String APPLICATION_VND_FLIES = "application/vnd.flies";
public static final String APPLICATION_FLIES_PROJECT = APPLICATION_VND_FLIES + ".project";
public static final String APPLICATION_FLIES_PROJECT_XML = APPLICATION_FLIES_PROJECT + XML;
public static final String APPLICATION_FLIES_PROJECT_JSON = APPLICATION_FLIES_PROJECT + JSON;
public static final String APPLICATION_FLIES_PROJECTS = APPLICATION_VND_FLIES + ".projects";
public static final String APPLICATION_FLIES_PROJECTS_XML = APPLICATION_FLIES_PROJECTS + XML;
public static final String APPLICATION_FLIES_PROJECTS_JSON = APPLICATION_FLIES_PROJECTS + JSON;
public static final String APPLICATION_FLIES_PROJECT_ITERATION = APPLICATION_VND_FLIES + ".project.iteration";
public static final String APPLICATION_FLIES_PROJECT_ITERATION_XML = APPLICATION_FLIES_PROJECT_ITERATION + XML;
public static final String APPLICATION_FLIES_PROJECT_ITERATION_JSON = APPLICATION_FLIES_PROJECT_ITERATION + JSON;
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS = APPLICATION_VND_FLIES + ".project.iterations";
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS_XML = APPLICATION_FLIES_PROJECT_ITERATIONS + XML;
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS_JSON = APPLICATION_FLIES_PROJECT_ITERATIONS + JSON;
public static final String APPLICATION_FLIES_DOCUMENT = APPLICATION_VND_FLIES + ".document";
public static final String APPLICATION_FLIES_DOCUMENT_XML = APPLICATION_FLIES_DOCUMENT + XML;
public static final String APPLICATION_FLIES_DOCUMENT_JSON = APPLICATION_FLIES_DOCUMENT + JSON;
public static final String APPLICATION_FLIES_DOCUMENTS = APPLICATION_VND_FLIES + ".documents";
public static final String APPLICATION_FLIES_DOCUMENTS_XML = APPLICATION_FLIES_DOCUMENTS + XML;
public static final String APPLICATION_FLIES_DOCUMENTS_JSON = APPLICATION_FLIES_DOCUMENTS + JSON;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE = APPLICATION_VND_FLIES + ".document.resource";
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE_XML = APPLICATION_FLIES_DOCUMENT_RESOURCE + XML;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE_JSON = APPLICATION_FLIES_DOCUMENT_RESOURCE + JSON;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES = APPLICATION_VND_FLIES + ".document.resources";
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES_XML = APPLICATION_FLIES_DOCUMENT_RESOURCES + XML;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES_JSON = APPLICATION_FLIES_DOCUMENT_RESOURCES + JSON;
public static final String APPLICATION_FLIES_ACCOUNT = APPLICATION_VND_FLIES + ".account";
public static final String APPLICATION_FLIES_ACCOUNT_XML = APPLICATION_FLIES_DOCUMENTS + XML;
public static final String APPLICATION_FLIES_ACCOUNT_JSON = APPLICATION_FLIES_DOCUMENTS + JSON;
/**
* Creates a format specific MediaType string given an existing media type
*
* @param type the new type
* @param from an existing media type with a format modifier such as xml or json
* @return type with the format modifier from from
*/
public static String createFormatSpecificType(String type, MediaType from){
StringBuilder str = new StringBuilder(type);
String subtype = from.getSubtype();
int plusIndex = subtype.indexOf('+');
if(!(type.charAt(type.length()-1) == '/')) {
str.append('+');
}
if(plusIndex != -1)
str.append( subtype.substring( plusIndex+1 ) );
else
str.append(subtype);
return str.toString();
}
=======
public class MediaTypes
{
public static enum Format
{
XML("xml"), JSON("json");
private final String format;
private Format(String format)
{
this.format = format;
}
public String toString()
{
return "+" + format;
};
}
private static final String XML = "+xml";
private static final String JSON = "+json";
private static final String APPLICATION_VND_FLIES = "application/vnd.flies";
public static final String APPLICATION_FLIES_PROJECT = APPLICATION_VND_FLIES + ".project";
public static final String APPLICATION_FLIES_PROJECT_XML = APPLICATION_FLIES_PROJECT + XML;
public static final String APPLICATION_FLIES_PROJECT_JSON = APPLICATION_FLIES_PROJECT + JSON;
public static final String APPLICATION_FLIES_PROJECTS = APPLICATION_VND_FLIES + ".projects";
public static final String APPLICATION_FLIES_PROJECTS_XML = APPLICATION_FLIES_PROJECTS + XML;
public static final String APPLICATION_FLIES_PROJECTS_JSON = APPLICATION_FLIES_PROJECTS + JSON;
public static final String APPLICATION_FLIES_PROJECT_ITERATION = APPLICATION_VND_FLIES + ".project.iteration";
public static final String APPLICATION_FLIES_PROJECT_ITERATION_XML = APPLICATION_FLIES_PROJECT_ITERATION + XML;
public static final String APPLICATION_FLIES_PROJECT_ITERATION_JSON = APPLICATION_FLIES_PROJECT_ITERATION + JSON;
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS = APPLICATION_VND_FLIES + ".project.iterations";
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS_XML = APPLICATION_FLIES_PROJECT_ITERATIONS + XML;
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS_JSON = APPLICATION_FLIES_PROJECT_ITERATIONS + JSON;
public static final String APPLICATION_FLIES_DOCUMENT = APPLICATION_VND_FLIES + ".document";
public static final String APPLICATION_FLIES_DOCUMENT_XML = APPLICATION_FLIES_DOCUMENT + XML;
public static final String APPLICATION_FLIES_DOCUMENT_JSON = APPLICATION_FLIES_DOCUMENT + JSON;
public static final String APPLICATION_FLIES_DOCUMENTS = APPLICATION_VND_FLIES + ".documents";
public static final String APPLICATION_FLIES_DOCUMENTS_XML = APPLICATION_FLIES_DOCUMENTS + XML;
public static final String APPLICATION_FLIES_DOCUMENTS_JSON = APPLICATION_FLIES_DOCUMENTS + JSON;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE = APPLICATION_VND_FLIES + ".document.resource";
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE_XML = APPLICATION_FLIES_DOCUMENT_RESOURCE + XML;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE_JSON = APPLICATION_FLIES_DOCUMENT_RESOURCE + JSON;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES = APPLICATION_VND_FLIES + ".document.resources";
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES_XML = APPLICATION_FLIES_DOCUMENT_RESOURCES + XML;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES_JSON = APPLICATION_FLIES_DOCUMENT_RESOURCES + JSON;
/**
* Creates a format specific MediaType string given an existing media type
*
* @param type the new type
* @param from an existing media type with a format modifier such as xml or
* json
* @return type with the format modifier from from
*/
public static String createFormatSpecificType(String type, MediaType from)
{
StringBuilder str = new StringBuilder(type);
String subtype = from.getSubtype();
int plusIndex = subtype.indexOf('+');
if (!(type.charAt(type.length() - 1) == '/'))
{
str.append('+');
}
if (plusIndex != -1)
str.append(subtype.substring(plusIndex + 1));
else
str.append(subtype);
return str.toString();
}
>>>>>>>
public class MediaTypes
{
public static enum Format
{
XML("xml"), JSON("json");
private final String format;
private Format(String format)
{
this.format = format;
}
public String toString()
{
return "+" + format;
};
}
private static final String XML = "+xml";
private static final String JSON = "+json";
private static final String APPLICATION_VND_FLIES = "application/vnd.flies";
public static final String APPLICATION_FLIES_PROJECT = APPLICATION_VND_FLIES + ".project";
public static final String APPLICATION_FLIES_PROJECT_XML = APPLICATION_FLIES_PROJECT + XML;
public static final String APPLICATION_FLIES_PROJECT_JSON = APPLICATION_FLIES_PROJECT + JSON;
public static final String APPLICATION_FLIES_PROJECTS = APPLICATION_VND_FLIES + ".projects";
public static final String APPLICATION_FLIES_PROJECTS_XML = APPLICATION_FLIES_PROJECTS + XML;
public static final String APPLICATION_FLIES_PROJECTS_JSON = APPLICATION_FLIES_PROJECTS + JSON;
public static final String APPLICATION_FLIES_PROJECT_ITERATION = APPLICATION_VND_FLIES + ".project.iteration";
public static final String APPLICATION_FLIES_PROJECT_ITERATION_XML = APPLICATION_FLIES_PROJECT_ITERATION + XML;
public static final String APPLICATION_FLIES_PROJECT_ITERATION_JSON = APPLICATION_FLIES_PROJECT_ITERATION + JSON;
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS = APPLICATION_VND_FLIES + ".project.iterations";
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS_XML = APPLICATION_FLIES_PROJECT_ITERATIONS + XML;
public static final String APPLICATION_FLIES_PROJECT_ITERATIONS_JSON = APPLICATION_FLIES_PROJECT_ITERATIONS + JSON;
public static final String APPLICATION_FLIES_DOCUMENT = APPLICATION_VND_FLIES + ".document";
public static final String APPLICATION_FLIES_DOCUMENT_XML = APPLICATION_FLIES_DOCUMENT + XML;
public static final String APPLICATION_FLIES_DOCUMENT_JSON = APPLICATION_FLIES_DOCUMENT + JSON;
public static final String APPLICATION_FLIES_DOCUMENTS = APPLICATION_VND_FLIES + ".documents";
public static final String APPLICATION_FLIES_DOCUMENTS_XML = APPLICATION_FLIES_DOCUMENTS + XML;
public static final String APPLICATION_FLIES_DOCUMENTS_JSON = APPLICATION_FLIES_DOCUMENTS + JSON;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE = APPLICATION_VND_FLIES + ".document.resource";
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE_XML = APPLICATION_FLIES_DOCUMENT_RESOURCE + XML;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCE_JSON = APPLICATION_FLIES_DOCUMENT_RESOURCE + JSON;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES = APPLICATION_VND_FLIES + ".document.resources";
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES_XML = APPLICATION_FLIES_DOCUMENT_RESOURCES + XML;
public static final String APPLICATION_FLIES_DOCUMENT_RESOURCES_JSON = APPLICATION_FLIES_DOCUMENT_RESOURCES + JSON;
public static final String APPLICATION_FLIES_ACCOUNT = APPLICATION_VND_FLIES + ".account";
public static final String APPLICATION_FLIES_ACCOUNT_XML = APPLICATION_FLIES_DOCUMENTS + XML;
public static final String APPLICATION_FLIES_ACCOUNT_JSON = APPLICATION_FLIES_DOCUMENTS + JSON;
/**
* Creates a format specific MediaType string given an existing media type
*
* @param type the new type
* @param from an existing media type with a format modifier such as xml or
* json
* @return type with the format modifier from from
*/
public static String createFormatSpecificType(String type, MediaType from)
{
StringBuilder str = new StringBuilder(type);
String subtype = from.getSubtype();
int plusIndex = subtype.indexOf('+');
if (!(type.charAt(type.length() - 1) == '/'))
{
str.append('+');
}
if (plusIndex != -1)
str.append(subtype.substring(plusIndex + 1));
else
str.append(subtype);
return str.toString();
} |
<<<<<<<
documentsTabLanguageFilter.reset();
=======
>>>>>>>
<<<<<<<
languageTabDocumentFilter.reset();
=======
>>>>>>>
<<<<<<<
documentsTabDocumentFilter.reset();
=======
>>>>>>>
<<<<<<<
settingsTabDocumentFilter.reset();
=======
>>>>>>> |
<<<<<<<
this.transUnitInfoPresenter = transUnitInfoPresenter;
bind();
=======
>>>>>>>
this.transUnitInfoPresenter = transUnitInfoPresenter; |
<<<<<<<
=======
import com.google.common.base.Optional;
>>>>>>>
import com.google.common.base.Optional; |
<<<<<<<
import org.zanata.util.FacesNavigationUtil;
=======
import org.zanata.ui.faces.FacesMessages;
>>>>>>>
import org.zanata.util.FacesNavigationUtil;
import org.zanata.ui.faces.FacesMessages;
<<<<<<<
sourceVersionSlug, targetProjectSlug, targetVersionSlug,
!keepExistingTranslation);
FacesNavigationUtil.handlePageNavigation(null, "merge-translation");
=======
sourceVersionSlug, targetProjectSlug, targetVersionSlug,
!keepExistingTranslation);
>>>>>>>
sourceVersionSlug, targetProjectSlug, targetVersionSlug,
!keepExistingTranslation);
FacesNavigationUtil.handlePageNavigation(null, "merge-translation"); |
<<<<<<<
public void exitWorkspace(@Observes Logout payload, @DeltaSpike HttpSession session) {
exitWorkspace(payload.getUsername(), session.getId());
=======
@Observer(LogoutEvent.EVENT_NAME)
public void exitWorkspace(@Observes LogoutEvent payload) {
exitWorkspace(payload.getUsername());
>>>>>>>
public void exitWorkspace(@Observes LogoutEvent payload, @DeltaSpike HttpSession session) {
exitWorkspace(payload.getUsername(), session.getId()); |
<<<<<<<
import javax.inject.Inject;
import javax.inject.Named;
=======
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.faces.Redirect;
>>>>>>>
import javax.inject.Inject;
import javax.inject.Named;
<<<<<<<
@Named("activate")
@org.apache.deltaspike.core.api.scope.ViewAccessScoped /* TODO [CDI] check this: migrated from ScopeType.CONVERSATION */
=======
import lombok.Getter;
import lombok.Setter;
@Name("activate")
@Scope(ScopeType.CONVERSATION)
>>>>>>>
import lombok.Getter;
import lombok.Setter;
@Named("activate")
@org.apache.deltaspike.core.api.scope.ViewAccessScoped /* TODO [CDI] check this: migrated from ScopeType.CONVERSATION */
<<<<<<<
@Inject
=======
private static int LINK_ACTIVE_DAYS = 1;
@In
>>>>>>>
private static int LINK_ACTIVE_DAYS = 1;
@Inject
<<<<<<<
@Inject
=======
//TODO [CDI] change to urlUtil
@In
private Redirect redirect;
@In("jsfMessages")
>>>>>>>
@Inject
//TODO [CDI] change to urlUtil
private Redirect redirect;
@Inject
<<<<<<<
private static int LINK_ACTIVE_DAYS = 1;
// @Begin(join = true)
=======
@Begin(join = true)
>>>>>>>
// @Begin(join = true)
<<<<<<<
// @End
public String redirectToLogin() {
=======
>>>>>>>
// @End
// public String redirectToLogin() { |
<<<<<<<
Integer rowIndex = getRowIndex(event.getUpdateInfo().getTransUnit());
// - add TU index to model
if (rowIndex != null)
{
Log.info("onTransUnitUpdated - update row:" + rowIndex);
display.getTableModel().setRowValueOverride(rowIndex, event.getUpdateInfo().getTransUnit());
// alex - update transUnitModel list
=======
// - add TU index to model
Integer rowIndex = getRowIndex(event.getUpdateInfo().getTransUnit());
if (rowIndex != null)
{
Log.info("onTransUnitUpdated - update row:" + rowIndex);
display.getTableModel().setRowValueOverride(rowIndex, event.getUpdateInfo().getTransUnit());
}
>>>>>>>
// - add TU index to model
Integer rowIndex = getRowIndex(event.getUpdateInfo().getTransUnit());
if (rowIndex != null)
{
Log.info("onTransUnitUpdated - update row:" + rowIndex);
display.getTableModel().setRowValueOverride(rowIndex, event.getUpdateInfo().getTransUnit());
}
<<<<<<<
=======
boolean isReqComplete = true;
private void cacheNextState(final NavigationCacheCallback callBack, final List<Long> cacheList, final boolean isNewState, final boolean isFuzzyState)
{
isReqComplete = false;
dispatcher.execute(new GetTransUnitsNavigation(selectedTransUnit.getId().getId(), 3, false, findMessage, isNewState, isFuzzyState), new AsyncCallback<GetTransUnitsNavigationResult>()
{
@Override
public void onSuccess(GetTransUnitsNavigationResult result)
{
isReqComplete = true;
if (!result.getUnits().isEmpty())
{
for (Long offset : result.getUnits())
{
cacheList.add(offset + curRowIndex);
}
Log.info("cachelist:" + cacheList);
callBack.next(isNewState, isFuzzyState);
}
}
@Override
public void onFailure(Throwable caught)
{
Log.error("GetTransUnitsStates failure " + caught, caught);
}
});
}
private void cachePrevState(final NavigationCacheCallback callBack, final List<Long> cacheList, final boolean isNewState, final boolean isFuzzyState)
{
isReqComplete = false;
dispatcher.execute(new GetTransUnitsNavigation(selectedTransUnit.getId().getId(), 3, true, findMessage, isNewState, isFuzzyState), new AsyncCallback<GetTransUnitsNavigationResult>()
{
@Override
public void onSuccess(GetTransUnitsNavigationResult result)
{
isReqComplete = true;
if (!result.getUnits().isEmpty())
{
for (Long offset : result.getUnits())
{
cacheList.add(curRowIndex - offset);
}
Log.info("cachelist:" + cacheList);
callBack.prev(isNewState, isFuzzyState);
}
}
@Override
public void onFailure(Throwable caught)
{
Log.error("GetTransUnitsStates failure " + caught, caught);
}
});
}
>>>>>>> |
<<<<<<<
=======
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent.Type;
import com.google.gwt.event.shared.HandlerRegistration;
>>>>>>>
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent.Type;
import com.google.gwt.event.shared.HandlerRegistration; |
<<<<<<<
import org.zanata.webtrans.shared.model.ValidationAction;
=======
import org.zanata.model.HProjectIteration;
import org.zanata.webtrans.shared.model.ValidationObject;
>>>>>>>
import org.zanata.webtrans.shared.model.ValidationAction;
import org.zanata.model.HProjectIteration;
<<<<<<<
Collection<ValidationAction> getValidationAction(String projectSlug, String versionSlug);
=======
List<ValidationObject> getValidationObject(String projectSlug, String versionSlug);
/**
* Return all ValidationObjects with enabled=true on those which are
* customized to the version
*
* @param HProjectIteration
* @return
*/
List<ValidationObject> getValidationObject(HProjectIteration version);
>>>>>>>
Collection<ValidationAction> getValidationAction(String projectSlug, String versionSlug);
/**
* Return all ValidationActions with enabled=true on those which are
* customized to the version
*
* @param HProjectIteration
* @return
*/
Collection<ValidationAction> getValidationObject(HProjectIteration version); |
<<<<<<<
String[] projectFields = {"slug", "name", "description"};
QueryParser parser = new MultiFieldQueryParser(projectFields, new StandardAnalyzer());
=======
String[] projectFields = {"name", "description"};
QueryParser parser = new MultiFieldQueryParser(Version.LUCENE_29, projectFields, new StandardAnalyzer());
>>>>>>>
String[] projectFields = {"slug", "name", "description"};
QueryParser parser = new MultiFieldQueryParser(Version.LUCENE_29, projectFields, new StandardAnalyzer()); |
<<<<<<<
} catch (PatchListNotAvailableException e) {
throw new NoSuchChangeException(changeId, e);
} catch (IOException e) {
log.error("File content unavailable", e);
throw new NoSuchChangeException(changeId, e);
=======
} catch (IOException e) {
log.error("File content unavailable", e);
throw new NoSuchChangeException(changeId, e);
} catch (org.eclipse.jgit.errors.LargeObjectException err) {
throw new LargeObjectException("File content is too large", err);
}
>>>>>>>
} catch (PatchListNotAvailableException e) {
throw new NoSuchChangeException(changeId, e);
} catch (IOException e) {
log.error("File content unavailable", e);
throw new NoSuchChangeException(changeId, e);
} catch (org.eclipse.jgit.errors.LargeObjectException err) {
throw new LargeObjectException("File content is too large", err); |
<<<<<<<
=======
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
>>>>>>>
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList; |
<<<<<<<
import org.zanata.webtrans.shared.rpc.GetGlossary;
import org.zanata.webtrans.shared.rpc.GetGlossaryResult;
import org.zanata.webtrans.shared.rpc.GetProjectStatusCount;
import org.zanata.webtrans.shared.rpc.GetProjectStatusCountResult;
=======
>>>>>>>
import org.zanata.webtrans.shared.rpc.GetGlossary;
import org.zanata.webtrans.shared.rpc.GetGlossaryResult;
<<<<<<<
else if (action instanceof GetProjectStatusCount)
{
final GetProjectStatusCount _action = (GetProjectStatusCount) action;
AsyncCallback<GetProjectStatusCountResult> _callback = (AsyncCallback<GetProjectStatusCountResult>) callback;
Scheduler.get().scheduleDeferred(new DummyGetProjectStatusCountCommand(_action, _callback));
}
=======
>>>>>>> |
<<<<<<<
import org.zanata.webtrans.client.events.NavTransUnitEvent.NavigationType;
import org.zanata.webtrans.client.events.NotificationEvent.Severity;
import org.zanata.webtrans.client.resources.TableEditorMessages;
=======
>>>>>>>
import org.zanata.webtrans.client.resources.TableEditorMessages;
<<<<<<<
selectTransUnit(display.getTransUnitValue(rowNum));
=======
selectTransUnit(display.getTransUnitValue(rowNum), false);
>>>>>>>
selectTransUnit(display.getTransUnitValue(rowNum)); |
<<<<<<<
import javax.inject.Inject;
import javax.inject.Named;
import org.zanata.security.annotations.Authenticated;
import org.zanata.security.annotations.CheckLoggedIn;
import org.zanata.security.annotations.CheckPermission;
import org.zanata.security.annotations.CheckRole;
=======
import org.apache.commons.lang.StringUtils;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.zanata.exception.RequestExistsException;
import org.zanata.model.HPerson;
import org.zanata.model.LanguageRequest;
import org.zanata.model.LocaleRole;
import org.zanata.model.type.RequestState;
import org.zanata.security.ZanataIdentity;
>>>>>>>
import javax.inject.Inject;
import javax.inject.Named;
import org.zanata.security.annotations.Authenticated;
import org.apache.commons.lang.StringUtils;
import org.zanata.exception.RequestExistsException;
import org.zanata.model.HPerson;
import org.zanata.model.LanguageRequest;
import org.zanata.model.LocaleRole;
import org.zanata.model.type.RequestState;
import org.zanata.security.ZanataIdentity; |
<<<<<<<
@DefaultMessage("Style")
String style();
@DefaultMessage("Description")
String description();
@DefaultMessage("Blue color")
String blueColor();
@DefaultMessage("Red color + crossed out")
String redColorCrossedOut();
@DefaultMessage("Plain text")
String plainText();
@DefaultMessage("Text contain in result but not in search term")
String tmInsertTagDesc();
@DefaultMessage("Text contain in search term but not in result")
String tmDelTagDesc();
@DefaultMessage("Text contain in both search term and result")
String tmPlainTextDesc();
@DefaultMessage("New replacement text ")
String searchReplaceInsertTagDesc();
@DefaultMessage("Old text to be replaced")
String searchReplaceDelTagDesc();
@DefaultMessage("No changes")
String searchReplacePlainTextDesc();
@DefaultMessage("Color legend")
String colorLegend();
=======
@DefaultMessage("Concurrent edit detected. Reset value for current row. Your change will be lost.")
String concurrentEdit();
>>>>>>>
@DefaultMessage("Style")
String style();
@DefaultMessage("Description")
String description();
@DefaultMessage("Blue color")
String blueColor();
@DefaultMessage("Red color + crossed out")
String redColorCrossedOut();
@DefaultMessage("Plain text")
String plainText();
@DefaultMessage("Text contain in result but not in search term")
String tmInsertTagDesc();
@DefaultMessage("Text contain in search term but not in result")
String tmDelTagDesc();
@DefaultMessage("Text contain in both search term and result")
String tmPlainTextDesc();
@DefaultMessage("New replacement text ")
String searchReplaceInsertTagDesc();
@DefaultMessage("Old text to be replaced")
String searchReplaceDelTagDesc();
@DefaultMessage("No changes")
String searchReplacePlainTextDesc();
@DefaultMessage("Color legend")
String colorLegend();
@DefaultMessage("Concurrent edit detected. Reset value for current row. Your change will be lost.")
String concurrentEdit(); |
<<<<<<<
=======
import static org.zanata.rest.dto.stats.TranslationStatistics.StatUnit.WORD;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
>>>>>>>
import static org.zanata.rest.dto.stats.TranslationStatistics.StatUnit.WORD;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
<<<<<<<
import java.util.ArrayList;
=======
import java.util.Collections;
>>>>>>>
import java.util.Collections;
import java.util.ArrayList;
<<<<<<<
import javax.annotation.Nullable;
=======
import java.util.Set;
>>>>>>>
import javax.annotation.Nullable;
import java.util.Set; |
<<<<<<<
@Path(VersionResource.SERVICE_PATH)
=======
@Path(VersionService.SERVICE_PATH)
@IgnoreInterfacePath
>>>>>>>
@Path(VersionResource.SERVICE_PATH)
@IgnoreInterfacePath |
<<<<<<<
=======
import org.zanata.webtrans.client.ui.OptionsPanelView;
import org.zanata.webtrans.client.ui.TransMemoryMergePopupPanelDisplay;
import org.zanata.webtrans.client.ui.TransMemoryMergePopupPanelView;
>>>>>>>
import org.zanata.webtrans.client.ui.OptionsPanelView;
import org.zanata.webtrans.client.ui.TransMemoryMergePopupPanelDisplay;
import org.zanata.webtrans.client.ui.TransMemoryMergePopupPanelView; |
<<<<<<<
=======
import java.util.Arrays;
>>>>>>>
<<<<<<<
public class SmartForest<P> extends AbstractWood<P, SmartForest<P>> {
private double rate = 0.9;
// root
public SmartForest() {
}
// for search
private SmartForest(final char c) {
this.c = c;
}
// 首位直接数组定位
@SuppressWarnings("unchecked")
public SmartForest(final double rate) {
this.branches = new SmartForest[MAX_SIZE];
this.rate = rate;
}
public SmartForest(final char c, final int status, final P param) {
this.c = c;
this.status = (byte) status;
this.param = param;
}
public boolean contains(final char c) {
return this.containsBinarySearch(c);
}
public SmartGetWord<P> getWord(final char[] chars) {
return new SmartGetWord<>(this, chars);
}
public SmartForest<P> getBranch(final char[] chars) {
return this.getBranchOfSameType(chars, MAX_SIZE);
}
public SmartForest<P> getBranch(final char c) {
return this.getBranch(c, MAX_SIZE);
}
public SmartForest<P> getBranch(final String keyWord) {
return getBranch(keyWord.toCharArray());
}
@SuppressWarnings("unchecked")
public void addBranch(final String keyWord, final P param) {
this.addBranchOfSameType((Class<SmartForest<P>>) this.getClass(), keyWord, param, MAX_SIZE, false);
}
@SuppressWarnings("unchecked")
@Override
public SmartForest<P> addBranch(final SmartForest<P> b) {
return this.addBranch((Class<SmartForest<P>>) this.getClass(), b, MAX_SIZE, false);
}
@Override
protected SmartForest<P> onAddBranchThatExists(final SmartForest<P> b, final int idx, final boolean append) {
if (this.branches[idx] == null) {
this.branches[idx] = b;
}
return super.onAddBranchThatExists(b, idx, append);
}
@SuppressWarnings("unchecked")
@Override
protected SmartForest<P> onAddBranchThatNotExists(final Class<SmartForest<P>> branchType, final SmartForest<P> b, final int idx) {
// 如果数组内元素接近于最大值直接数组定位,rate是内存和速度的一个平衡
if (this.branches != null && this.branches.length >= MAX_SIZE * rate) {
SmartForest<P>[] tempBranches = new SmartForest[MAX_SIZE];
for (final SmartForest<P> element : this.branches) {
tempBranches[element.getC()] = element;
}
tempBranches[b.getC()] = b;
this.branches = null;
this.branches = tempBranches;
} else {
SmartForest<P>[] newBranches = new SmartForest[this.branches.length + 1];
int insert = -(idx + 1);
System.arraycopy(this.branches, 0, newBranches, 0, insert);
System.arraycopy(this.branches, insert, newBranches, insert + 1, this.branches.length - insert);
newBranches[insert] = b;
this.branches = newBranches;
}
return b;
}
@Override
protected int getBranchIndex(final char c, final Integer maxSize) {
return this.getBranchIndexByJdkArrays(c, maxSize);
}
@Override
protected SmartForest<P> forSearch(final char c) {
return new SmartForest<>(c);
}
@Override
protected void onNatureIdentified(final P param, final boolean append) {
this.branch.setParam(param);
}
@Override
protected SmartForest<P> newBranch(char c, int status, P param) {
return new SmartForest<>(c, status, param);
}
=======
public class SmartForest<T> implements Comparable<SmartForest<T>> {
private static final int MAX_SIZE = 65536;
/**
* status 此字的状态1,继续 2,是个词语但是还可以继续 ,3确定 nature 词语性质
*/
public SmartForest<T>[] branches = null;
// 单独查找出来的对象
SmartForest<T> branch = null;
private double rate = 0.9;
private char c;
// 状态
private byte status = 1;
// 词典后的参数
private T param = null;
// root
public SmartForest() {
}
// 首位直接数组定位
@SuppressWarnings("unchecked")
public SmartForest(double rate) {
branches = new SmartForest[MAX_SIZE];
this.rate = rate;
}
// temp branch
private SmartForest(char c) {
this.c = c;
}
public SmartForest(char c, int status, T param) {
this.c = c;
this.status = (byte) status;
this.param = param;
}
/**
* 增加子页节点
*
* @param branch
* @return
*/
@SuppressWarnings("unchecked")
private SmartForest<T> add(SmartForest<T> branch) {
if (branches == null) {
branches = new SmartForest[0];
}
int bs = get(branch.getC());
if (bs > -1) {
if (this.branches[bs] == null) {
this.branches[bs] = branch;
}
this.branch = this.branches[bs];
switch (branch.getStatus()) {
case -1:
this.branch.setStatus(1);
break;
case 1:
if (this.branch.getStatus() == 3) {
this.branch.setStatus(2);
}
break;
case 3:
if (this.branch.getStatus() != 3) {
this.branch.setStatus(2);
}
this.branch.setParam(branch.getParam());
}
return this.branch;
}
if (bs < 0) {
// 如果数组内元素接近于最大值直接数组定位,rate是内存和速度的一个平衡
if (branches != null && branches.length >= MAX_SIZE * rate) {
SmartForest<T>[] tempBranches = new SmartForest[MAX_SIZE];
for (SmartForest<T> b : branches) {
tempBranches[b.getC()] = b;
}
tempBranches[branch.getC()] = branch;
branches = null;
branches = tempBranches;
} else {
SmartForest<T>[] newBranches = new SmartForest[branches.length + 1];
int insert = -(bs + 1);
System.arraycopy(this.branches, 0, newBranches, 0, insert);
System.arraycopy(branches, insert, newBranches, insert + 1, branches.length - insert);
newBranches[insert] = branch;
this.branches = newBranches;
}
}
return branch;
}
public int get(char c) {
if (branches == null)
return -1;
if (branches.length == MAX_SIZE) {
return c;
}
int i = Arrays.binarySearch(this.branches, new SmartForest<T>(c));
return i;
}
public SmartForest<T> getBranch(char c) {
int index = get(c);
if (index < 0) {
return null;
} else {
return branches[index];
}
}
/**
* 二分查找是否包含
*
* @param c
* @return
*/
public boolean contains(char c) {
if (this.branches == null) {
return false;
}
return Arrays.binarySearch(this.branches, c) > -1;
}
public int compareTo(char c) {
if (this.c > c)
return 1;
if (this.c < c) {
return -1;
}
return 0;
}
public boolean equals(char c) {
return this.c == c;
}
@Override
public int hashCode() {
return this.c;
}
public byte getStatus() {
return this.status;
}
public void setStatus(int status) {
this.status = (byte) status;
}
public char getC() {
return this.c;
}
public T getParam() {
return this.param;
}
public void setParam(T param) {
this.param = param;
}
/**
* 增加新词
*
* @param
*/
public void add(String keyWord, T t) {
SmartForest<T> tempBranch = this;
for (int i = 0; i < keyWord.length(); i++) {
if (keyWord.length() == i + 1) {
tempBranch.add(new SmartForest<T>(keyWord.charAt(i), 3, t));
} else {
tempBranch.add(new SmartForest<T>(keyWord.charAt(i), 1, null));
}
tempBranch = tempBranch.branches[tempBranch.get(keyWord.charAt(i))];
}
}
public int compareTo(SmartForest<T> o) {
// TODO Auto-generated method stub
if (this.c > o.c)
return 1;
if (this.c < o.c) {
return -1;
}
return 0;
}
/**
* 根据一个词获得所取的参数,没有就返回null
*
* @param keyWord
*/
public SmartForest<T> getBranch(String keyWord) {
SmartForest<T> tempBranch = this;
int index = 0;
for (int j = 0; j < keyWord.length(); j++) {
index = tempBranch.get(keyWord.charAt(j));
if (index < 0) {
return null;
}
if ((tempBranch = tempBranch.branches[index]) == null) {
return null;
}
}
return tempBranch;
}
/**
* 根据一个词获得所取的参数,没有就返回null
*
* @param chars
*/
public SmartForest<T> getBranch(char[] chars) {
SmartForest<T> tempBranch = this;
int index = 0;
for (int j = 0; j < chars.length; j++) {
index = tempBranch.get(chars[j]);
if (index < 0) {
return null;
}
if ((tempBranch = tempBranch.branches[index]) == null) {
return null;
}
}
return tempBranch;
}
public SmartGetWord<T> getWord(char[] chars) {
return new SmartGetWord<T>(this, chars);
}
public SmartGetWord<T> getWord(String content) {
return new SmartGetWord<T>(this, content.toCharArray());
}
>>>>>>>
public class SmartForest<P> extends AbstractWood<P, SmartForest<P>> {
private double rate = 0.9;
// root
public SmartForest() {
}
// for search
private SmartForest(final char c) {
this.c = c;
}
// 首位直接数组定位
@SuppressWarnings("unchecked")
public SmartForest(final double rate) {
this.branches = new SmartForest[MAX_SIZE];
this.rate = rate;
}
public SmartForest(final char c, final int status, final P param) {
this.c = c;
this.status = (byte) status;
this.param = param;
}
public boolean contains(final char c) {
return this.containsBinarySearch(c);
}
public SmartGetWord<P> getWord(final char[] chars) {
return new SmartGetWord<>(this, chars);
}
public SmartGetWord<P> getWord(final String content) {
return getWord(content.toCharArray());
}
public SmartForest<P> getBranch(final char[] chars) {
return this.getBranchOfSameType(chars, MAX_SIZE);
}
public SmartForest<P> getBranch(final char c) {
return this.getBranch(c, MAX_SIZE);
}
public SmartForest<P> getBranch(final String keyWord) {
return getBranch(keyWord.toCharArray());
}
@SuppressWarnings("unchecked")
public void addBranch(final String keyWord, final P param) {
this.addBranchOfSameType((Class<SmartForest<P>>) this.getClass(), keyWord, param, MAX_SIZE, false);
}
@SuppressWarnings("unchecked")
@Override
public SmartForest<P> addBranch(final SmartForest<P> b) {
return this.addBranch((Class<SmartForest<P>>) this.getClass(), b, MAX_SIZE, false);
}
@Override
protected SmartForest<P> onAddBranchThatExists(final SmartForest<P> b, final int idx, final boolean append) {
if (this.branches[idx] == null) {
this.branches[idx] = b;
}
return super.onAddBranchThatExists(b, idx, append);
}
@SuppressWarnings("unchecked")
@Override
protected SmartForest<P> onAddBranchThatNotExists(final Class<SmartForest<P>> branchType, final SmartForest<P> b, final int idx) {
// 如果数组内元素接近于最大值直接数组定位,rate是内存和速度的一个平衡
if (this.branches != null && this.branches.length >= MAX_SIZE * rate) {
SmartForest<P>[] tempBranches = new SmartForest[MAX_SIZE];
for (final SmartForest<P> element : this.branches) {
tempBranches[element.getC()] = element;
}
tempBranches[b.getC()] = b;
this.branches = null;
this.branches = tempBranches;
} else {
SmartForest<P>[] newBranches = new SmartForest[this.branches.length + 1];
int insert = -(idx + 1);
System.arraycopy(this.branches, 0, newBranches, 0, insert);
System.arraycopy(this.branches, insert, newBranches, insert + 1, this.branches.length - insert);
newBranches[insert] = b;
this.branches = newBranches;
}
return b;
}
@Override
protected int getBranchIndex(final char c, final Integer maxSize) {
return this.getBranchIndexByJdkArrays(c, maxSize);
}
@Override
protected SmartForest<P> forSearch(final char c) {
return new SmartForest<>(c);
}
@Override
protected void onNatureIdentified(final P param, final boolean append) {
this.branch.setParam(param);
}
@Override
protected SmartForest<P> newBranch(char c, int status, P param) {
return new SmartForest<>(c, status, param);
} |
<<<<<<<
public String str2QP(final String str) {
List<PinyinWord> list = Pinyin.str2Pinyin(str);
StringBuilder sb = new StringBuilder();
for (PinyinWord pinyinWord : list) {
sb.append(pinyinWord.py);
}
return sb.toString();
=======
public String str2QP(String str) {
return Pinyin.list2String(Pinyin.pinyin(str),"");
>>>>>>>
public String str2QP(final String str) {
return Pinyin.list2String(Pinyin.pinyin(str),""); |
<<<<<<<
import com.bumptech.glide.resize.bitmap_recycle.BitmapPool;
=======
import com.bumptech.glide.presenter.target.Target;
>>>>>>>
import com.bumptech.glide.resize.bitmap_recycle.BitmapPool;
import com.bumptech.glide.presenter.target.Target;
<<<<<<<
public void testClearingTagReplacesPresenter() {
Glide.load("a").into(imageView);
assertNotNull(imageView.getTag());
imageView.setTag(null);
Glide.load("b").into(imageView);
}
public void testObtainAndOfferToBitmapPool() {
Bitmap small = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
Bitmap large = Bitmap.createBitmap(512, 512, Bitmap.Config.RGB_565);
BitmapPool bitmapPool = Glide.get().getImageManager(getInstrumentation().getContext()).getBitmapPool();
bitmapPool.put(small);
bitmapPool.put(large);
assertEquals(small, bitmapPool.get(small.getWidth(), small.getHeight(), small.getConfig()));
assertEquals(large, bitmapPool.get(large.getWidth(), large.getHeight(), large.getConfig()));
}
=======
public void testDifferentRequestListenersReplacesPresenter() {
assertDifferentPresenters(
Glide.load("a").listener(new Glide.RequestListener<String>() {
@Override
public void onException(Exception e, String model, Target target) {
}
@Override
public void onImageReady(String model, Target target) {
}
}),
Glide.load("a").listener(new Glide.RequestListener<String>() {
@Override
public void onException(Exception e, String model, Target target) {
}
@Override
public void onImageReady(String model, Target target) {
}
})
);
}
>>>>>>>
public void testClearingTagReplacesPresenter() {
Glide.load("a").into(imageView);
assertNotNull(imageView.getTag());
imageView.setTag(null);
Glide.load("b").into(imageView);
}
public void testObtainAndOfferToBitmapPool() {
Bitmap small = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
Bitmap large = Bitmap.createBitmap(512, 512, Bitmap.Config.RGB_565);
BitmapPool bitmapPool = Glide.get().getImageManager(getInstrumentation().getContext()).getBitmapPool();
bitmapPool.put(small);
bitmapPool.put(large);
assertEquals(small, bitmapPool.get(small.getWidth(), small.getHeight(), small.getConfig()));
assertEquals(large, bitmapPool.get(large.getWidth(), large.getHeight(), large.getConfig()));
}
public void testDifferentRequestListenersReplacesPresenter() {
assertDifferentPresenters(
Glide.load("a").listener(new Glide.RequestListener<String>() {
@Override
public void onException(Exception e, String model, Target target) {
}
@Override
public void onImageReady(String model, Target target) {
}
}),
Glide.load("a").listener(new Glide.RequestListener<String>() {
@Override
public void onException(Exception e, String model, Target target) {
}
@Override
public void onImageReady(String model, Target target) {
}
})
);
} |
<<<<<<<
type.setLinkName(cfg.getString("gitweb", null, "linkname"));
=======
if (type == null) {
url = null;
gitweb_cgi = null;
gitweb_css = null;
gitweb_js = null;
git_logo_png = null;
return;
}
>>>>>>>
if (type == null) {
url = null;
gitweb_cgi = null;
gitweb_css = null;
gitweb_js = null;
git_logo_png = null;
return;
}
type.setLinkName(cfg.getString("gitweb", null, "linkname")); |
<<<<<<<
// gets handle to currently open transaction
=======
>>>>>>>
// gets handle to currently open transaction
<<<<<<<
throw new IndexException("Error while creating index for type " + dataType, throwable);
=======
throw new MetadataException("Error while creating index for type " + dataType, throwable);
>>>>>>>
throw new IndexException("Error while creating index for type " + dataType, throwable);
<<<<<<<
=======
>>>>>>>
<<<<<<<
LOG.debug("Created composite index for property {} of type {} ", propertyName, propertyClass.getName());
=======
>>>>>>>
LOG.debug("Created composite index for property {} of type {} ", propertyName, propertyClass.getName());
<<<<<<<
LOG.debug("Created backing index for property {} of type {} ", propertyName, propertyClass.getName());
=======
>>>>>>>
LOG.debug("Created backing index for property {} of type {} ", propertyName, propertyClass.getName()); |
<<<<<<<
Referenceable processReferenceable = new Referenceable(HiveDataTypes.HIVE_PROCESS.getName());
processReferenceable.set("name", event.operation.getOperationName());
processReferenceable.set("startTime", queryStartTime);
processReferenceable.set("userName", event.user);
List<Referenceable> source = new ArrayList<>();
for (ReadEntity readEntity : inputs) {
if (readEntity.getType() == Entity.Type.TABLE) {
Table table = readEntity.getTable();
String dbName = table.getDbName();
source.add(dgiBridge.registerTable(dbName, table.getTableName()));
}
if (readEntity.getType() == Entity.Type.PARTITION) {
dgiBridge.registerPartition(readEntity.getPartition());
}
}
processReferenceable.set("inputs", source);
List<Referenceable> target = new ArrayList<>();
for (WriteEntity writeEntity : outputs) {
if (writeEntity.getType() == Entity.Type.TABLE || writeEntity.getType() == Entity.Type.PARTITION) {
Table table = writeEntity.getTable();
String dbName = table.getDbName();
target.add(dgiBridge.registerTable(dbName, table.getTableName()));
=======
Referenceable processReferenceable = dgiBridge.getProcessReference(queryStr);
if (processReferenceable == null) {
processReferenceable = new Referenceable(HiveDataTypes.HIVE_PROCESS.getName());
processReferenceable.set("name", event.operation.getOperationName());
processReferenceable.set("startTime", queryStartTime);
processReferenceable.set("userName", event.user);
List<Referenceable> source = new ArrayList<>();
for (ReadEntity readEntity : inputs) {
if (readEntity.getType() == Entity.Type.TABLE) {
Table table = readEntity.getTable();
String dbName = table.getDbName();
source.add(dgiBridge.registerTable(dbName, table.getTableName()));
}
if (readEntity.getType() == Entity.Type.PARTITION) {
dgiBridge.registerPartition(readEntity.getPartition());
}
>>>>>>>
Referenceable processReferenceable = dgiBridge.getProcessReference(queryStr);
if (processReferenceable == null) {
processReferenceable = new Referenceable(HiveDataTypes.HIVE_PROCESS.getName());
processReferenceable.set("name", event.operation.getOperationName());
processReferenceable.set("startTime", queryStartTime);
processReferenceable.set("userName", event.user);
List<Referenceable> source = new ArrayList<>();
for (ReadEntity readEntity : inputs) {
if (readEntity.getType() == Entity.Type.TABLE) {
Table table = readEntity.getTable();
String dbName = table.getDbName();
source.add(dgiBridge.registerTable(dbName, table.getTableName()));
}
if (readEntity.getType() == Entity.Type.PARTITION) {
dgiBridge.registerPartition(readEntity.getPartition());
}
<<<<<<<
processReferenceable.set("outputs", target);
processReferenceable.set("queryText", queryStr);
processReferenceable.set("queryId", queryId);
processReferenceable.set("queryPlan", event.jsonPlan.toString());
processReferenceable.set("endTime", System.currentTimeMillis());
//TODO set
processReferenceable.set("queryGraph", "queryGraph");
dgiBridge.createInstance(processReferenceable);
=======
>>>>>>> |
<<<<<<<
final String EVENT_TYPE = "Method Profiling Sample";
final String EVENT_VALUE_STACK = "(stackTrace)";
/** the data model for live json */
LiveRecording liveRecording;
/** the data model for json */
StackFrame profile = new StackFrame("root");
/** the data model for folded stacks */
Map<String, Integer> stackTraceMap;
class LiveRecording {
Map<Long,StackFrame> profilesMap = new HashMap<Long,StackFrame>();
public StackFrame getProfile(long startTimestampSecEpoch) {
StackFrame profile = profilesMap.get(startTimestampSecEpoch);
if (profile == null) {
profile = new StackFrame("root");
profilesMap.put(startTimestampSecEpoch, profile);
}
return profile;
}
}
class StackFrame {
String name;
int value = 0;
List<StackFrame> children = null;
transient Map<String,StackFrame> childrenMap = new HashMap<String,StackFrame>();
public StackFrame(String string) {
name = string;
}
public StackFrame addFrame(String frameName) {
if(children == null) {
children = new ArrayList<StackFrame>();
}
StackFrame frame = childrenMap.get(frameName);
if(frame == null) {
frame = new StackFrame(frameName);
childrenMap.put(frameName, frame);
children.add(frame);
}
frame.value++;
return frame;
}
}
=======
>>>>>>>
final String EVENT_TYPE = "Method Profiling Sample";
final String EVENT_VALUE_STACK = "(stackTrace)";
/** the data model for live json */
LiveRecording liveRecording;
/** the data model for json */
StackFrame profile = new StackFrame("root");
/** the data model for folded stacks */
Map<String, Integer> stackTraceMap;
class LiveRecording {
Map<Long,StackFrame> profilesMap = new HashMap<Long,StackFrame>();
public StackFrame getProfile(long startTimestampSecEpoch) {
StackFrame profile = profilesMap.get(startTimestampSecEpoch);
if (profile == null) {
profile = new StackFrame("root");
profilesMap.put(startTimestampSecEpoch, profile);
}
return profile;
}
}
class StackFrame {
String name;
int value = 0;
List<StackFrame> children = null;
transient Map<String,StackFrame> childrenMap = new HashMap<String,StackFrame>();
public StackFrame(String string) {
name = string;
}
public StackFrame addFrame(String frameName) {
if(children == null) {
children = new ArrayList<StackFrame>();
}
StackFrame frame = childrenMap.get(frameName);
if(frame == null) {
frame = new StackFrame(frameName);
childrenMap.put(frameName, frame);
children.add(frame);
}
frame.value++;
return frame;
}
}
<<<<<<<
public void process() throws IOException {
readJFR();
if (outputFile == null) {
outputFile = new File("output.txt");
}
FileWriter fileWriter = new FileWriter(outputFile);
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
try {
if(exportJson) {
writeJson(bufferedWriter);
} else {
writeFolded(bufferedWriter);
}
} finally {
bufferedWriter.close();
fileWriter.close();
}
}
private void readJFR() {
FlightRecording flightRecording = FlightRecordingLoader.loadFile(jfrdump);
if(exportJson) {
if(exportTimestamp) {
liveRecording = new LiveRecording();
} else {
profile = new StackFrame("root");
}
} else {
stackTraceMap = new LinkedHashMap<String, Integer>();
}
IView view = flightRecording.createView();
=======
public void write() throws IOException {
FlightRecording recording = null;
try {
recording = FlightRecordingLoader.loadFile(jfrdump);
}
catch( Exception e ) {
recording = FlightRecordingLoader.loadFile(decompressFile( jfrdump ));
}
final String EVENT_TYPE = "Method Profiling Sample";
Map<String, Integer> stackTraceMap = new LinkedHashMap<String, Integer>();
IView view = recording.createView();
>>>>>>>
public void process() throws IOException {
readJFR();
if (outputFile == null) {
outputFile = new File("output.txt");
}
FileWriter fileWriter = new FileWriter(outputFile);
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
try {
if(exportJson) {
writeJson(bufferedWriter);
} else {
writeFolded(bufferedWriter);
}
} finally {
bufferedWriter.close();
fileWriter.close();
}
}
private void readJFR() throws IOException {
FlightRecording recording = null;
try {
recording = FlightRecordingLoader.loadFile(jfrdump);
}
catch( Exception e ) {
recording = FlightRecordingLoader.loadFile(decompressFile( jfrdump ));
}
if(exportJson) {
if(exportTimestamp) {
liveRecording = new LiveRecording();
} else {
profile = new StackFrame("root");
}
} else {
stackTraceMap = new LinkedHashMap<String, Integer>();
}
IView view = recording.createView();
<<<<<<<
private void writeJson(BufferedWriter bufferedWriter) {
Gson gson = new GsonBuilder().create();
if(exportTimestamp) {
gson.toJson(this.liveRecording.profilesMap, bufferedWriter);
} else {
gson.toJson(this.profile, bufferedWriter);
}
}
=======
private File decompressFile( final File compressedFile ) throws IOException
{
byte[] buffer = new byte[1024];
GZIPInputStream compressedStream = null;
FileOutputStream uncompressedFileStream = null;
File decompressedFile = null;
try {
compressedStream = new GZIPInputStream(new FileInputStream(compressedFile));
decompressedFile = File.createTempFile("flightrecorder_", null);
decompressedFile.deleteOnExit();
uncompressedFileStream = new FileOutputStream(decompressedFile);
int numberOfBytes;
while ((numberOfBytes = compressedStream.read(buffer)) > 0) {
uncompressedFileStream.write(buffer, 0, numberOfBytes);
}
}
catch (IOException ex) {
ex.printStackTrace();
}
finally {
compressedStream.close();
uncompressedFileStream.close();
}
return decompressedFile;
}
>>>>>>>
private void writeJson(BufferedWriter bufferedWriter) {
Gson gson = new GsonBuilder().create();
if(exportTimestamp) {
gson.toJson(this.liveRecording.profilesMap, bufferedWriter);
} else {
gson.toJson(this.profile, bufferedWriter);
}
}
private File decompressFile( final File compressedFile ) throws IOException
{
byte[] buffer = new byte[1024];
GZIPInputStream compressedStream = null;
FileOutputStream uncompressedFileStream = null;
File decompressedFile = null;
try {
compressedStream = new GZIPInputStream(new FileInputStream(compressedFile));
decompressedFile = File.createTempFile("flightrecorder_", null);
decompressedFile.deleteOnExit();
uncompressedFileStream = new FileOutputStream(decompressedFile);
int numberOfBytes;
while ((numberOfBytes = compressedStream.read(buffer)) > 0) {
uncompressedFileStream.write(buffer, 0, numberOfBytes);
}
}
catch (IOException ex) {
ex.printStackTrace();
}
finally {
compressedStream.close();
uncompressedFileStream.close();
}
return decompressedFile;
} |
<<<<<<<
import com.google.gerrit.server.audit.AuditService;
=======
import com.google.gerrit.server.OutputFormat;
>>>>>>>
<<<<<<<
=======
import com.google.gerrit.server.git.LockFailureException;
import com.google.gerrit.server.group.GroupAuditService;
>>>>>>>
import com.google.gerrit.server.group.GroupAuditService; |
<<<<<<<
import org.springframework.stereotype.Repository;
=======
import buct.software.domain.Semester;
import java.util.List;
>>>>>>>
import org.springframework.stereotype.Repository;
import buct.software.domain.Semester;
import java.util.List;
<<<<<<<
@Repository
public interface SemesterDao {
public Integer getSemesterId(String year,String semester);
=======
public interface SemesterDao {
public void insertSemester(Semester semester);
public List<Semester> getAll();
public List<Semester> getSemesterMostId();
>>>>>>>
@Repository
public interface SemesterDao {
public Integer getSemesterId(String year, String semester);
public void insertSemester(Semester semester);
public List<Semester> getAll();
public List<Semester> getSemesterMostId(); |
<<<<<<<
import buct.software.views.GradeManagementView;
import org.safehaus.uuid.UUIDGenerator;
=======
>>>>>>>
import buct.software.views.GradeManagementView;
import org.safehaus.uuid.UUIDGenerator;
<<<<<<<
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
=======
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
>>>>>>>
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; |
<<<<<<<
private CustomResourceEventSource createCustomResourceEventSource(MixedOperation client,
ResourceCache resourceCache,
boolean watchAllNamespaces,
String[] targetNamespaces,
EventScheduler eventScheduler,
DefaultEventSourceManager eventSourceManager) {
CustomResourceEventSource customResourceEventSource = watchAllNamespaces ?
CustomResourceEventSource.customResourceEventSourceForAllNamespaces(resourceCache, client) :
CustomResourceEventSource.customResourceEventSourceForTargetNamespaces(resourceCache, client, targetNamespaces);
customResourceEventSource.setEventHandler(eventScheduler);
customResourceEventSource.setEventSourceManager(eventSourceManager);
return customResourceEventSource;
}
private CustomResourceDefinition getCustomResourceDefinitionForController(ResourceController controller) {
=======
private CustomResourceDefinitionContext getCustomResourceDefinitionForController(ResourceController controller) {
>>>>>>>
private CustomResourceEventSource createCustomResourceEventSource(MixedOperation client,
ResourceCache resourceCache,
boolean watchAllNamespaces,
String[] targetNamespaces,
EventScheduler eventScheduler,
DefaultEventSourceManager eventSourceManager) {
CustomResourceEventSource customResourceEventSource = watchAllNamespaces ?
CustomResourceEventSource.customResourceEventSourceForAllNamespaces(resourceCache, client) :
CustomResourceEventSource.customResourceEventSourceForTargetNamespaces(resourceCache, client, targetNamespaces);
customResourceEventSource.setEventHandler(eventScheduler);
customResourceEventSource.setEventSourceManager(eventSourceManager);
return customResourceEventSource;
}
private CustomResourceDefinitionContext getCustomResourceDefinitionForController(ResourceController controller) { |
<<<<<<<
import io.javaoperatorsdk.operator.processing.event.internal.TimerEventSource;
import java.util.*;
=======
import java.util.Collections;
import java.util.Map;
import java.util.Optional;
>>>>>>>
import io.javaoperatorsdk.operator.processing.event.internal.TimerEventSource;
import java.util.Collections;
import java.util.Map;
import java.util.Optional; |
<<<<<<<
private final ApprovalsUtil approvalsUtil;
=======
>>>>>>>
<<<<<<<
ReviewDb db, ProjectCache projectCache,
ApprovalsUtil approvalsUtil,
=======
ProjectCache projectCache,
>>>>>>>
ProjectCache projectCache,
<<<<<<<
this.approvalsUtil = approvalsUtil;
=======
>>>>>>>
<<<<<<<
PatchSetApproval psa =
approvalsUtil.getSubmitter(db, commit.notes(), patchSetId);
if (psa == null) {
throw new MergeValidationException(SET_BY_ADMIN);
}
if (!caller.getCapabilities().canAdministrateServer()) {
throw new MergeValidationException(SET_BY_ADMIN);
=======
if (!caller.getCapabilities().canAdministrateServer()) {
throw new MergeValidationException(CommitMergeStatus.
SETTING_PARENT_PROJECT_ONLY_ALLOWED_BY_ADMIN);
>>>>>>>
if (!caller.getCapabilities().canAdministrateServer()) {
throw new MergeValidationException(SET_BY_ADMIN); |
<<<<<<<
import android.support.v4.view.ViewPager;
=======
import android.support.v4.app.Fragment;
>>>>>>>
import android.support.v4.view.ViewPager;
import android.support.v4.app.Fragment;
<<<<<<<
import com.fastaccess.ui.modules.changelog.ChangelogBottomSheetDialog;
import com.fastaccess.ui.modules.profile.repos.ProfileReposFragment;
=======
import com.fastaccess.ui.base.BaseFragment;
import com.fastaccess.ui.modules.main.MainActivity;
>>>>>>>
import com.fastaccess.ui.base.BaseFragment;
import com.fastaccess.ui.modules.main.MainActivity;
import com.fastaccess.ui.modules.changelog.ChangelogBottomSheetDialog;
import com.fastaccess.ui.modules.profile.repos.ProfileReposFragment;
<<<<<<<
pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
if (position == 1) {
fab.show();
} else {
fab.hide();
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
=======
tabs.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(pager) {
@Override public void onTabReselected(TabLayout.Tab tab) {
super.onTabReselected(tab);
onScrollTop(tab.getPosition());
}
});
}
@Override public void onScrollTop(int index) {
if (pager == null || pager.getAdapter() == null) return;
Fragment fragment = (BaseFragment) pager.getAdapter().instantiateItem(pager, index);
if (fragment instanceof BaseFragment) {
((BaseFragment) fragment).onScrollTop(index);
}
>>>>>>>
tabs.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(pager) {
@Override public void onTabReselected(TabLayout.Tab tab) {
super.onTabReselected(tab);
onScrollTop(tab.getPosition());
}
});
pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
if (position == 1) {
fab.show();
} else {
fab.hide();
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
@Override public void onScrollTop(int index) {
if (pager == null || pager.getAdapter() == null) return;
Fragment fragment = (BaseFragment) pager.getAdapter().instantiateItem(pager, index);
if (fragment instanceof BaseFragment) {
((BaseFragment) fragment).onScrollTop(index);
} |
<<<<<<<
import org.talend.core.model.process.IContext;
import org.talend.core.model.process.ProcessUtils;
=======
import org.talend.core.model.process.IProcess2;
>>>>>>>
import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IProcess2;
import org.talend.core.model.process.ProcessUtils; |
<<<<<<<
@ModuleData(id = WorldModule.ID, name = "World")
=======
import javax.inject.Inject;
@ModuleData(id = "world", name = "World")
>>>>>>>
import javax.inject.Inject;
@ModuleData(id = WorldModule.ID, name = "World") |
<<<<<<<
ItemStack is = src.getItemInHand(HandTypes.MAIN_HAND).orElseThrow(() -> new ReturnMessageException(Util.getTextMessageWithFormat("command.generalerror.handempty")));
=======
ItemStack is = src.getItemInHand().orElseThrow(() -> new ReturnMessageException(plugin.getMessageProvider().getTextMessageWithFormat("command.generalerror.handempty")));
>>>>>>>
ItemStack is = src.getItemInHand(HandTypes.MAIN_HAND).orElseThrow(() -> new ReturnMessageException(plugin.getMessageProvider().getTextMessageWithFormat("command.generalerror.handempty")));
<<<<<<<
src.setItemInHand(HandTypes.MAIN_HAND, null);
src.sendMessage(Util.getTextMessageWithFormat("command.itemsell.summary", String.valueOf(amt), is.getTranslation().get(), econHelper.getCurrencySymbol(overallCost)));
=======
src.setItemInHand(null);
src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("command.itemsell.summary", String.valueOf(amt), is.getTranslation().get(), econHelper.getCurrencySymbol(overallCost)));
>>>>>>>
src.setItemInHand(HandTypes.MAIN_HAND, null);
src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("command.itemsell.summary", String.valueOf(amt), is.getTranslation().get(), econHelper.getCurrencySymbol(overallCost))); |
<<<<<<<
import io.github.essencepowered.essence.internal.CommandPermissionHandler;
import io.github.essencepowered.essence.internal.annotations.Modules;
import io.github.essencepowered.essence.internal.annotations.NoCooldown;
import io.github.essencepowered.essence.internal.annotations.NoCost;
import io.github.essencepowered.essence.internal.annotations.NoWarmup;
import io.github.essencepowered.essence.internal.annotations.Permissions;
import io.github.essencepowered.essence.internal.annotations.RegisterCommand;
import io.github.essencepowered.essence.internal.annotations.RunAsync;
=======
import io.github.essencepowered.essence.internal.PermissionRegistry;
import io.github.essencepowered.essence.internal.annotations.*;
>>>>>>>
import io.github.essencepowered.essence.internal.PermissionRegistry;
import io.github.essencepowered.essence.internal.annotations.Modules;
import io.github.essencepowered.essence.internal.annotations.NoCooldown;
import io.github.essencepowered.essence.internal.annotations.NoCost;
import io.github.essencepowered.essence.internal.annotations.NoWarmup;
import io.github.essencepowered.essence.internal.annotations.Permissions;
import io.github.essencepowered.essence.internal.annotations.RegisterCommand;
import io.github.essencepowered.essence.internal.annotations.RunAsync; |
<<<<<<<
import io.github.essencepowered.essence.internal.CommandPermissionHandler;
import io.github.essencepowered.essence.internal.annotations.Modules;
import io.github.essencepowered.essence.internal.annotations.NoCooldown;
import io.github.essencepowered.essence.internal.annotations.NoCost;
import io.github.essencepowered.essence.internal.annotations.NoWarmup;
import io.github.essencepowered.essence.internal.annotations.Permissions;
import io.github.essencepowered.essence.internal.annotations.RegisterCommand;
=======
import io.github.essencepowered.essence.internal.PermissionRegistry;
import io.github.essencepowered.essence.internal.annotations.*;
>>>>>>>
import io.github.essencepowered.essence.internal.PermissionRegistry;
import io.github.essencepowered.essence.internal.annotations.Modules;
import io.github.essencepowered.essence.internal.annotations.NoCooldown;
import io.github.essencepowered.essence.internal.annotations.NoCost;
import io.github.essencepowered.essence.internal.annotations.NoWarmup;
import io.github.essencepowered.essence.internal.annotations.Permissions;
import io.github.essencepowered.essence.internal.annotations.RegisterCommand;
<<<<<<<
public static final String notifyPermission = CommandPermissionHandler.PERMISSIONS_PREFIX + "jail.notify";
=======
public static final String notifyPermission = PermissionRegistry.PERMISSIONS_PREFIX + "jail.notify";
>>>>>>>
public static final String notifyPermission = PermissionRegistry.PERMISSIONS_PREFIX + "jail.notify"; |
<<<<<<<
=======
import io.github.nucleuspowered.nucleus.internal.qsml.module.StandardModule;
import io.github.nucleuspowered.nucleus.util.Action;
>>>>>>>
import io.github.nucleuspowered.nucleus.util.Action;
<<<<<<<
=======
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
>>>>>>>
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths; |
<<<<<<<
import org.spongepowered.api.command.args.CommandElement;
import org.spongepowered.api.data.type.HandTypes;
=======
>>>>>>>
import org.spongepowered.api.data.type.HandTypes; |
<<<<<<<
import com.google.gerrit.server.git.MetaDataUpdate;
=======
import com.google.gerrit.server.git.MetaDataUpdate;
import com.google.gerrit.server.git.ProjectConfig;
import com.google.gerrit.server.git.validators.CommitValidators;
import com.google.gerrit.server.index.IndexConfig;
import com.google.gerrit.server.index.QueryOptions;
>>>>>>>
import com.google.gerrit.server.git.MetaDataUpdate;
import com.google.gerrit.server.git.ProjectConfig;
<<<<<<<
import com.google.gerrit.server.project.ProjectCache;
=======
import com.google.gerrit.server.project.ChangeControl;
import com.google.gerrit.server.project.ProjectCache;
import com.google.gerrit.server.project.Util;
>>>>>>>
import com.google.gerrit.server.project.ProjectCache;
import com.google.gerrit.server.project.Util;
<<<<<<<
@Inject protected ProjectCache projectCache;
@Inject protected MetaDataUpdate.Server metaDataUpdateFactory;
@Inject protected ExternalIdsUpdate.Server externalIdsUpdate;
// Only for use in setting up/tearing down injector; other users should use schemaFactory.
@Inject private InMemoryDatabase inMemoryDatabase;
=======
@Inject protected ProjectCache projectCache;
@Inject protected MetaDataUpdate.Server metaDataUpdateFactory;
@Inject protected IdentifiedUser.GenericFactory identifiedUserFactory;
>>>>>>>
@Inject protected ProjectCache projectCache;
@Inject protected MetaDataUpdate.Server metaDataUpdateFactory;
@Inject protected ExternalIdsUpdate.Server externalIdsUpdate;
@Inject protected IdentifiedUser.GenericFactory identifiedUserFactory;
// Only for use in setting up/tearing down injector; other users should use schemaFactory.
@Inject private InMemoryDatabase inMemoryDatabase;
<<<<<<<
public void reviewerAndCcByEmail() throws Exception {
assume().that(notesMigration.readChanges()).isTrue();
Project.NameKey project = new Project.NameKey("repo");
TestRepository<Repo> repo = createProject(project.get());
ConfigInput conf = new ConfigInput();
conf.enableReviewerByEmail = InheritableBoolean.TRUE;
gApi.projects().name(project.get()).config(conf);
String userByEmail = "[email protected]";
String userByEmailWithName = "John Doe <" + userByEmail + ">";
Change change1 = insert(repo, newChange(repo));
Change change2 = insert(repo, newChange(repo));
insert(repo, newChange(repo));
AddReviewerInput rin = new AddReviewerInput();
rin.reviewer = userByEmailWithName;
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change1.getId().get()).addReviewer(rin);
rin = new AddReviewerInput();
rin.reviewer = userByEmailWithName;
rin.state = ReviewerState.CC;
gApi.changes().id(change2.getId().get()).addReviewer(rin);
if (getSchemaVersion() >= 41) {
assertQuery("reviewer:\"" + userByEmailWithName + "\"", change1);
assertQuery("cc:\"" + userByEmailWithName + "\"", change2);
// Omitting the name:
assertQuery("reviewer:\"" + userByEmail + "\"", change1);
assertQuery("cc:\"" + userByEmail + "\"", change2);
} else {
assertMissingField(ChangeField.REVIEWER_BY_EMAIL);
assertFailingQuery(
"reviewer:\"" + userByEmailWithName + "\"", "User " + userByEmailWithName + " not found");
assertFailingQuery(
"cc:\"" + userByEmailWithName + "\"", "User " + userByEmailWithName + " not found");
// Omitting the name:
assertFailingQuery("reviewer:\"" + userByEmail + "\"", "User " + userByEmail + " not found");
assertFailingQuery("cc:\"" + userByEmail + "\"", "User " + userByEmail + " not found");
}
}
@Test
public void reviewerAndCcByEmailWithQueryForDifferentUser() throws Exception {
assume().that(notesMigration.readChanges()).isTrue();
Project.NameKey project = new Project.NameKey("repo");
TestRepository<Repo> repo = createProject(project.get());
ConfigInput conf = new ConfigInput();
conf.enableReviewerByEmail = InheritableBoolean.TRUE;
gApi.projects().name(project.get()).config(conf);
String userByEmail = "John Doe <[email protected]>";
Change change1 = insert(repo, newChange(repo));
Change change2 = insert(repo, newChange(repo));
insert(repo, newChange(repo));
AddReviewerInput rin = new AddReviewerInput();
rin.reviewer = userByEmail;
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change1.getId().get()).addReviewer(rin);
rin = new AddReviewerInput();
rin.reviewer = userByEmail;
rin.state = ReviewerState.CC;
gApi.changes().id(change2.getId().get()).addReviewer(rin);
if (getSchemaVersion() >= 41) {
assertQuery("reviewer:\"[email protected]\"");
assertQuery("cc:\"[email protected]\"");
} else {
assertMissingField(ChangeField.REVIEWER_BY_EMAIL);
String someoneEmail = "[email protected]";
assertFailingQuery(
"reviewer:\"" + someoneEmail + "\"", "User " + someoneEmail + " not found");
assertFailingQuery("cc:\"" + someoneEmail + "\"", "User " + someoneEmail + " not found");
}
}
@Test
=======
public void reviewerin() throws Exception {
Account.Id user1 = accountManager.authenticate(AuthRequest.forUser("user1")).getAccountId();
Account.Id user2 = accountManager.authenticate(AuthRequest.forUser("user2")).getAccountId();
TestRepository<Repo> repo = createProject("repo");
Change change1 = insert(repo, newChange(repo));
Change change2 = insert(repo, newChange(repo));
insert(repo, newChange(repo));
AddReviewerInput rin = new AddReviewerInput();
rin.reviewer = user1.toString();
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change1.getId().get()).addReviewer(rin);
rin = new AddReviewerInput();
rin.reviewer = user2.toString();
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change2.getId().get()).addReviewer(rin);
String group = gApi.groups().create("foo").get().name;
gApi.groups().id(group).addMembers(user2.toString());
List<String> members =
gApi.groups()
.id(group)
.members()
.stream()
.map(a -> a._accountId.toString())
.collect(toList());
assertThat(members).contains(user2.toString());
assertQuery("reviewerin:\"Registered Users\"", change2, change1);
assertQuery("reviewerin:" + group, change2);
gApi.changes().id(change2.getId().get()).current().review(ReviewInput.approve());
gApi.changes().id(change2.getId().get()).current().submit();
assertQuery("reviewerin:" + group);
assertQuery("status:merged reviewerin:" + group, change2);
}
@Test
>>>>>>>
public void reviewerin() throws Exception {
Account.Id user1 = accountManager.authenticate(AuthRequest.forUser("user1")).getAccountId();
Account.Id user2 = accountManager.authenticate(AuthRequest.forUser("user2")).getAccountId();
TestRepository<Repo> repo = createProject("repo");
Change change1 = insert(repo, newChange(repo));
Change change2 = insert(repo, newChange(repo));
insert(repo, newChange(repo));
AddReviewerInput rin = new AddReviewerInput();
rin.reviewer = user1.toString();
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change1.getId().get()).addReviewer(rin);
rin = new AddReviewerInput();
rin.reviewer = user2.toString();
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change2.getId().get()).addReviewer(rin);
String group = gApi.groups().create("foo").get().name;
gApi.groups().id(group).addMembers(user2.toString());
List<String> members =
gApi.groups()
.id(group)
.members()
.stream()
.map(a -> a._accountId.toString())
.collect(toList());
assertThat(members).contains(user2.toString());
assertQuery("reviewerin:\"Registered Users\"", change2, change1);
assertQuery("reviewerin:" + group, change2);
gApi.changes().id(change2.getId().get()).current().review(ReviewInput.approve());
gApi.changes().id(change2.getId().get()).current().submit();
assertQuery("reviewerin:" + group);
assertQuery("status:merged reviewerin:" + group, change2);
}
@Test
public void reviewerAndCcByEmail() throws Exception {
assume().that(notesMigration.readChanges()).isTrue();
Project.NameKey project = new Project.NameKey("repo");
TestRepository<Repo> repo = createProject(project.get());
ConfigInput conf = new ConfigInput();
conf.enableReviewerByEmail = InheritableBoolean.TRUE;
gApi.projects().name(project.get()).config(conf);
String userByEmail = "[email protected]";
String userByEmailWithName = "John Doe <" + userByEmail + ">";
Change change1 = insert(repo, newChange(repo));
Change change2 = insert(repo, newChange(repo));
insert(repo, newChange(repo));
AddReviewerInput rin = new AddReviewerInput();
rin.reviewer = userByEmailWithName;
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change1.getId().get()).addReviewer(rin);
rin = new AddReviewerInput();
rin.reviewer = userByEmailWithName;
rin.state = ReviewerState.CC;
gApi.changes().id(change2.getId().get()).addReviewer(rin);
if (getSchemaVersion() >= 41) {
assertQuery("reviewer:\"" + userByEmailWithName + "\"", change1);
assertQuery("cc:\"" + userByEmailWithName + "\"", change2);
// Omitting the name:
assertQuery("reviewer:\"" + userByEmail + "\"", change1);
assertQuery("cc:\"" + userByEmail + "\"", change2);
} else {
assertMissingField(ChangeField.REVIEWER_BY_EMAIL);
assertFailingQuery(
"reviewer:\"" + userByEmailWithName + "\"", "User " + userByEmailWithName + " not found");
assertFailingQuery(
"cc:\"" + userByEmailWithName + "\"", "User " + userByEmailWithName + " not found");
// Omitting the name:
assertFailingQuery("reviewer:\"" + userByEmail + "\"", "User " + userByEmail + " not found");
assertFailingQuery("cc:\"" + userByEmail + "\"", "User " + userByEmail + " not found");
}
}
@Test
public void reviewerAndCcByEmailWithQueryForDifferentUser() throws Exception {
assume().that(notesMigration.readChanges()).isTrue();
Project.NameKey project = new Project.NameKey("repo");
TestRepository<Repo> repo = createProject(project.get());
ConfigInput conf = new ConfigInput();
conf.enableReviewerByEmail = InheritableBoolean.TRUE;
gApi.projects().name(project.get()).config(conf);
String userByEmail = "John Doe <[email protected]>";
Change change1 = insert(repo, newChange(repo));
Change change2 = insert(repo, newChange(repo));
insert(repo, newChange(repo));
AddReviewerInput rin = new AddReviewerInput();
rin.reviewer = userByEmail;
rin.state = ReviewerState.REVIEWER;
gApi.changes().id(change1.getId().get()).addReviewer(rin);
rin = new AddReviewerInput();
rin.reviewer = userByEmail;
rin.state = ReviewerState.CC;
gApi.changes().id(change2.getId().get()).addReviewer(rin);
if (getSchemaVersion() >= 41) {
assertQuery("reviewer:\"[email protected]\"");
assertQuery("cc:\"[email protected]\"");
} else {
assertMissingField(ChangeField.REVIEWER_BY_EMAIL);
String someoneEmail = "[email protected]";
assertFailingQuery(
"reviewer:\"" + someoneEmail + "\"", "User " + someoneEmail + " not found");
assertFailingQuery("cc:\"" + someoneEmail + "\"", "User " + someoneEmail + " not found");
}
}
@Test |
<<<<<<<
@Inject private GeneralService gds;
@Inject private CoreConfigAdapter coreConfigAdapter;
@Inject private KitHandler handler;
=======
@Inject private KitService gds;
>>>>>>>
@Inject private CoreConfigAdapter coreConfigAdapter;
@Inject private KitHandler handler;
@Inject private KitService gds; |
<<<<<<<
import org.spongepowered.api.item.inventory.property.InventoryDimension;
=======
import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult;
>>>>>>>
import org.spongepowered.api.item.inventory.property.InventoryDimension;
import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; |
<<<<<<<
import org.spongepowered.api.data.persistence.DataTranslators;
=======
import org.spongepowered.api.data.key.Keys;
import org.spongepowered.api.data.translator.ConfigurateTranslator;
import org.spongepowered.api.item.inventory.ItemStack;
>>>>>>>
import org.spongepowered.api.data.persistence.DataTranslators;
import org.spongepowered.api.data.key.Keys;
import org.spongepowered.api.item.inventory.ItemStack;
<<<<<<<
// Process enchantments, temporary fix before Sponge gets a more general
// fix in.
=======
// Process enchantments, temporary fix before Sponge gets a more general fix in.
boolean emptyEnchant = false;
>>>>>>>
// Process enchantments, temporary fix before Sponge gets a more general fix in.
boolean emptyEnchant = false;
<<<<<<<
Optional<ItemStackSnapshot> oiss;
try {
oiss = Sponge.getDataManager().deserialize(ItemStackSnapshot.class, DataTranslators.CONFIGURATION_NODE.translate(value));
} catch (Exception e) {
oiss = Optional.empty();
}
=======
ConfigurationNode data = value.getNode("Data");
if (!data.isVirtual() && data.hasListChildren()) {
List<? extends ConfigurationNode> n = data.getChildrenList().stream()
.filter(x ->
!x.getNode("DataClass").getString().endsWith("SpongeEnchantmentData")
|| (!x.getNode("ManipulatorData", "ItemEnchantments").isVirtual() && x.getNode("ManipulatorData", "ItemEnchantments").hasListChildren()))
.collect(Collectors.toList());
emptyEnchant = n.size() != data.getChildrenList().size();
if (emptyEnchant) {
if (n.isEmpty()) {
value.removeChild("Data");
} else {
value.getNode("Data").setValue(n);
}
}
}
Optional<ItemStackSnapshot> oiss = Sponge.getDataManager().deserialize(ItemStackSnapshot.class,
ConfigurateTranslator.instance().translateFrom(value));
>>>>>>>
ConfigurationNode data = value.getNode("Data");
if (!data.isVirtual() && data.hasListChildren()) {
List<? extends ConfigurationNode> n = data.getChildrenList().stream()
.filter(x ->
!x.getNode("DataClass").getString().endsWith("SpongeEnchantmentData")
|| (!x.getNode("ManipulatorData", "ItemEnchantments").isVirtual() && x.getNode("ManipulatorData", "ItemEnchantments").hasListChildren()))
.collect(Collectors.toList());
emptyEnchant = n.size() != data.getChildrenList().size();
if (emptyEnchant) {
if (n.isEmpty()) {
value.removeChild("Data");
} else {
value.getNode("Data").setValue(n);
}
}
}
Optional<ItemStackSnapshot> oiss;
try {
oiss = Sponge.getDataManager().deserialize(ItemStackSnapshot.class, DataTranslators.CONFIGURATION_NODE.translate(value));
} catch (Exception e) {
oiss = Optional.empty();
}
<<<<<<<
ConfigurationNode root = DataTranslators.CONFIGURATION_NODE.translate(container);
ConfigurationNode ench = root.getNode("UnsafeData", "ench");
// Remove empty enchantment list.
if (!ench.isVirtual() && !ench.hasListChildren()) {
root.getNode("UnsafeData").removeChild("ench");
}
=======
ConfigurationNode root = ConfigurateTranslator.instance().translateData(container);
>>>>>>>
ConfigurationNode root = DataTranslators.CONFIGURATION_NODE.translate(container); |
<<<<<<<
Optional<Map<String, ?>> kwarg, TypeToken<R> returnType,
Optional<?> metadata, Optional<Integer> timeout,
Optional<Integer> gatherJobTimeout) {
this.functionName = functionName;
=======
Optional<Map<String, ?>> kwargs, TypeToken<R> returnType,
Optional<?> metadata) {
super(functionName, kwargs, returnType);
this.arg = arg;
this.metadata = metadata;
}
public LocalCall(String moduleName, String functionName, Optional<List<?>> arg,
Optional<Map<String, ?>> kwargs, TypeToken<R> returnType,
Optional<?> metadata) {
super(moduleName, functionName, kwargs, returnType);
>>>>>>>
Optional<Map<String, ?>> kwargs, TypeToken<R> returnType,
Optional<?> metadata, Optional<Integer> timeout,
Optional<Integer> gatherJobTimeout) {
super(functionName, kwargs, returnType);
this.arg = arg;
this.metadata = metadata;
this.timeout = timeout;
this.gatherJobTimeout = gatherJobTimeout;
}
public LocalCall(String moduleName, String functionName, Optional<List<?>> arg,
Optional<Map<String, ?>> kwargs, TypeToken<R> returnType,
Optional<?> metadata, Optional<Integer> timeout,
Optional<Integer> gatherJobTimeout) {
super(moduleName, functionName, kwargs, returnType);
<<<<<<<
return new LocalCall<>(functionName, arg, kwarg, returnType, Optional.of(metadata),
timeout, gatherJobTimeout);
=======
return new LocalCall<>(getFunctionName(), arg, getKwargs(), getReturnType(),
Optional.of(metadata));
>>>>>>>
return new LocalCall<>(getFunctionName(), arg, getKwargs(), getReturnType(),
Optional.of(metadata), timeout, gatherJobTimeout);
<<<<<<<
return new LocalCall<>(functionName, arg, kwarg, returnType, Optional.empty(),
timeout, gatherJobTimeout);
}
public LocalCall<R> withTimeouts(Optional<Integer> timeout,
Optional<Integer> gatherJobTimeout) {
return new LocalCall<>(functionName, arg, kwarg, returnType, metadata,
timeout, gatherJobTimeout);
}
public LocalCall<R> withoutTimeouts() {
return new LocalCall<>(functionName, arg, kwarg, returnType, metadata,
Optional.empty(), Optional.empty());
}
public TypeToken<R> getReturnType() {
return returnType;
=======
return new LocalCall<>(getFunctionName(), arg, getKwargs(), getReturnType(),
Optional.empty());
>>>>>>>
return new LocalCall<>(getFunctionName(), arg, getKwargs(), getReturnType(),
Optional.empty(), timeout, gatherJobTimeout);
}
public LocalCall<R> withTimeouts(Optional<Integer> timeout,
Optional<Integer> gatherJobTimeout) {
return new LocalCall<>(getFunctionName(), arg, getKwargs(), getReturnType(),
metadata, timeout, gatherJobTimeout);
}
public LocalCall<R> withoutTimeouts() {
return new LocalCall<>(getFunctionName(), arg, getKwargs(), getReturnType(),
metadata, Optional.empty(), Optional.empty()); |
<<<<<<<
payload.put("fun", getFunctionName());
kwargs.ifPresent(kwargs -> payload.put("kwargs", kwargs));
=======
payload.put("fun", functionName);
kwargs.ifPresent(kwargs -> payload.put("kwarg", kwargs));
>>>>>>>
payload.put("fun", getFunctionName());
kwargs.ifPresent(kwargs -> payload.put("kwarg", kwargs)); |
<<<<<<<
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
=======
>>>>>>>
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.