auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void anonCanRemindPasswordOnUserLoginSpecialPage() { <START> MailFunctions.deleteAllEmails(credentials.email, credentials.emailPassword); <END> WikiBasePageObject base = new WikiBasePageObject(); AttachedSignInPage signIn = new AttachedSignInPage().open(); signIn.clickForgotPasswordLink().requestLinkForUsername(User.FORGOTTEN_PASSWORD.getUserName()); String resetLink = base.getPasswordResetLink(credentials.email, credentials.emailPassword); ResetPasswordPage resetPass = new ResetPasswordPage(resetLink); resetPass.setNewPassword(User.FORGOTTEN_PASSWORD.getPassword()); Assertion.assertTrue(resetPass.newPasswordSetSuccessfully()); }</code><technical_language>Is this necessary? this issues other tests</technical_language>

Target:
public void anonCanRemindPasswordOnUserLoginSpecialPage() { EmailUtils.deleteAllEmails(credentials.email, credentials.emailPassword); WikiBasePageObject base = new WikiBasePageObject(); AttachedSignInPage signIn = new AttachedSignInPage().open(); signIn.clickForgotPasswordLink().requestLinkForUsername(User.FORGOTTEN_PASSWORD.getUserName()); String resetLink = base.getPasswordResetLink(credentials.email, credentials.emailPassword); ResetPasswordPage resetPass = new ResetPasswordPage(resetLink); resetPass.setNewPassword(User.FORGOTTEN_PASSWORD.getPassword()); assertTrue(resetPass.newPasswordSetSuccessfully()); }
Source:
<code>public boolean getChecked(Object element) { if (fObjects.containsKey(element)) { return fObjects.get(element); } <START> return fCheckboxTreeViewer.getChecked(element); <END> }</code><technical_language>If for element checked in viewer in map, other code is wrong, e.g. getCheckedElements(). If possible, return false here</technical_language>

Target:
public boolean getChecked(Object element) { return fObjects.contains(element); }
Source:
<code>public MetaDataStore(String scanPackageName) { super(META_DATA_PACKAGE); <START> this.scanPackageName = scanPackageName; <END> this.metadataDictionary = new EntityDictionary(new HashMap<>()); for (Class<? extends Annotation> cls : METADATA_STORE_CLASSES) { ClassScanner.getAnnotatedClasses(scanPackageName, cls).stream().forEach(modelClass -> { metadataDictionary.bindEntity(modelClass); }); } }</code><technical_language>this handle case metadatastore needs manage more package</technical_language>

Target:
public MetaDataStore(String scanPackageName) { super(META_DATA_PACKAGE); this.scanPackageName = scanPackageName; this.dictionary = new EntityDictionary(new HashMap<>()); ClassScanner.getAllClasses(Table.class.getPackage().getName()).stream().forEach(cls -> { dictionary.bindEntity(cls); }); for (Class<? extends Annotation> cls : METADATA_STORE_ANNOTATIONS) { dictionary.bindEntity(cls); ClassScanner.getAnnotatedClasses(scanPackageName, cls).stream().forEach(modelClass -> { dictionary.bindEntity(modelClass); addTable( isAnalyticView(modelClass) ? new AnalyticView(modelClass, dictionary) : new Table(modelClass, dictionary)); }); } }
Source:
<code><START> public void shouldBlockUserAfterCrossingTheFailureLoginCounter() { <END> MotechUser motechUser = new MotechUser(); motechUser.setUserStatus(UserStatus.MUST_CHANGE_PASSWORD); motechUser.setPassword(PASSWORD); motechUser.setUserName(USER); motechUser.setFailureLoginCounter(1); when(allMotechUsers.findByUserName(USER)).thenReturn(motechUser); when(motechPasswordEncoder.isPasswordValid(PASSWORD, PASSWORD)).thenReturn(false); when(motechPasswordEncoder.isPasswordValid(PASSWORD, NEW_PASSWORD)).thenReturn(false); when(settingService.getFailureLoginLimit()).thenReturn(1); motechUserService.changeExpiredPassword(USER, PASSWORD, NEW_PASSWORD); }</code><technical_language>check new method validates password password validator</technical_language>

Target:
public void shouldBlockUserAfterCrossingTheFailureLoginCounter() { MotechUser motechUser = new MotechUser(); motechUser.setUserStatus(UserStatus.MUST_CHANGE_PASSWORD); motechUser.setPassword(PASSWORD); motechUser.setUserName(USER); motechUser.setFailureLoginCounter(1); when(allMotechUsers.findByUserName(USER)).thenReturn(motechUser); when(motechPasswordEncoder.isPasswordValid(PASSWORD, PASSWORD)).thenReturn(false); when(settingService.getFailureLoginLimit()).thenReturn(1); motechUserService.changeExpiredPassword(USER, PASSWORD, NEW_PASSWORD); }
Source:
<code>public void onConnectAccept(IClient client) { logger.debug("onConnectAccept"+ client.getClientId()); try { WMSProperties properties = client.getProperties(); String entryId = Utils.getEntryIdFromClient(client); KalturaLiveEntry liveEntry = (KalturaLiveEntry)KalturaEntryDataPersistence.getPropertyByEntry(entryId, Constants.CLIENT_PROPERTY_KALTURA_LIVE_ENTRY); boolean isNewLiveRecordingEnabled = KalturaAPI.getKalturaAPI().isNewRecordingEnabled(liveEntry); if (!isNewLiveRecordingEnabled || liveEntry.recordStatus == null || liveEntry.recordStatus == KalturaRecordStatus.DISABLED){ <START> return; <END> } KalturaFlavorAssetListResponse liveAssetList = KalturaAPI.getKalturaAPI().getKalturaFlavorAssetListResponse(liveEntry); if (liveAssetList != null) { synchronized(properties) { properties.setProperty(Constants.CLIENT_PROPERTY_KALTURA_LIVE_ASSET_LIST, liveAssetList); } logger.debug("Adding live asset list for entry [" + liveEntry.id + "]" ); } } catch (Exception e ){ logger.error("Failed to load liveAssetList:",e); } }</code><technical_language><LINK_0> . removed now... add logs</technical_language>

Target:
public void onConnectAccept(IClient client) { logger.debug("onConnectAccept"+ client.getClientId()); try { WMSProperties properties = client.getProperties(); String entryId = Utils.getEntryIdFromClient(client); KalturaLiveEntry liveEntry = (KalturaLiveEntry)KalturaEntryDataPersistence.getPropertyByEntry(entryId, Constants.CLIENT_PROPERTY_KALTURA_LIVE_ENTRY); boolean isNewLiveRecordingEnabled = KalturaAPI.getKalturaAPI().isNewRecordingEnabled(liveEntry); if (isNewLiveRecordingEnabled || liveEntry.recordStatus == null || liveEntry.recordStatus == KalturaRecordStatus.DISABLED){ return; } KalturaFlavorAssetListResponse liveAssetList = KalturaAPI.getKalturaAPI().getKalturaFlavorAssetListResponse(liveEntry); if (liveAssetList != null) { synchronized(properties) { properties.setProperty(Constants.CLIENT_PROPERTY_KALTURA_LIVE_ASSET_LIST, liveAssetList); } logger.debug("Adding live asset list for entry [" + liveEntry.id + "]" ); } } catch (Exception e ){ logger.error("Failed to load liveAssetList:",e); } }
Source:
<code>public String save() { metadataPanel.preserve(); structurePanel.preserve(); if (validate()) { try (OutputStream out = ServiceManager.getFileService().write(mainFileUri)) { ServiceManager.getMetsService().save(workpiece, out); return close(); } catch (IOException e) { <START> Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); <END> logger.error(e.getLocalizedMessage()); } } PrimeFaces.current().executeScript("PF('sticky-notifications').removeAll();"); PrimeFaces.current().ajax().update("notifications"); return null; }</code><technical_language>Is passing of logger error message equal log stuff? Is logger needed</technical_language>

Target:
public String save() { metadataPanel.preserve(); structurePanel.preserve(); if (validate()) { try (OutputStream out = ServiceManager.getFileService().write(mainFileUri)) { ServiceManager.getMetsService().save(workpiece, out); return close(); } catch (IOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); } } PrimeFaces.current().executeScript("PF('sticky-notifications').removeAll();"); PrimeFaces.current().ajax().update("notifications"); return null; }
Source:
<code>public void testCloneRepositoryDefaultDirectory() throws IOException, JGitInternalException, GitAPIException { CloneCommand command = Git.cloneRepository(); command.setURI(fileUri()); <START> Git git2 = command.call(); <END> addRepoToClose(git2.getRepository()); assertEquals(git.getRepository().getWorkTree().getName(), git2.getRepository().getWorkTree().getName()); }</code><technical_language>this pollutes current directory test data, running this test Eclipse Maven this trash ends in org.eclipse.jgit.test</technical_language>

Target:
public void testCloneRepositoryDefaultDirectory() throws IOException, URISyntaxException, JGitInternalException, GitAPIException { CloneCommand command = Git.cloneRepository(); command.setURI(fileUri()); command.verifyDirectories(new URIish(fileUri())); File directory = command.getDirectory(); assertEquals(git.getRepository().getWorkTree().getName(), directory.getName()); }
Source:
<code><START> private String makeStringFromSentences(List<String> sentences, int numSentences) { <END> StringBuilder outStr = new StringBuilder(); for (int i = 0; i < numSentences; i++) { outStr.append(sentences.get(i)); outStr.append(' '); } return outStr.toString(); }</code><technical_language>TextUtils.join()[0] work? [0] <LINK_0>, java.lang.Iterable)</technical_language>

Target:
private String makeStringFromSentences(List<String> sentences, int numSentences) { StringBuilder outStr = new StringBuilder(); for (int i = 0; i < Math.min(numSentences, sentences.size()); i++) { outStr.append(sentences.get(i)); outStr.append(' '); } return outStr.toString(); }
Source:
<code>private void updateDataTables() { List<StarTable> plotterDataTables = new LinkedList<>(); List<StarTable> segmentDataTables = new LinkedList<>(); for (IrisStarTable table : selectedStarTables) { plotterDataTables.add(table.getPlotterTable()); <START> segmentDataTables.add(table.getDataTable()); <END> } plotterDataTable = new StackedStarTable(plotterDataTables, columnInfoMatcher); segmentDataTable = new StackedStarTable(segmentDataTables, columnInfoMatcher); setPlotterDataTable(plotterDataTable); setSegmentDataTable(segmentDataTable); }</code><technical_language>I if sense rename IrisStarTable get/setDataTable() methods get/setSegmentDataTable(), naming conventions in this file? In other words, I table.getDataTable(), I "Segment metadata," I "spectral, flux, error values"</technical_language>

Target:
private void updateDataTables() { List<StarTable> plotterDataTables = new LinkedList<>(); List<StarTable> segmentDataTables = new LinkedList<>(); for (IrisStarTable table : selectedStarTables) { plotterDataTables.add(table.getPlotterTable()); segmentDataTables.add(table.getSegmentDataTable()); } plotterDataTable = new StackedStarTable(plotterDataTables, columnInfoMatcher); segmentDataTable = new StackedStarTable(segmentDataTables, columnInfoMatcher); setPlotterDataTable(plotterDataTable); setSegmentDataTable(segmentDataTable); }
Source:
<code>protected Object computeInput(IWorkbenchPart part, ISelection selection, IJavaElement input, IProgressMonitor monitor) { if (getControl() == null || input == null) return null; String javadocHtml; switch (input.getElementType()) { case IJavaElement.COMPILATION_UNIT: try { IType[] types= ((ICompilationUnit) input).getTypes(); if (types.length == 0 && JavaModelUtil.isPackageInfo((ICompilationUnit) input)) { javadocHtml= getJavadocHtml(new IJavaElement[] { input.getParent() }, part, selection, monitor); } else { javadocHtml= getJavadocHtml(types, part, selection, monitor); } } catch (JavaModelException ex) { javadocHtml= null; } break; case IJavaElement.CLASS_FILE: if (input instanceof IModularClassFile) { try { javadocHtml= getJavadocHtml(new IJavaElement[] { ((IModularClassFile) input).getModule() }, part, selection, monitor); } catch (JavaModelException e) { return null; } } else { <START> javadocHtml= getJavadocHtml(new IJavaElement[] { ((IOrdinaryClassFile) input).getType() }, part, selection, monitor); <END> } break; default: javadocHtml= getJavadocHtml(new IJavaElement[] { input }, part, selection, monitor); } return javadocHtml; }</code><technical_language>PACKAGE_INFO_CLASS input.getParent() ealier, is lost</technical_language>

Target:
protected Object computeInput(IWorkbenchPart part, ISelection selection, IJavaElement input, IProgressMonitor monitor) { if (getControl() == null || input == null) return null; String javadocHtml; switch (input.getElementType()) { case IJavaElement.COMPILATION_UNIT: try { IType[] types= ((ICompilationUnit) input).getTypes(); if (types.length == 0 && JavaModelUtil.isPackageInfo((ICompilationUnit) input)) { javadocHtml= getJavadocHtml(new IJavaElement[] { input.getParent() }, part, selection, monitor); } else { javadocHtml= getJavadocHtml(types, part, selection, monitor); } } catch (JavaModelException ex) { javadocHtml= null; } break; case IJavaElement.CLASS_FILE: if (JavaModelUtil.PACKAGE_INFO_CLASS.equals(input.getElementName())) { javadocHtml= getJavadocHtml(new IJavaElement[] { input.getParent() }, part, selection, monitor); } else if (input instanceof IModularClassFile) { try { javadocHtml= getJavadocHtml(new IJavaElement[] { ((IModularClassFile) input).getModule() }, part, selection, monitor); } catch (JavaModelException e) { return null; } } else { javadocHtml= getJavadocHtml(new IJavaElement[] { ((IOrdinaryClassFile) input).getType() }, part, selection, monitor); } break; default: javadocHtml= getJavadocHtml(new IJavaElement[] { input }, part, selection, monitor); } return javadocHtml; }
Source:
<code>public void assignConsumerForSubscription(Subscription subscription) { logger.info("Creating consumer for {}", subscription.getQualifiedName()); try { Consumer consumer = consumerFactory.createConsumer(subscription); Signal start = Signal.of(Signal.SignalType.START, subscription.getQualifiedName(), consumer); <START> logger.info("Created consumer for {}. Initialized start signal with id {}", subscription.getQualifiedName(), start.getId()); <END> backgroundProcess.accept(start); if (subscription.getState() == PENDING) { subscriptionRepository.updateSubscriptionState(subscription.getTopicName(), subscription.getName(), ACTIVE); } logger.info("Consumer for was added for execution", subscription.getQualifiedName()); } catch (Exception ex) { logger.error("Failed to create consumer for subscription {}", subscription.getQualifiedName(), ex); } }</code><technical_language>This log ends a period, not, unified. messages more "parsable" visually. do of following? [Signal(id)] Created consumer for {}. [Signal(id)] Deleting consumer for {}. (and on)</technical_language>

Target:
public void assignConsumerForSubscription(Subscription subscription) { logger.info("Creating consumer for {}", subscription.getQualifiedName()); try { Consumer consumer = consumerFactory.createConsumer(subscription); Signal start = Signal.of(Signal.SignalType.START, subscription.getQualifiedName(), consumer); logger.info("Created consumer for {}. {}", subscription.getQualifiedName(), start.getLogWithIdAndType()); backgroundProcess.accept(start); if (subscription.getState() == PENDING) { subscriptionRepository.updateSubscriptionState(subscription.getTopicName(), subscription.getName(), ACTIVE); } logger.info("Consumer for was added for execution. {}", subscription.getQualifiedName(), start.getLogWithIdAndType()); } catch (Exception ex) { logger.error("Failed to create consumer for subscription {}", subscription.getQualifiedName(), ex); } }
Source:
<code>public final boolean visit(ThisExpression node) { Name q= node.getQualifier(); if (q == null) { return false; } <START> if (q.isSimpleName()) { if (((SimpleName) q).getIdentifier().equals(fDeclaringType.getElementName())) { fRewrite.set(node, ThisExpression.QUALIFIER_PROPERTY, null, null); } <END> } else if (q.getFullyQualifiedName().equals(fDeclaringType.getFullyQualifiedName())) { fRewrite.set(node, ThisExpression.QUALIFIER_PROPERTY, null, null); } return false; }</code><technical_language>If Name#getFullyQualifiedName(), handles case of isSimpleName() casts SimpleName call getIdentifier(). I simplify this : String nodeName= q.getFullyQualifiedName(); if (nodeName.equals(fDeclaringType.getFullyQualifiedName) || nodeName.equals(fDeclaringType.getName()) { ... ... }</technical_language>

Target:
public final boolean visit(ThisExpression node) { Name q= node.getQualifier(); if (q == null) { return false; } String qName = q.getFullyQualifiedName(); if (qName.equals(fDeclaringType.getElementName()) || qName.equals(fDeclaringType.getFullyQualifiedName())) { fRewrite.set(node, ThisExpression.QUALIFIER_PROPERTY, null, null); } return false; }
Source:
<code>public void testCreateOneTopic() throws Throwable { Map<String, NewTopic> newTopics = Collections.singletonMap(TEST_TOPIC, NEW_TEST_TOPIC); <START> WorkerUtils.createTopics(log, adminClient, newTopics, true, 3, 2500); <END> assertEquals(Collections.singleton(TEST_TOPIC), adminClient.listTopics().names().get()); assertEquals( new TopicDescription( TEST_TOPIC, false, Collections.singletonList( new TopicPartitionInfo(0, broker1, singleReplica, Collections.<Node>emptyList()))), adminClient.describeTopics( Collections.singleton(TEST_TOPIC)).values().get(TEST_TOPIC).get() ); }</code><technical_language>NIT: Reuse DEFAULT_TOPIC_VERIFY_BACKOFF in 2500 places defined</technical_language>

Target:
public void testCreateOneTopic() throws Throwable { Map<String, NewTopic> newTopics = Collections.singletonMap(TEST_TOPIC, NEW_TEST_TOPIC); WorkerUtils.createTopics(log, adminClient, newTopics, true, WorkerUtils.DEFAULT_TOPIC_VERIFY_RETRIES, WorkerUtils.DEFAULT_TOPIC_VERIFY_BACKOFF); assertEquals(Collections.singleton(TEST_TOPIC), adminClient.listTopics().names().get()); assertEquals( new TopicDescription( TEST_TOPIC, false, Collections.singletonList( new TopicPartitionInfo(0, broker1, singleReplica, Collections.<Node>emptyList()))), adminClient.describeTopics( Collections.singleton(TEST_TOPIC)).values().get(TEST_TOPIC).get() ); }
Source:
<code>public void setUp() throws Exception { Session.SessionBuilder sessionBuilder = testSessionBuilder(); <START> generatedEvents = new TestEventListener.EventsBuilder(); <END> queryRunner = DistributedQueryRunner.builder(sessionBuilder.build()) .setExtraProperties(ImmutableMap.of("testing-warning-collector.preloaded-warnings", String.valueOf(TEST_WARNINGS))) .setNodeCount(1) .build(); queryRunner.installPlugin(new TestEventListenerPlugin.TestingEventListenerPlugin(generatedEvents)); generatedEvents.initialize(EXPECTED_EVENTS); }</code><technical_language>import EventsBuilder</technical_language>

Target:
public void setUp() throws Exception { SessionBuilder sessionBuilder = testSessionBuilder(); generatedEvents = new EventsBuilder(); queryRunner = DistributedQueryRunner.builder(sessionBuilder.build()) .setExtraProperties(ImmutableMap.of("testing-warning-collector.preloaded-warnings", String.valueOf(TEST_WARNINGS))) .setNodeCount(1) .build(); queryRunner.installPlugin(new TestingEventListenerPlugin(generatedEvents)); generatedEvents.initialize(EXPECTED_EVENTS); }
Source:
<code>protected Event createEventByType(String eventType, String topic, String payload, String source) throws Exception { Event event = null; if (eventType.equals(ItemCommandEvent.TYPE)) { event = createCommandEvent(topic, payload, source); } else if (eventType.equals(ItemStateEvent.TYPE)) { event = createStateEvent(topic, payload, source); } else if (eventType.equals(ItemStateChangedEvent.TYPE)) { event = createStateChangedEvent(topic, payload); } else if (eventType.equals(ItemAddedEvent.TYPE)) { event = createAddedEvent(topic, payload); } else if (eventType.equals(ItemUpdatedEvent.TYPE)) { event = createUpdatedEvent(topic, payload); } else if (eventType.equals(ItemRemovedEvent.TYPE)) { event = createRemovedEvent(topic, payload); } else if (eventType.equals(GroupItemStateChangedEvent.TYPE)){ event = createGroupStateChangedEvent(topic, payload); <START> }else if (eventType.equals(GroupItemStateEvent.TYPE)){ <END> event = createGroupStateEvent(topic, payload, source); } return event; }</code><technical_language>missing space } in front of {</technical_language>

Target:
protected Event createEventByType(String eventType, String topic, String payload, String source) throws Exception { Event event = null; if (eventType.equals(ItemCommandEvent.TYPE)) { event = createCommandEvent(topic, payload, source); } else if (eventType.equals(ItemStateEvent.TYPE)) { event = createStateEvent(topic, payload, source); } else if (eventType.equals(ItemStateChangedEvent.TYPE)) { event = createStateChangedEvent(topic, payload); } else if (eventType.equals(ItemAddedEvent.TYPE)) { event = createAddedEvent(topic, payload); } else if (eventType.equals(ItemUpdatedEvent.TYPE)) { event = createUpdatedEvent(topic, payload); } else if (eventType.equals(ItemRemovedEvent.TYPE)) { event = createRemovedEvent(topic, payload); } else if (eventType.equals(GroupItemStateChangedEvent.TYPE)) { event = createGroupStateChangedEvent(topic, payload); } return event; }
Source:
<code>private PartialJoinOperatorImpl createPartialJoinOperatorImpl(OperatorSpec prevOperatorSpec, JoinOperatorSpec joinOpSpec, Config config, TaskContext context, Clock clock) { Pair<PartialJoinFunction, PartialJoinFunction> joinFunctions = getOrCreatePartialJoinFunctions(joinOpSpec); if (joinOpSpec.getLeftInputOpSpec().equals(prevOperatorSpec)) { return new PartialJoinOperatorImpl(joinOpSpec, true, <START> joinFunctions.getLeft(), joinFunctions.getRight(), config, context, clock); <END> } else { return new PartialJoinOperatorImpl(joinOpSpec, false, joinFunctions.getRight(), joinFunctions.getLeft(), config, context, clock); } }</code><technical_language>Minor: slightly confusing a local variable, a class member variable name</technical_language>

Target:
private PartialJoinOperatorImpl createPartialJoinOperatorImpl(OperatorSpec prevOperatorSpec, JoinOperatorSpec joinOpSpec, Config config, TaskContext context, Clock clock) { Pair<PartialJoinFunction, PartialJoinFunction> partialJoinFunctions = getOrCreatePartialJoinFunctions(joinOpSpec); if (joinOpSpec.getLeftInputOpSpec().equals(prevOperatorSpec)) { return new PartialJoinOperatorImpl(joinOpSpec, true, partialJoinFunctions.getLeft(), partialJoinFunctions.getRight(), config, context, clock); } else { return new PartialJoinOperatorImpl(joinOpSpec, false, partialJoinFunctions.getRight(), partialJoinFunctions.getLeft(), config, context, clock); } }
Source:
<code>public void start_passwordCheckerSaysOk_doesNotThrow() { try (CryptoSession cryptoSession = CryptoSession.start(Optional.of(PASSWORD1), CryptoSessionTest::passwordIsOk)) { <START> assertThat("Password checker returned OK", true); <END> } }</code><technical_language>This is a strange of assertThat. I org.junit.jupiter.api.Assertions.assertDoesNotThrow;</technical_language>

Target:
public void start_passwordCheckerSaysOk_doesNotThrow() { try (CryptoSession cryptoSession = CryptoSession.start(Optional.of(PASSWORD1), CryptoSessionTest::passwordIsOk)) { } }
Source:
<code>public void asEnumMapWithUnknownValue() { NodeAdapter subject = newNodeAdapterForTest("{ key : { unknown : 7 } }"); assertEquals(Map.<AnEnum, Double>of(), subject.asEnumMap("key", AnEnum.class, NodeAdapter::asDouble)); Logger log = Mockito.mock(Logger.class); subject.logUnusedParameters(log); <START> Mockito.verify(log).warn(Mockito.anyString(), Mockito.eq("Test/key/unknown")); <END> }</code><technical_language>Generally dots for nesting in JSON in JSON itself</technical_language>

Target:
public void asEnumMapWithUnknownValue() { NodeAdapter subject = newNodeAdapterForTest("{ key : { unknown : 7 } }"); assertEquals(Map.<AnEnum, Double>of(), subject.asEnumMap("key", AnEnum.class, NodeAdapter::asDouble)); Logger log = Mockito.mock(Logger.class); subject.logUnusedParameters(log); Mockito.verify(log) .warn( Mockito.anyString(), Mockito.eq("key.unknown"), Mockito.eq("Test") ); }
Source:
<code><START> private static File locateMainArtifact(String version, File target, boolean enterprise) { <END> File artifact = new File(LOCAL_M2_REPOSITORY_PREFIX + constructPath(version, enterprise)); if (artifact.exists()) { return artifact; } else { return downloadMember(version, target, enterprise); } }</code><technical_language>Minor: locateMember renamed locateMainArtifact, downloadMember renamed, too</technical_language>

Target:
private static File locateMainArtifact(String version, File target, boolean enterprise) { File artifact = new File(LOCAL_M2_REPOSITORY_PREFIX + constructPath(version, enterprise)); if (artifact.exists()) { return artifact; } else { return downloadMainArtifact(version, target, enterprise); } }
Source:
<code>@Override public JsonWriter jsonValue(String value) throws IOException { <START> put(new JsonValue(value)); return this; <END> }</code><technical_language>check if == null emit JSON null, is done JsonWriter.jsonValue(...). suggestion if (value == null) { return nullValue(); } else { put(new JsonValue(value)); return this; }</technical_language>

Target:
@Override public JsonWriter jsonValue(String value) throws IOException { put(JsonParser.parseString(value)); return this; }
Source:
<code>public RequestExecutor(final CloseableHttpClient client, final HttpHost host, final Ds3Request ds3Request) throws IOException { this.client = client; this.ds3Request = ds3Request; this.host = host; this.content = ds3Request.getStream(); if (this.content != null && !this.content.markSupported()) { throw new RequiresMarkSupportedException(); } <START> Object[] paramArray = {this.ds3Request.getVerb(), this.host.toString(), getEscapedRequestPath(this.ds3Request)}; <END> LOG.info("Sending request: {}", paramArray ); this.checksumType = ds3Request.getChecksumType(); this.hash = this.buildHash(); }</code><technical_language>I asked this, paramArray final</technical_language>

Target:
public RequestExecutor(final CloseableHttpClient client, final HttpHost host, final Ds3Request ds3Request) throws IOException { this.client = client; this.ds3Request = ds3Request; this.host = host; this.content = ds3Request.getStream(); if (this.content != null && !this.content.markSupported()) { throw new RequiresMarkSupportedException(); } final Object[] paramArray = {this.ds3Request.getVerb(), this.host.toString(), getEscapedRequestPath(this.ds3Request)}; LOG.info("Sending request: {}", paramArray ); this.checksumType = ds3Request.getChecksumType(); this.hash = this.buildHash(); }
Source:
<code>public void toggleAnonymous() throws Exception { final Address authenticationConfigurationAddress = createAuthenticationConfiguration(); final boolean initialValue = false; try { elytronAuthenticationOperations.performActionOnAttributeAndRevertItsValueToOriginal( authenticationConfigurationAddress, () -> { page.navigate(); page.switchToAuthenticationConfiguration() .getResourceManager() .selectByName(authenticationConfigurationAddress.getLastPairValue()); new ConfigChecker.Builder(client, authenticationConfigurationAddress) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.CHECKBOX, ANONYMOUS, !initialValue) .verifyFormSaved() .verifyAttribute(ANONYMOUS, !initialValue); Console.withBrowser(browser).dismissReloadRequiredWindowIfPresent(); new ConfigChecker.Builder(client, authenticationConfigurationAddress) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.CHECKBOX, ANONYMOUS, initialValue) .verifyFormSaved() <START> .verifyAttribute(ANONYMOUS, initialValue); }, <END> ANONYMOUS); } finally { ops.removeIfExists(authenticationConfigurationAddress); } }</code><technical_language>please remove spaces }. Ideally add new line } instead of spaces</technical_language>

Target:
public void toggleAnonymous() throws Exception { final Address authenticationConfigurationAddress = createAuthenticationConfiguration(); final boolean initialValue = false; try { elytronAuthenticationOperations.performActionOnAttributeAndRevertItsValueToOriginal( authenticationConfigurationAddress, ANONYMOUS, () -> { page.navigate(); page.switchToAuthenticationConfiguration() .getResourceManager() .selectByName(authenticationConfigurationAddress.getLastPairValue()); new ConfigChecker.Builder(client, authenticationConfigurationAddress) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.CHECKBOX, ANONYMOUS, !initialValue) .verifyFormSaved() .verifyAttribute(ANONYMOUS, !initialValue); Console.withBrowser(browser).dismissReloadRequiredWindowIfPresent(); new ConfigChecker.Builder(client, authenticationConfigurationAddress) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.CHECKBOX, ANONYMOUS, initialValue) .verifyFormSaved() .verifyAttribute(ANONYMOUS, initialValue); } ); } finally { ops.removeIfExists(authenticationConfigurationAddress); } }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CacheKey cacheKey = (CacheKey) o; if (name != null ? !name.equals(cacheKey.name) : cacheKey.name != null) return false; <START> if (sqlObjectType != null ? !sqlObjectType.equals(cacheKey.sqlObjectType) : cacheKey.sqlObjectType != null) <END> return false; return sqlObjectMethod != null ? sqlObjectMethod.equals(cacheKey.sqlObjectMethod) : cacheKey.sqlObjectMethod == null; }</code><technical_language>naked if blocks braces causing build fail (checkstyle). Need add braces. ~~Alternatively, depend Java 7, java.util.Objects.equals simplify this method:~~ Apparently target Java 6 (that a sad panda) return Objects.equals(this.name, cacheKey.name) && Objects.equals(this.sqlObjectType, cacheKey.sqlObjectType) && Objects.equals(this.sqlObjectMethod, cacheKey.sqlObjectMethod);</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CacheKey that = (CacheKey) o; return eq(this.name, that.name) && eq(this.sqlObjectType, that.sqlObjectType) && eq(this.sqlObjectMethod, that.sqlObjectMethod); }
Source:
<code>private void updateThreadParent() throws NodeStoreException { <START> if (null == inReplyTo) return; <END> channelManager.updateThreadParent(node, inReplyTo); }</code><technical_language>avoid blocks braces</technical_language>

Target:
private void updateThreadParent() throws NodeStoreException { if (null == inReplyTo) { return; } channelManager.updateThreadParent(node, inReplyTo); }
Source:
<code>public void renderHead(Component component, IHeaderResponse response) { response.render(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())); response.render(JavaScriptHeaderItem.forReference(new PackageResourceReference(this.getClass(), "tooltipsy.min.js"))); <START> if (getHostComponent() != null) { <END> String selector = "#" + getHostComponent().getMarkupId(); if (!overrideSelector.equals("")) { selector = overrideSelector; } String javascript = "$('" + selector + "').tooltipsy(" + options.getParameterString() + ");"; response.render(OnLoadHeaderItem.forScript(javascript)); } }</code><technical_language>need save a reference host component. passed "component" parameter renderHead(). This instance of behavior components. Ajax behaviors preserve host produce callback url stable</technical_language>

Target:
public void renderHead(Component component, IHeaderResponse response) { response.render(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())); response.render(JavaScriptHeaderItem.forReference(new PackageResourceReference(this.getClass(), TOOLTIPSY_JS_FILENAME))); if (component != null) { String selector = "#" + component.getMarkupId(); if (!overrideSelector.equals("")) { selector = overrideSelector; } String javascript = "$('" + selector + "').tooltipsy(" + options.getParameterString() + ");"; response.render(OnLoadHeaderItem.forScript(javascript)); } }
Source:
<code>public void close() { if (noCurrentGraphFrame()) { return; } Tab curFrame = (Tab) aTabbedPane.getSelectionModel().getSelectedItem(); <START> if (curFrame != null) <END> { GraphFrame openFrame = (GraphFrame) curFrame; if (openFrame.getGraphPanel().isModified()) { Alert alert = new Alert(AlertType.CONFIRMATION, aEditorResources.getString("dialog.close.ok"), ButtonType.YES, ButtonType.NO); alert.initOwner(aMainStage); alert.setTitle(aEditorResources.getString("dialog.close.title")); alert.setHeaderText(aEditorResources.getString("dialog.close.title")); alert.showAndWait(); if (alert.getResult() == ButtonType.YES) { removeTab(curFrame); } return; } else { removeTab(curFrame); } } }</code><technical_language>please rename currentFrame</technical_language>

Target:
public void close() { if (noCurrentGraphFrame()) { return; } Tab currentFrame = (Tab) aTabbedPane.getSelectionModel().getSelectedItem(); if (currentFrame != null) { GraphFrame openFrame = (GraphFrame) currentFrame; if (openFrame.getGraphPanel().isModified()) { Alert alert = new Alert(AlertType.CONFIRMATION, aEditorResources.getString("dialog.close.ok"), ButtonType.YES, ButtonType.NO); alert.initOwner(aMainStage); alert.setTitle(aEditorResources.getString("dialog.close.title")); alert.setHeaderText(aEditorResources.getString("dialog.close.title")); alert.showAndWait(); if (alert.getResult() == ButtonType.YES) { removeTab(currentFrame); } return; } else { removeTab(currentFrame); } } }
Source:
<code>public void TestOverflowToDisk() throws Exception { RowMapBuffer buffer = new RowMapBuffer(2); RowMap r; buffer.add(new RowMap("insert", "foo", "bar", 1L, new ArrayList<String>(), new BinlogPosition(3, "mysql.1"))); buffer.add(new RowMap("insert", "foo", "bar", 2L, new ArrayList<String>(), new BinlogPosition(3, "mysql.1"))); buffer.add(new RowMap("insert", "foo", "bar", 3L, new ArrayList<String>(), new BinlogPosition(3, "mysql.1"))); <START> <END> assertThat(buffer.size(), is(3L)); assertThat(buffer.removeFirst().getTimestamp(), is(1L)); assertThat(buffer.removeFirst().getTimestamp(), is(2L)); assertThat(buffer.removeFirst().getTimestamp(), is(3L)); }</code><technical_language>assert holding 2 in memory</technical_language>

Target:
public void TestOverflowToDisk() throws Exception { RowMapBuffer buffer = new RowMapBuffer(2); RowMap r; buffer.add(new RowMap("insert", "foo", "bar", 1L, new ArrayList<String>(), new BinlogPosition(3, "mysql.1"))); buffer.add(new RowMap("insert", "foo", "bar", 2L, new ArrayList<String>(), new BinlogPosition(3, "mysql.1"))); buffer.add(new RowMap("insert", "foo", "bar", 3L, new ArrayList<String>(), new BinlogPosition(3, "mysql.1"))); assertThat(buffer.size(), is(3L)); assertThat(buffer.inMemorySize(), is(2L)); assertThat(buffer.removeFirst().getTimestamp(), is(1L)); assertThat(buffer.removeFirst().getTimestamp(), is(2L)); assertThat(buffer.removeFirst().getTimestamp(), is(3L)); }
Source:
<code>public IPluginBase createPluginBase(boolean isFragment) { <START> if (fPluginBase != null) <END> return fPluginBase; if (isFragment) { fPluginBase = new FragmentNode(); fPluginBase.setXMLTagName("fragment"); } else { fPluginBase = new PluginNode(); fPluginBase.setXMLTagName("plugin"); } fPluginBase.setInTheModel(true); fPluginBase.setModel(this); return fPluginBase; }</code><technical_language>brackets for single statements</technical_language>

Target:
public IPluginBase createPluginBase(boolean isFragment) { if (fPluginBase != null) { return fPluginBase; } if (isFragment) { fPluginBase = new FragmentNode(); fPluginBase.setXMLTagName("fragment"); } else { fPluginBase = new PluginNode(); fPluginBase.setXMLTagName("plugin"); } fPluginBase.setInTheModel(true); fPluginBase.setModel(this); return fPluginBase; }
Source:
<code>public static BigtableDataSettings createBigtableDataSettings(@Nonnull final BigtableOptions options) throws IOException { checkState(options.getProjectId() != null, "Project ID is required"); <START> checkState(options.getInstanceId() != null, "Instance ID is required"); <END> checkState(options.getRetryOptions().enableRetries(), "Disabling retries is not currently supported."); final BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilder(); builder.setProjectId(options.getProjectId()); builder.setInstanceId(options.getInstanceId()); builder.setAppProfileId(options.getAppProfileId()); builder.setEndpoint(options.getDataHost() + ":" + options.getPort()); builder.setCredentialsProvider(buildCredentialProvider(options.getCredentialOptions())); buildBulkMutationsSettings(builder, options); buildCheckAndMutateRowSettings(builder, options.getCallOptionsConfig().getShortRpcTimeoutMs()); buildReadModifyWriteSettings(builder, options.getCallOptionsConfig().getShortRpcTimeoutMs()); buildReadRowSettings(builder, options); buildReadRowsSettings(builder, options); buildMutateRowSettings(builder, options); buildSampleRowKeysSettings(builder, options); builder.setTransportChannelProvider(createChannelProvider(options.getDataHost(), options)); return builder.build(); }</code><technical_language>Is this necessary? underlying BigtableDataSettings validate this</technical_language>

Target:
public static BigtableDataSettings createBigtableDataSettings( @Nonnull final BigtableOptions options) throws IOException { checkState(options.getRetryOptions().enableRetries(), "Disabling retries is not currently supported."); checkState(!options.useCachedChannel(), "cachedDataPool is not currently supported."); final BigtableDataSettings.Builder builder = BigtableDataSettings.newBuilder(); final Builder dataSettingStub = builder.stubSettings(); Duration shortRpcTimeoutMs = ofMillis(options.getCallOptionsConfig().getShortRpcTimeoutMs()); builder .setProjectId(options.getProjectId()) .setInstanceId(options.getInstanceId()) .setAppProfileId(options.getAppProfileId()); dataSettingStub .setEndpoint(options.getDataHost() + ":" + options.getPort()) .setHeaderProvider(buildHeaderProvider(options.getUserAgent())) .setCredentialsProvider(buildCredentialProvider(options.getCredentialOptions())); if(options.usePlaintextNegotiation()){ dataSettingStub .setTransportChannelProvider(buildChannelProvider(dataSettingStub.getEndpoint(), options)); } dataSettingStub.checkAndMutateRowSettings() .setSimpleTimeoutNoRetries(shortRpcTimeoutMs); dataSettingStub.readModifyWriteRowSettings() .setSimpleTimeoutNoRetries(shortRpcTimeoutMs); buildBulkMutationsSettings(dataSettingStub, options); buildReadRowsSettings(dataSettingStub, options); buildReadRowSettings(dataSettingStub, options); buildMutateRowSettings(dataSettingStub, options); buildSampleRowKeysSettings(dataSettingStub, options); return builder.build(); }
Source:
<code>protected ModelAndView uploadReportTemplate(HttpServletRequest request, @RequestParam MultipartFile templateFile) throws IOException { <START> if (!templateFile.isEmpty()) { <END> try { mrrtReportTemplateService.importMrrtReportTemplate(templateFile.getInputStream()); request.getSession() .setAttribute(WebConstants.OPENMRS_MSG_ATTR, "radiology.report.template.imported"); } catch (IOException exception) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Failed to import " + templateFile.getOriginalFilename() + " => " + exception.getMessage()); } } else { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "radiology.report.template.not.imported.empty"); } return new ModelAndView(RADIOLOGY_DASHBOARD_FORM_VIEW); }</code><technical_language>@ivange94 bad :) please turn this a guard clause. Test for is empty if execute code else clause. Reads nicer is nested</technical_language>

Target:
protected ModelAndView uploadReportTemplate(HttpServletRequest request, @RequestParam MultipartFile templateFile) throws IOException { if (templateFile.isEmpty()) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "radiology.MrrtReportTemplate.not.imported.empty"); return new ModelAndView(RADIOLOGY_DASHBOARD_FORM_VIEW); } try { mrrtReportTemplateService.importMrrtReportTemplate(templateFile.getInputStream()); request.getSession() .setAttribute(WebConstants.OPENMRS_MSG_ATTR, "radiology.MrrtReportTemplate.imported"); } catch (IOException exception) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Failed to import " + templateFile.getOriginalFilename() + " => " + exception.getMessage()); } catch (APIException exception) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Failed to import " + templateFile.getOriginalFilename() + " => " + exception.getMessage()); } return new ModelAndView(RADIOLOGY_DASHBOARD_FORM_VIEW); }
Source:
<code>public void shouldAddUser() { controller.add(user); verify(userDao).add(user); assertEquals("User " + user.getName() + " successfully added", result.included().get("notice")); <START> } <END></code><technical_language>assertThat(result.included().get("notice"), "User " + user.getName() + " successfully added") Yes, assertThat inverted parameters another JUnit methods</technical_language>

Target:
public void shouldAddUser() { controller.add(user); verify(userDao).add(user); assertThat(result.included().get("notice").toString(), is("User " + user.getName() + " successfully added")); }
Source:
<code>public void tearDown() throws Exception { FileUtils.deleteQuietly(nuxeoHome); <START> originSystemProps.forEach((key, originValue) -> { <END> if (originValue == null) { System.clearProperty(key); } else { System.setProperty(key, originValue); } }); originSystemProps.clear(); }</code><technical_language>call</technical_language>

Target:
public void tearDown() throws Exception { FileUtils.deleteQuietly(nuxeoHome); originSystemProps.forEach((key, value) -> { if (value == null) { System.clearProperty(key); } else { System.setProperty(key, value); } }); originSystemProps.clear(); }
Source:
<code>private void setCommandScriptContent(String str) { if (str != null && str.length() > EDITOR_SCRIPT_MAX_SIZE_THRESHOLD) { getTxtOutput().setText(""); largeScriptContent = str; isLargeScriptContent = true; } else { if (str == null) { getTxtOutput().setText(""); } else { <START> getTxtOutput().append(str); <END> } largeScriptContent = ""; isLargeScriptContent = false; } setSyntaxHighlightTextAreaVisible(); }</code><technical_language>setText in cases (null defaults empty append is required, is called set)</technical_language>

Target:
private void setCommandScriptContent(String str) { if (str.length() > EDITOR_SCRIPT_MAX_SIZE_THRESHOLD) { getTxtOutput().setText(""); largeScriptContent = str; largeScriptContentSet = true; } else { getTxtOutput().setText(str); largeScriptContent = ""; largeScriptContentSet = false; } if (largeScriptContentSet) { this.remove(getJScrollPane()); this.add(largeScriptPanel, largeScriptPanel.getName()); largeScriptLabel.setText(Constant.messages.getString("scripts.dialog.script.large.warning", largeScriptContent.length())); } else { this.remove(largeScriptPanel); this.add(getJScrollPane(), getJScrollPane().getName()); } }
Source:
<code>public int hashCode() { <START> HashCodeBuilder builder = new HashCodeBuilder(INITIAL, MULTIPLIER); <END> builder.append(path); builder.append(type); return builder.toHashCode(); }</code><technical_language>I is default constructor for HashCodeBuilder, pass constants</technical_language>

Target:
public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); builder.append(path); builder.append(type); return builder.toHashCode(); }
Source:
<code><START> private ZapTable getMessagesTable() { <END> if (messagesTable == null) { messagesTable = new HistoryReferencesTable(EMPTY_RESULTS_MODEL); messagesTable.setName(MESSAGE_CONTAINER_NAME); messagesTable.setAutoCreateColumnsFromModel(false); } return messagesTable; }</code><technical_language>This return HistoryReferencesTable</technical_language>

Target:
private HistoryReferencesTable getMessagesTable() { if (messagesTable == null) { messagesTable = new HistoryReferencesTable(EMPTY_RESULTS_MODEL); messagesTable.setName(MESSAGE_CONTAINER_NAME); messagesTable.setAutoCreateColumnsFromModel(false); } return messagesTable; }
Source:
<code>public Integer getRecursiveStmtId() { <START> return m_sharedScan.getBestCostRecurseStmtId(); <END> }</code><technical_language>Again, I change Recurse Recursive</technical_language>

Target:
public Integer getRecursiveStmtId() { return m_sharedScan.getBestCostRecursiveStmtId(); }
Source:
<code>@Test public void responseConverterFactoryNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingConverterFactory nonMatchingFactory = new NonMatchingConverterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(nonMatchingFactory) .build(); try { retrofit.responseBodyConverter(type, annotations); <START> } catch (IllegalArgumentException e) { <END> assertThat(e).hasMessage("" + "Could not locate ResponseBody converter for class java.lang.String.\n" + " Tried:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory"); } assertThat(nonMatchingFactory.called).isTrue(); }</code><technical_language>fail</technical_language>

Target:
@Test public void responseConverterFactoryNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingConverterFactory nonMatchingFactory = new NonMatchingConverterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addConverterFactory(nonMatchingFactory) .build(); try { retrofit.responseBodyConverter(type, annotations); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("" + "Could not locate ResponseBody converter for class java.lang.String.\n" + " Tried:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory"); } assertThat(nonMatchingFactory.called).isTrue(); }
Source:
<code><START> public void shouldReturnNetAmountIfFeeExists() { <END> long chargeId = nextInt(); String externalChargeId = RandomIdGenerator.newId(); long feeCollected = 100L; long defaultAmount = 6234L; long defaultCorporateSurchargeAmount = 150L; createCharge(externalChargeId, chargeId); databaseTestHelper.addFee(RandomIdGenerator.newId(), chargeId, 100L, feeCollected, ZonedDateTime.now(), "irrelevant_id"); connectorRestApiClient .withAccountId(accountId) .withChargeId(externalChargeId) .getCharge() .statusCode(OK.getStatusCode()) .contentType(JSON) .body("fee", is(100)) .body("net_amount", is(defaultAmount + defaultCorporateSurchargeAmount - feeCollected)); }</code><technical_language>test for /v2/api/accounts/{accountId}/charges</technical_language>

Target:
public void shouldReturnNetAmountIfFeeExists() { long chargeId = nextInt(); String externalChargeId = RandomIdGenerator.newId(); long feeCollected = 100L; long defaultAmount = 6234L; long defaultCorporateSurchargeAmount = 150L; createCharge(externalChargeId, chargeId); databaseTestHelper.addFee(RandomIdGenerator.newId(), chargeId, 100L, feeCollected, ZonedDateTime.now(), "irrelevant_id"); connectorRestApiClient .withAccountId(accountId) .withChargeId(externalChargeId) .getCharge() .statusCode(OK.getStatusCode()) .contentType(JSON) .body("fee", is(100)) .body("net_amount", is(Long.valueOf(defaultAmount + defaultCorporateSurchargeAmount - feeCollected).intValue())); }
Source:
<code><START> public SignUpRequest(final Activity activity, HashMap<String, String> params, final Response.Listener<Session> listener, final Response.Listener<APIError> errorListener) { <END> super(Request.Method.POST, makeURL("users"), signUpRequestParams(activity, params), new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject jsonObject) { try { String sessionJson = jsonObject.get("session").toString(); ObjectMapper mapper = getNetworkManager(activity.getApplicationContext()).getObjectMapper(); Session session = mapper.readValue(sessionJson, new TypeReference<Session>() { }); listener.onResponse(session); } catch (Exception e) { Log.e("Json exception", e.toString()); } } }, activity); }</code><technical_language>I want pass in errorListener super</technical_language>

Target:
public SignUpRequest(final Activity activity, HashMap<String, String> params, final Response.Listener<Session> listener, final Response.Listener<APIError> errorListener) { super(Request.Method.POST, makeURL("users"), signUpRequestParams(activity, params), new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject jsonObject) { try { String sessionJson = jsonObject.get("session").toString(); ObjectMapper mapper = getNetworkManager(activity.getApplicationContext()).getObjectMapper(); Session session = mapper.readValue(sessionJson, new TypeReference<Session>() { }); listener.onResponse(session); } catch (Exception e) { Log.e("Json exception", e.toString()); } } }, errorListener, activity); }