auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testList() throws UnauthorizedException, GeneralException { final ContactList contactResponseList = TestUtil.createContactList(); MessageBirdService messageBirdServiceMock = mock(MessageBirdService.class); MessageBirdClient messageBirdClientInjectMock = new MessageBirdClient(messageBirdServiceMock); when(messageBirdServiceMock.requestList(Mockito.eq(CONTACTPATH), Mockito.eq(0), Mockito.eq(20), Mockito.eq(ContactList.class))) .thenReturn(contactResponseList); final ContactList response = messageBirdClientInjectMock.listContacts(); verify(messageBirdServiceMock, times(1)) .requestList(Mockito.eq(CONTACTPATH), Mockito.eq(0), Mockito.eq(20), Mockito.eq(ContactList.class)); <START> assertEquals(response.getItems().get(0).getFirstName(), contactResponseList.getItems().get(0).getFirstName()); <END> assertEquals(response.getItems().get(0).getLastName(), contactResponseList.getItems().get(0).getLastName()); assertEquals(response.getItems().get(0).getId(), contactResponseList.getItems().get(0).getId()); assertEquals(response.getItems().get(0).getCreatedDatetime(), contactResponseList.getItems().get(0).getCreatedDatetime()); assertEquals(response.getItems().get(0).getMsisdn(), contactResponseList.getItems().get(0).getMsisdn()); assertEquals(response.getItems().get(0).getCustomDetails().getCustom1(), contactResponseList.getItems().get(0).getCustomDetails().getCustom1()); assertEquals(response.getItems().get(0).getMessages().getHREF(), contactResponseList.getItems().get(0).getMessages().getHREF()); assertEquals(response.getItems().get(0).getMessages().getTotalCount(), contactResponseList.getItems().get(0).getMessages().getTotalCount()); assertEquals(response.getItems().get(0).getHref(), contactResponseList.getItems().get(0).getHref()); assertEquals(response.getItems().get(0).getGroups().getHREF(), contactResponseList.getItems().get(0).getGroups().getHREF()); assertEquals(response.getItems().get(0).getGroups().getTotalCount(), contactResponseList.getItems().get(0).getGroups().getTotalCount()); assertNotNull(response.getItems().get(0).getCreatedDatetime()); assertNotNull(response.getItems().get(0).getUpdatedDatetime()); }</code><technical_language>java skillz amazing recursively assert items same? Assert.assertThat(expected, new ReflectionEquals(actual, excludeFields)); something? avoid repetitive code</technical_language>

Target:
public void testList() throws UnauthorizedException, GeneralException { final ContactList contactResponseList = TestUtil.createContactList(); MessageBirdService messageBirdServiceMock = mock(MessageBirdService.class); MessageBirdClient messageBirdClientInjectMock = new MessageBirdClient(messageBirdServiceMock); when(messageBirdServiceMock.requestList(Mockito.eq(CONTACTPATH), Mockito.eq(0), Mockito.eq(20), Mockito.eq(ContactList.class))) .thenReturn(contactResponseList); final ContactList response = messageBirdClientInjectMock.listContacts(); verify(messageBirdServiceMock, times(1)) .requestList(Mockito.eq(CONTACTPATH), Mockito.eq(0), Mockito.eq(20), Mockito.eq(ContactList.class)); assertReflectionEquals(response.getItems().get(0),contactResponseList.getItems().get(0)); }
Source:
<code>private static String getCompleteKey(String[] keys, int start, int end) { <START> StringBuilder sb = new StringBuilder(1024); <END> for (int i = start; i < end; ++i) { if (i > start) { sb.append(KEY_SEPARATOR); } sb.append(keys[i]); } return sb.toString(); }</code><technical_language>elements need, allocating 1024 instead of (end-start)</technical_language>

Target:
private static String getCompleteKey(String[] keys, int start, int end) { int length = 0; for (int keyIndex = 0; keyIndex < keys.length; keyIndex++) { length += keys[keyIndex].length(); } StringBuilder sb = new StringBuilder(length); for (int i = start; i < end; ++i) { if (i > start) { sb.append(KEY_SEPARATOR); } sb.append(keys[i]); } return sb.toString(); }
Source:
<code>private Symbol addFlowFromLearnedAssociations(ExplodedGraph.Edge edge, ImmutableList.Builder<JavaFileScannerContext.Location> flowBuilder) { <START> Symbol newTrackSymbol = trackSymbol; <END> if (newTrackSymbol == null) { return null; } ExplodedGraph.Node parent = edge.parent; Optional<LearnedAssociation> learnedAssociation = edge.learnedAssociations().stream() .filter(la -> la.symbol().equals(trackSymbol)) .findFirst(); if (learnedAssociation.isPresent()) { LearnedAssociation la = learnedAssociation.get(); for (Class<? extends Constraint> domain : domains) { Constraint constraint = parent.programState.getConstraint(la.symbolicValue(), domain); if(constraint != null) { flowBuilder.add(location(parent, String.format("'%s' is assigned %s.", la.symbol().name(), constraint.valueAsString()))); } } return parent.programState.getLastEvaluated(); } return newTrackSymbol; }</code><technical_language>newTrackSymbol is a bit useless : remove (personal pref) assign in isPresent if (to get rid of direct return)</technical_language>

Target:
private Symbol addFlowFromLearnedAssociations(ExplodedGraph.Edge edge, ImmutableList.Builder<JavaFileScannerContext.Location> flowBuilder) { if (trackSymbol == null) { return null; } ExplodedGraph.Node parent = edge.parent; Optional<LearnedAssociation> learnedAssociation = edge.learnedAssociations().stream() .filter(la -> la.symbol().equals(trackSymbol)) .findFirst(); if (learnedAssociation.isPresent()) { LearnedAssociation la = learnedAssociation.get(); for (Class<? extends Constraint> domain : domains) { Constraint constraint = parent.programState.getConstraint(la.symbolicValue(), domain); if (constraint != null) { flowBuilder.add(location(parent, String.format("'%s' is assigned %s.", la.symbol().name(), constraint.valueAsString()))); } } return parent.programState.getLastEvaluated(); } return trackSymbol; }
Source:
<code>public void testTimestampWithDelay() throws Exception { expectInitializeNoOffsets(Arrays.asList(SINGLE_TABLE_PARTITION)); PowerMock.replayAll(); db.createTable(SINGLE_TABLE_NAME, "modified", "TIMESTAMP NOT NULL", "id", "INT"); db.insert(SINGLE_TABLE_NAME, "modified", JdbcUtils.formatUTC(new Timestamp(10L)), "id", 1); startTask("modified", null, null, 4L); verifyTimestampFirstPoll(TOPIC_PREFIX + SINGLE_TABLE_NAME); <START> Long currentTime = new Date().getTime(); <END> db.insert(SINGLE_TABLE_NAME, "modified", JdbcUtils.formatUTC(new Timestamp(currentTime)), "id", 2); db.insert(SINGLE_TABLE_NAME, "modified", JdbcUtils.formatUTC(new Timestamp(currentTime+1L)), "id", 3); db.insert(SINGLE_TABLE_NAME, "modified", JdbcUtils.formatUTC(new Timestamp(currentTime+500L)), "id", 4); db.insert(SINGLE_TABLE_NAME, "modified", JdbcUtils.formatUTC(new Timestamp(currentTime+501L)), "id", 5); verifyPoll(2, "id", Arrays.asList(2, 3), true, false, TOPIC_PREFIX + SINGLE_TABLE_NAME); Thread.sleep(500); verifyPoll(2, "id", Arrays.asList(4, 5), true, false, TOPIC_PREFIX + SINGLE_TABLE_NAME); PowerMock.verifyAll(); }</code><technical_language>Is this leftover of cases changing Date().getTime()</technical_language>

Target:
public void testTimestampWithDelay() throws Exception { expectInitializeNoOffsets(Arrays.asList(SINGLE_TABLE_PARTITION)); PowerMock.replayAll(); db.createTable(SINGLE_TABLE_NAME, "modified", "TIMESTAMP NOT NULL", "id", "INT"); db.insert(SINGLE_TABLE_NAME, "modified", JdbcUtils.formatUTC(new Timestamp(10L)), "id", 1); startTask("modified", null, null, 4L); verifyTimestampFirstPoll(TOPIC_PREFIX + SINGLE_TABLE_NAME); Long currentTime = new Date().getTime(); db.insert(SINGLE_TABLE_NAME, "modified", new Timestamp(currentTime).toString(), "id", 2); db.insert(SINGLE_TABLE_NAME, "modified", new Timestamp(currentTime+1L).toString(), "id", 3); db.insert(SINGLE_TABLE_NAME, "modified", new Timestamp(currentTime+500L).toString(), "id", 4); db.insert(SINGLE_TABLE_NAME, "modified", new Timestamp(currentTime+501L).toString(), "id", 5); verifyPoll(2, "id", Arrays.asList(2, 3), true, false, TOPIC_PREFIX + SINGLE_TABLE_NAME); Thread.sleep(500); verifyPoll(2, "id", Arrays.asList(4, 5), true, false, TOPIC_PREFIX + SINGLE_TABLE_NAME); PowerMock.verifyAll(); }
Source:
<code>protected void executeCommand() { setVds(null); if (getVds() == null) { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it doesn't exist anymore.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); return; } VdsValidator validator = new VdsValidator(getVds()); boolean shouldBeFenced = validator.shouldVdsBeFenced(); if (shouldBeFenced) { getParameters().setParentCommand(VdcActionType.VdsNotRespondingTreatment); ExecutionContext ec = (ExecutionContext) ObjectUtils.clone(this.getExecutionContext()); <START> if (ec != null) <END> ec.setJob(this.getExecutionContext().getJob()); super.executeCommand(); if (ec != null) this.setExecutionContext(ec); } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", getVdsName(), getVdsId()); } getReturnValue().setSucceeded(shouldBeFenced); }</code><technical_language>please add braces ("{" & "}")</technical_language>

Target:
protected void executeCommand() { setVds(null); if (getVds() == null) { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it doesn't exist anymore.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); return; } VdsValidator validator = new VdsValidator(getVds()); boolean shouldBeFenced = validator.shouldVdsBeFenced(); if (shouldBeFenced) { getParameters().setParentCommand(VdcActionType.VdsNotRespondingTreatment); ExecutionContext ec = (ExecutionContext) ObjectUtils.clone(this.getExecutionContext()); if (ec != null) { ec.setJob(this.getExecutionContext().getJob()); } super.executeCommand(); if (ec != null) { this.setExecutionContext(ec); } } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", getVdsName(), getVdsId()); } getReturnValue().setSucceeded(shouldBeFenced); }
Source:
<code>public Queue<Selectable> createFlowTriggerEventQueue(RepairEvent event) { Set<String> terminatedOrRemovedInstanceIdsSet = new HashSet<>(event.getInstanceIds()); terminatedOrRemovedInstanceIdsSet.addAll(event.getAdditionalTermiantedInstanceIds()); <START> List<String> terminatedOrRemovedInstanceId = terminatedOrRemovedInstanceIdsSet.stream().collect(Collectors.toList()); <END> Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>(); flowEventChain.add(new DownscaleEvent(DownscaleFlowEvent.DOWNSCALE_EVENT.event(), event.getResourceId(), terminatedOrRemovedInstanceId, event.getInstanceCountByGroup(), Boolean.TRUE, event.getOperationId(), event.accepted())); flowEventChain.add(new UpscaleEvent(UpscaleFlowEvent.UPSCALE_EVENT.event(), event.getResourceId(), event.getInstanceCountByGroup(), Boolean.TRUE, event.getOperationId())); return flowEventChain; }</code><technical_language>nit: plural naming list</technical_language>

Target:
public Queue<Selectable> createFlowTriggerEventQueue(RepairEvent event) { Set<String> terminatedOrRemovedInstanceIdsSet = new HashSet<>(event.getInstanceIds()); terminatedOrRemovedInstanceIdsSet.addAll(event.getAdditionalTermiantedInstanceIds()); List<String> terminatedOrRemovedInstanceIds = terminatedOrRemovedInstanceIdsSet.stream().collect(Collectors.toList()); Queue<Selectable> flowEventChain = new ConcurrentLinkedQueue<>(); flowEventChain.add(new DownscaleEvent(DownscaleFlowEvent.DOWNSCALE_EVENT.event(), event.getResourceId(), terminatedOrRemovedInstanceIds, event.getInstanceCountByGroup(), Boolean.TRUE, event.getOperationId(), event.accepted())); flowEventChain.add(new UpscaleEvent(UpscaleFlowEvent.UPSCALE_EVENT.event(), event.getResourceId(), event.getInstanceCountByGroup(), Boolean.TRUE, event.getOperationId())); return flowEventChain; }
Source:
<code>protected void startup(BundleContext bundleContext) { final IConfigurationElement[] controls = Platform.getExtensionRegistry().getConfigurationElementsFor( "org.eclipse.emf.ecp.view.template"); if (controls.length == 0) { return; } if (controls.length > 1) { if (ViewModelUtil.isDebugMode()) { <START> throw new IllegalArgumentException("Multiple templae models found. Only one is supported."); END> } reportService.report(new AbstractReport( "Multiple template models have been found. Only one of them will be used. Fix your project setup.")); } final IConfigurationElement e = controls[0]; final String xmiResource = e.getAttribute("xmi"); final Resource resource = loadResource(URI.createURI("platform:/plugin/" + e.getContributor().getName() + "/" + xmiResource)); if (resource == null) { return; } if (resource.getContents().size() != 1) { return; } registeredTemplate = (VTViewTemplate) resource.getContents().get(0); }</code><technical_language>template is misspelled</technical_language>

Target:
protected void startup(BundleContext bundleContext) { final IConfigurationElement[] controls = Platform.getExtensionRegistry().getConfigurationElementsFor( "org.eclipse.emf.ecp.view.template"); if (controls.length == 0) { return; } if (controls.length > 1) { if (ViewModelUtil.isDebugMode()) { throw new IllegalArgumentException("Multiple template models found. Only one is supported."); } reportService.report(new AbstractReport( "Multiple template models have been found. Only one of them will be used. Fix your project setup.")); } final IConfigurationElement e = controls[0]; final String xmiResource = e.getAttribute("xmi"); final Resource resource = loadResource(URI.createURI("platform:/plugin/" + e.getContributor().getName() + "/" + xmiResource)); if (resource == null) { return; } if (resource.getContents().size() != 1) { return; } registeredTemplate = (VTViewTemplate) resource.getContents().get(0); }
Source:
<code>public JSONSerialization withCallback(final String callbackName) { return new GsonJSONSerialization(response, extractor, initializer, builder, serializee) { @Override protected SerializerBuilder getSerializer() { try { return new GsonSerializer(builder, response.getWriter(), extractor, initializer, serializee) { @Override protected void write(Writer writer, String json) throws IOException { writer.write(callbackName + "(" + json + ")"); <START> } <END> }; } catch (IOException e) { throw new ResultException("Unable to serialize data", e); } } }; }</code><technical_language>override serialize() method, call: java @Override public void serialize() { writer.append(callbackName).append("("); super.serialize(); writer.append(")"); }</technical_language>

Target:
public JSONSerialization withCallback(final String callbackName) { return new GsonJSONSerialization(response, extractor, initializer, builder, serializee) { @Override protected SerializerBuilder getSerializer() { try { return new GsonSerializer(builder, response.getWriter(), extractor, initializer, serializee) { @Override public void serialize() { try { response.getWriter().append(callbackName).append("("); super.serialize(); response.getWriter().append(")"); response.getWriter().flush(); } catch (IOException e) { throw new ResultException("Unable to serialize data", e); } } }; } catch (IOException e) { throw new ResultException("Unable to serialize data", e); } } }; }
Source:
<code>private long resolveWallTime(String configuredWalltime, String errorMessage) { String confallTime = configuredWalltime; if (confallTime == null || confallTime.isEmpty() || confallTime.trim().equals("0")) { return 0; } <START> long resolvedWallTime = Tools.formatDate(confallTime); <END> if (resolvedWallTime == 0) { logger.warn(getId(), errorMessage); return 0; } return resolvedWallTime; }</code><technical_language>rename resolvedWallTime resolvedWalltime</technical_language>

Target:
private long resolveWallTime(String configuredWalltime, String errorMessage) { if (configuredWalltime == null || configuredWalltime.isEmpty() || configuredWalltime.trim().equals("0")) { return 0; } long resolvedWalltime = Tools.formatDate(configuredWalltime); if (resolvedWalltime == 0) { logger.warn(getId(), errorMessage); return 0; } return resolvedWalltime; }
Source:
<code>@Test public void testReportSample() { Policy p; ArrayList<Notice> notices = new ArrayList<>(); p = parseWithNotices("default-src 'report-sample'", notices); assertEquals(1, p.getDirectives().size()); assertEquals(0, notices.size()); notices.clear(); p = parseWithNotices("script-src 'report-sample' 'report-sample'", notices); assertEquals(1, p.getDirectives().size()); assertEquals("script-src 'report-sample'", p.getDirectiveByType(ScriptSrcDirective.class).show()); assertEquals(0, notices.size()); notices.clear(); p = parseWithNotices("style-src 'report-sample' 'unsafe-hashed-attributes' 'report-sample' 'nonce-123'", notices); assertEquals(1, p.getDirectives().size()); assertEquals(2, notices.size()); <START> assertEquals("Invalid base64-value (should be multiple of 4 bytes: 3).", notices.get(0).message); <END> notices.clear(); p = parseWithNotices("default-src 'strict-dynamic' 'report-sample'", notices); assertEquals(1, p.getDirectives().size()); assertEquals(0, notices.size()); notices.clear(); p = parseWithNotices("img-src 'report-sample'", notices); assertEquals(1, p.getDirectives().size()); assertEquals(0, notices.size()); }</code><technical_language>notices asserting is unrelated report-sample. fix nonce assert remaining notice</technical_language>

Target:
@Test public void testReportSample() { Policy p; ArrayList<Notice> notices = new ArrayList<>(); p = parseWithNotices("default-src 'report-sample'", notices); assertEquals(1, p.getDirectives().size()); assertEquals(0, notices.size()); notices.clear(); p = parseWithNotices("script-src 'report-sample' 'report-sample'", notices); assertEquals(1, p.getDirectives().size()); assertEquals("script-src 'report-sample'", p.getDirectiveByType(ScriptSrcDirective.class).show()); assertEquals(0, notices.size()); notices.clear(); p = parseWithNotices("default-src 'strict-dynamic' 'report-sample'", notices); assertEquals(1, p.getDirectives().size()); assertEquals(0, notices.size()); notices.clear(); p = parseWithNotices("img-src 'report-sample'", notices); assertEquals(1, p.getDirectives().size()); assertEquals(0, notices.size()); }
Source:
<code>public Outer.Validator deserialize( JsonElement jsonElement, Type type, JsonDeserializationContext context) { JsonObject object = jsonElement.getAsJsonObject(); <START> String validatorName = context.deserialize(object.get(VALIDATOR_PROPERTY), String.class); <END> Outer.Validator result = null; JsonElement validators = object.get(VALIDATORS_PROPERTY); if (validators != null) { result = new Outer.ValidatorCollection( validatorName, context.deserialize( validators, new TypeToken<List<Outer.Validator>>() {}.getType())); } if (result == null) { result = new Outer.Validator( validatorName, context.deserialize(object.get("arguments"), List.class)); } return result; }</code><technical_language>cache object.get(VALIDATOR_PROPERTY) reuse instead of extracting entry twice</technical_language>

Target:
public Outer.Validator deserialize( JsonElement jsonElement, Type type, JsonDeserializationContext context) { JsonObject object = jsonElement.getAsJsonObject(); String validatorName = context.deserialize(object.get(SINGLE_VALIDATOR_PROPERTY), String.class); Outer.Validator result = null; JsonElement validators = object.get(VALIDATORS_PROPERTY); if (validators != null) { result = new Outer.ValidatorCollection( validatorName, context.deserialize(validators, OUTER_VALIDATOR_TYPE)); } if (result == null) { result = new Outer.Validator( validatorName, context.deserialize(object.get("arguments"), LIST_STRING)); } return result; }
Source:
<code>private static Integer getNumberOfShards(Properties properties) { String nShards = properties.getProperty(NUMBER_OF_SHARDS_PROP); if (nShards == null) { <START> nShards = properties.getProperty(SHARDING_STRATEGY_PROP + "." + NUMBER_OF_SHARDS_PROP); <END> } return nShards != null ? Integer.valueOf(nShards) : null; }</code><technical_language>passing default number of shard a 2nd arg getProperty ensure getNumberOfShards a non-null return, return int</technical_language>

Target:
private static int getNumberOfShards(Properties properties) { String nShards = properties.getProperty(NUMBER_OF_SHARDS_PROP); if (nShards != null) return Integer.valueOf(nShards); String value = properties.getProperty(SHARDING_STRATEGY_PROP + "." + NUMBER_OF_SHARDS_PROP); return value != null ? Integer.valueOf(value) : DEFAULT_NUMBER_SHARDS; }
Source:
<code>public boolean isSrmResource() { return <START> resource.getContents().stream().filter(DRepresentation.class::isInstance).findFirst().isPresent(); <END> }</code><technical_language>this lambda alway return true if representation is present in resource. is case in aird resource. get element in getContents() next check is element is instance of DRepresentation</technical_language>

Target:
public boolean isSrmResource() { return Optional.ofNullable(resource.getContents().get(0)).filter(DRepresentation.class::isInstance).isPresent(); }
Source:
<code>public DatabaseRow poll() throws SQLException { if (!_initialized) { throw new DatastreamRuntimeException("call start before calling poll for records"); } if (_queryResultSet == null) { executeFirstChunkedQuery(); _queryStmt = _connection.prepareStatement(_chunkedQuery); _queryStmt.setFetchSize(_fetchSize); _queryStmt.setQueryTimeout(_queryTimeoutSecs); } DatabaseRow row = null; while (row == null) { if (!_queryResultSet.next()) { if (numRowsInResult < _chunkSize) { return null; } <START> numRowsInResult = 0; <END> prepareChunkedQuery(); executeChunkedQuery(); if (!_queryResultSet.next()) { return null; } } row = getNextRow(); } return row; }</code><technical_language>wondering: considered adding some prefetching, eg. number of msgs fell a watermark, initiate a fetch in another thread record processing IO is overlapped? If jdbc this ignore this one</technical_language>

Target:
public DatabaseRow poll() throws SQLException { if (!_initialized) { throw new DatastreamRuntimeException("call start before calling poll for records"); } if (_queryResultSet == null) { executeFirstChunkedQuery(); _queryStmt = _connection.prepareStatement(_chunkedQuery); _queryStmt.setFetchSize(_fetchSize); _queryStmt.setQueryTimeout(_queryTimeoutSecs); } DatabaseRow row = null; while (row == null) { if (!_queryResultSet.next()) { if (_numRowsInResult < _rowCountLimit) { return null; } _numRowsInResult = 0; prepareChunkedQuery(); executeChunkedQuery(_queryStmt); if (!_queryResultSet.next()) { return null; } } row = getNextRow(); } return row; }
Source:
<code>void account_credentials_are_invalid_for_a_live_gateway_account(String type) { var gatewayAccount = aGatewayAccountEntity().withType(GatewayAccountEntity.Type.fromString(type)).build(); <START> var flexCredentials = new Worldpay3dsFlexCredentials("53f0917f101a4428b69d5fb0", "57992a087a0c4849895ab8a2","4cabd5d2-0133-4e82-b0e5-2024dbeddaa9"); <END> when(response.getStatus()).thenReturn(HttpStatus.SC_BAD_REQUEST); when(client.target(threeDsFlexDdcUrls.get(type))).thenReturn(webTarget); when(worldpay3dsFlexJwtService.generateDdcToken(eq(GatewayAccount.valueOf(gatewayAccount)), eq(flexCredentials), any(ZonedDateTime.class))).thenReturn(DDC_TOKEN); var expectedFormData = new MultivaluedHashMap<String, String>(){{add("JWT", DDC_TOKEN);}}; when(invocationBuilder.post(argThat(new EntityMatcher(Entity.form(expectedFormData))))).thenReturn(response); assertFalse(service.validateCredentials(gatewayAccount, flexCredentials)); }</code><technical_language>extracted named variables indicating bad</technical_language>

Target:
void account_credentials_are_invalid_for_a_live_gateway_account(String type) { var gatewayAccount = aGatewayAccountEntity().withType(GatewayAccountEntity.Type.fromString(type)).build(); var invalidIssuer = "54i0917n10va4428b69l5id0"; var invalidOrgUnitId = "57992i087n0v4849895alid2"; var invalidJwtMacKey = "4inva5l2-0133-4i82-d0e5-2024dbeddaa9"; var flexCredentials = new Worldpay3dsFlexCredentials(invalidIssuer, invalidOrgUnitId, invalidJwtMacKey); when(response.getStatus()).thenReturn(HttpStatus.SC_BAD_REQUEST); when(client.target(threeDsFlexDdcUrls.get(type))).thenReturn(webTarget); when(worldpay3dsFlexJwtService.generateDdcToken(eq(GatewayAccount.valueOf(gatewayAccount)), eq(flexCredentials), any(ZonedDateTime.class))).thenReturn(DDC_TOKEN); var expectedFormData = new MultivaluedHashMap<String, String>(){{add("JWT", DDC_TOKEN);}}; when(invocationBuilder.post(argThat(new EntityMatcher(Entity.form(expectedFormData))))).thenReturn(response); assertFalse(service.validateCredentials(gatewayAccount, flexCredentials)); }
Source:
<code>public Multimap<String, String> openRevisions(int start, int end) { Misc.checkArgument(start >= 0, "Start position must be greater or equal to zero."); Misc.checkArgument(end > start, "End position must be greater than start."); <START> Misc.checkArgument(end <= this.size(), "End position must be smaller than changes feed size."); <END> Multimap<String, String> openRevisions = HashMultimap.create(); for(int i = start; i < end ; i ++) { ChangesResult.Row row = this.getResults().get(i); List<ChangesResult.Row.Rev> revisions = row.getChanges(); Set<String> openRevs = new HashSet<String>(revisions.size()); for(ChangesResult.Row.Rev rev : revisions) { openRevs.add(rev.getRev()); } openRevisions.putAll(row.getId(), openRevs); } return openRevisions; }</code><technical_language>need correct this message too, end position equal changes feed size</technical_language>

Target:
public Multimap<String, String> openRevisions(int start, int end) { Misc.checkArgument(start >= 0, "Start position must be greater or equal to zero."); Misc.checkArgument(end > start, "End position must be greater than start."); Misc.checkArgument(end <= this.size(), "End position must be less than or equal to the " + "changes feed size."); Multimap<String, String> openRevisions = HashMultimap.create(); for(int i = start; i < end ; i ++) { ChangesResult.Row row = this.getResults().get(i); List<ChangesResult.Row.Rev> revisions = row.getChanges(); Set<String> openRevs = new HashSet<String>(revisions.size()); for(ChangesResult.Row.Rev rev : revisions) { openRevs.add(rev.getRev()); } openRevisions.putAll(row.getId(), openRevs); } return openRevisions; }
Source:
<code>public PriceSelectionBuilder plusLocaleProjection(@Nullable final String localeProjection) { <START> this.localeProjection = new ArrayList<>(); <END> this.localeProjection.add(localeProjection); return this; }</code><technical_language>java if (this.localeProjection == null) { this.localeProjection = new ArrayList<>(); }</technical_language>

Target:
public PriceSelectionBuilder plusLocaleProjection(@Nullable final String localeProjection) { if (this.localeProjection == null) { this.localeProjection = new ArrayList<>(); } this.localeProjection.add(localeProjection); return this; }
Source:
<code>public void testSpecificBuildSelector() throws Exception { WorkflowJob copier = createWorkflow( "copier", <START> "step(copyArtifacts(projectName: 'copiee', selector: specific(\"${build('copiee').number}\")));" <END> + "echo readFile('artifact.txt');" ); createWorkflow( "copiee", "writeFile text: 'foobar', file: 'artifact.txt';" + "archive includes: 'artifact.txt';" ); jenkinsRule.assertLogContains("foobar", jenkinsRule.assertBuildStatusSuccess(copier.scheduleBuild2(0))); }</code><technical_language>groovy selector: specific(build('copiee').id) (BTW SpecificBuildSelector Job.getBuild(String) for arguments numbers.)</technical_language>

Target:
public void testSpecificBuildSelector() throws Exception { WorkflowJob copier = jenkinsRule.createWorkflow( "copier", "copyArtifacts(projectName: 'copiee', selector: specific(\"${build('copiee').number}\"));" + "echo readFile('artifact.txt');" ); jenkinsRule.createWorkflow( "copiee", "writeFile text: 'foobar', file: 'artifact.txt';" + "archive includes: 'artifact.txt';" ); jenkinsRule.assertLogContains("foobar", jenkinsRule.assertBuildStatusSuccess(copier.scheduleBuild2(0))); }
Source:
<code>public List<MCLivingEntity.MCEffect> potions(CArray ea, Target t) { List<MCLivingEntity.MCEffect> ret = new ArrayList<MCLivingEntity.MCEffect>(); for (String key : ea.stringKeySet()) { if (ea.get(key, t) instanceof CArray) { CArray effect = (CArray) ea.get(key, t); int potionID = 0, strength = 0, seconds = 30; boolean ambient = false; boolean particles = true; if (effect.containsKey("id")) { potionID = Static.getInt32(effect.get("id", t), t); } else { throw new Exceptions.FormatException("No potion ID was given at index " + key, t); } if (effect.containsKey("strength")) { strength = Static.getInt32(effect.get("strength", t), t); } if (effect.containsKey("seconds")) { seconds = Static.getInt32(effect.get("seconds", t), t); } if (effect.containsKey("ambient")) { ambient = Static.getBoolean(effect.get("ambient", t)); } if (effect.containsKey("particles")) { particles = Static.getBoolean(effect.get("particles", t)); } if (particles) { ret.add(new MCLivingEntity.MCEffect(potionID, strength, seconds, ambient)); } else { ret.add(new MCLivingEntity.MCEffect(potionID, strength, seconds, ambient, particles)); <START> } <END> } else { throw new Exceptions.FormatException("Expected a potion array at index" + key, t); } } return ret; }</code><technical_language>This if statement is unnecessary, other places is done</technical_language>

Target:
public List<MCLivingEntity.MCEffect> potions(CArray ea, Target t) { List<MCLivingEntity.MCEffect> ret = new ArrayList<MCLivingEntity.MCEffect>(); for (String key : ea.stringKeySet()) { if (ea.get(key, t) instanceof CArray) { CArray effect = (CArray) ea.get(key, t); int potionID = 0, strength = 0, seconds = 30; boolean ambient = false; boolean particles = true; if (effect.containsKey("id")) { potionID = Static.getInt32(effect.get("id", t), t); } else { throw new Exceptions.FormatException("No potion ID was given at index " + key, t); } if (effect.containsKey("strength")) { strength = Static.getInt32(effect.get("strength", t), t); } if (effect.containsKey("seconds")) { seconds = Static.getInt32(effect.get("seconds", t), t); } if (effect.containsKey("ambient")) { ambient = Static.getBoolean(effect.get("ambient", t)); } if (effect.containsKey("particles")) { particles = Static.getBoolean(effect.get("particles", t)); } ret.add(new MCLivingEntity.MCEffect(potionID, strength, seconds, ambient, particles)); } else { throw new Exceptions.FormatException("Expected a potion array at index" + key, t); } } return ret; }
Source:
<code>public void updateSSH(SSH ssh) throws DAOException { try { PreparedStatement ps = connection.prepareStatement("UPDATE " + "VIPSSHAccounts " + "SET sshUser=?, sshHost=?,transfertType=?, sshDir=?, sshPort=?, auth_failed='0' " + "WHERE email=? AND LFCDir=?"); ps.setString(1, ssh.getUser()); ps.setString(2, ssh.getHost()); ps.setString(3, ssh.getTransfertType()); ps.setString(4, ssh.getDirectory()); ps.setString(5, ssh.getPort()); ps.setString(6, ssh.getEmail()); try { ps.setString(7, DataManagerBusiness.generateLFCDir(ssh.getName(),ssh.getEmail())); } catch (DataManagerException ex) { logger.error(ex); <START> throw new DAOException(ex); <END> } catch (BusinessException ex) { throw new DAOException(ex); } ps.executeUpdate(); ps.close(); } catch (SQLException ex) { logger.error(ex); throw new DAOException(ex); } }</code><technical_language>Missing interface for: - deleteFilesFromSource - theEarliestNextSynchronistation - numberSynchronizationFailed</technical_language>

Target:
public void updateSSH(SSH ssh) throws DAOException { try { PreparedStatement ps = connection.prepareStatement("UPDATE " + "VIPSSHAccounts " + "SET sshUser=?, sshHost=?, transfertType=?, sshDir=?, sshPort=?, auth_failed='0', numberSynchronizationFailed=?, deleteFilesFromSource=? " + "WHERE email=? AND LFCDir=?"); ps.setString(1, ssh.getUser()); ps.setString(2, ssh.getHost()); ps.setString(3, ssh.getTransfertType().toString()); ps.setString(4, ssh.getDirectory()); ps.setInt(5, ssh.getPort()); ps.setLong(6, ssh.getNumberSynchronizationFailes()); ps.setBoolean(7, ssh.isDeleteFilesFromSource()); ps.setString(8, ssh.getEmail()); try { ps.setString(9, DataManagerBusiness.generateLFCDir(ssh.getName(), ssh.getEmail())); } catch (DataManagerException ex) { logger.error(ex); throw new DAOException(ex); } catch (BusinessException ex) { throw new DAOException(ex); } ps.executeUpdate(); ps.close(); } catch (SQLException ex) { logger.error(ex); throw new DAOException(ex); } }
Source:
<code>public String getNumericFunctions() throws SQLException { checkClosed(); <START> return "ABS,BITAND,BITNOT,BITOR,BIT_SHIFT_LEFT,BIT_SHIFT_RIGHT,BITXOR,CEILING,COS,COT,CSC,DEGREES,EXP,FLOOR,LN,LOG,LOG10,PI,POWER,RADIANS,ROUND,SEC,SIN,SQRT,TAN, GET_UNIQUE_ID"; <END> }</code><technical_language>rest spaces comma, need consistent</technical_language>

Target:
public String getNumericFunctions() throws SQLException { checkClosed(); return "ABS,BITAND,BITNOT,BITOR,BIT_SHIFT_LEFT,BIT_SHIFT_RIGHT,BITXOR,CEILING,COS,COT,CSC,DEGREES,EXP,FLOOR,GET_UNIQUE_ID,LN,LOG,LOG10,PI,POWER,RADIANS,ROUND,SEC,SIN,SQRT,TAN"; }
Source:
<code>public Set<OrderGroup> getOrderGroups() { if (orderGroups == null) { <START> orderGroups = new LinkedHashSet<OrderGroup>(); <END> } return orderGroups; }</code><technical_language>Is ordering important HashSet</technical_language>

Target:
public List<OrderGroup> getOrderGroups() { Map<String, OrderGroup> orderGroups = new HashMap<String, OrderGroup>(); for (Order order : orders) { if (order.getOrderGroup() != null) { if (null == orderGroups.get(order.getOrderGroup().getUuid())) { orderGroups.put(order.getOrderGroup().getUuid(), order.getOrderGroup()); } order.getOrderGroup().addOrder(order, null); } } List<OrderGroup> orderGroupList = new ArrayList<OrderGroup>(); orderGroupList.addAll(orderGroups.values()); return orderGroupList; }
Source:
<code>public static CepAction doNothingAction() { <START> List<Object> list = new ArrayList<>(); <END> list.add("dummy"); return new CepAction(CepActionType.DO_NOTHING, null, list); }</code><technical_language>final</technical_language>

Target:
public static CepAction doNothingAction() { final List<Object> list = new ArrayList<>(); list.add("dummy"); return new CepAction(CepActionType.DO_NOTHING, null, list); }
Source:
<code>private Map<IMember, Set<IMember>> getMatchingMembersMapping(final IType initial) throws JavaModelException { final Map<IMember, Set<IMember>> result= new HashMap<>(); final IMember[] members= getCreatedDestinationMembers(); for (int i= 0; i < members.length; i++) { final IMember member= members[i]; if (member instanceof IMethod) { final IMethod method= (IMethod) member; final IMethod found= MemberCheckUtil.findMethod(method, initial.getMethods()); if (found != null) addMatchingMember(result, method, found); } else if (member instanceof IField) { final IField field= (IField) member; final IField found= initial.getField(field.getElementName()); if (found.exists()) { <START> if(field.getTypeSignature().equals(found.getTypeSignature())) { <END> addMatchingMember(result, field, found); } } } else if (member instanceof IType) { final IType type= (IType) member; final IType found= initial.getType(type.getElementName()); if (found.exists()) addMatchingMember(result, type, found); } else Assert.isTrue(false); } return result; }</code><technical_language>I merge this 'if' &&</technical_language>

Target:
private Map<IMember, Set<IMember>> getMatchingMembersMapping(final IType initial) throws JavaModelException { final Map<IMember, Set<IMember>> result= new HashMap<>(); final IMember[] members= getCreatedDestinationMembers(); for (int i= 0; i < members.length; i++) { final IMember member= members[i]; if (member instanceof IMethod) { final IMethod method= (IMethod) member; final IMethod found= MemberCheckUtil.findMethod(method, initial.getMethods()); if (found != null) addMatchingMember(result, method, found); } else if (member instanceof IField) { final IField field= (IField) member; final IField found= initial.getField(field.getElementName()); if (found.exists() && field.getTypeSignature().equals(found.getTypeSignature())) { addMatchingMember(result, field, found); } } else if (member instanceof IType) { final IType type= (IType) member; final IType found= initial.getType(type.getElementName()); if (found.exists()) addMatchingMember(result, type, found); } else Assert.isTrue(false); } return result; }
Source:
<code>public String[] getStepDescriptions() { List<String> result= new ArrayList<>(); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_IMPORTS)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedImport_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_METHODS)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedMethod_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_CONSTRUCTORS)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedConstructor_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_TYPES)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedType_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedField_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_LOCAL_VARIABLES)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedVariable_description); return result.toArray(new <START> String[result.size()]); <END> }</code><technical_language>gerrits prefer a variant recently</technical_language>

Target:
public String[] getStepDescriptions() { List<String> result= new ArrayList<>(); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_IMPORTS)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedImport_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_METHODS)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedMethod_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_CONSTRUCTORS)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedConstructor_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_TYPES)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedType_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedField_description); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_LOCAL_VARIABLES)) result.add(MultiFixMessages.UnusedCodeMultiFix_RemoveUnusedVariable_description); return result.toArray(new String[0]); }
Source:
<code>SystemProperties(final Map<String, Object> map) { super(map); this.offset = getSystemProperty(OFFSET_ANNOTATION_NAME.getValue()); this.partitionKey = getSystemProperty(PARTITION_KEY_ANNOTATION_NAME.getValue()); final Date enqueuedTimeValue = getSystemProperty(ENQUEUED_TIME_UTC_ANNOTATION_NAME.getValue()); <START> this.enqueuedTime = enqueuedTimeValue != null ? enqueuedTimeValue.toInstant() : null; <END> final Long sequenceNumber = getSystemProperty(SEQUENCE_NUMBER_ANNOTATION_NAME.getValue()); if (sequenceNumber == null) { throw new IllegalStateException(String.format(Locale.US, "sequenceNumber: %s should always be in map.", SEQUENCE_NUMBER_ANNOTATION_NAME.getValue())); } this.sequenceNumber = sequenceNumber; remove(OFFSET_ANNOTATION_NAME.getValue()); remove(PARTITION_KEY_ANNOTATION_NAME.getValue()); remove(ENQUEUED_TIME_UTC_ANNOTATION_NAME.getValue()); remove(SEQUENCE_NUMBER_ANNOTATION_NAME.getValue()); }</code><technical_language>enqueuedTimeValue null sequence number? If is, result in IllegalStateException</technical_language>

Target:
SystemProperties(final Map<String, Object> map) { super(map); this.partitionKey = removeSystemProperty(PARTITION_KEY_ANNOTATION_NAME.getValue()); final String offset = removeSystemProperty(OFFSET_ANNOTATION_NAME.getValue()); if (offset == null) { throw new IllegalStateException(String.format(Locale.US, "offset: %s should always be in map.", OFFSET_ANNOTATION_NAME.getValue())); } this.offset = Long.valueOf(offset); final Date enqueuedTimeValue = removeSystemProperty(ENQUEUED_TIME_UTC_ANNOTATION_NAME.getValue()); if (enqueuedTimeValue == null) { throw new IllegalStateException(String.format(Locale.US, "enqueuedTime: %s should always be in map.", ENQUEUED_TIME_UTC_ANNOTATION_NAME.getValue())); } this.enqueuedTime = enqueuedTimeValue.toInstant(); final Long sequenceNumber = removeSystemProperty(SEQUENCE_NUMBER_ANNOTATION_NAME.getValue()); if (sequenceNumber == null) { throw new IllegalStateException(String.format(Locale.US, "sequenceNumber: %s should always be in map.", SEQUENCE_NUMBER_ANNOTATION_NAME.getValue())); } this.sequenceNumber = sequenceNumber; }
Source:
<code>public void testContigNotFoundInRef() throws IOException { final File CRAMFile = new File("testdata/htsjdk/samtools/cram/test.cram"); final File refFile = new File("testdata/htsjdk/samtools/cram/test.fa"); final ReferenceSource refSource = new ReferenceSource(refFile); final CRAMIterator iterator = new CRAMIterator(new FileInputStream(CRAMFile), refSource); try { while (iterator.hasNext()) { iterator.next(); } } catch (RuntimeEOFException e) { <START> Assert.assertEquals(e.getCause().getClass(), CRAMException.class); <END> } }</code><technical_language>need track of exception all, assert end of this test (since built-in expectedExceptions due wrapping)</technical_language>

Target:
public void testContigNotFoundInRef() throws IOException { boolean sawException = false; final File CRAMFile = new File("testdata/htsjdk/samtools/cram/CRAMException/testContigNotInRef.cram"); final File refFile = new File("testdata/htsjdk/samtools/cram/CRAMException/testContigNotInRef.fa"); final ReferenceSource refSource = new ReferenceSource(refFile); final CRAMIterator iterator = new CRAMIterator(new FileInputStream(CRAMFile), refSource); try { while (iterator.hasNext()) { iterator.next(); } } catch (RuntimeEOFException e) { Assert.assertEquals(e.getCause().getClass(), CRAMException.class); sawException = true; } if (!sawException) {Assert.fail("Expected an exception to occur, none found");} }
Source:
<code>@NotNull @Override public Iterator<R> iterator(Map<String, Object> filter) { if (filter == null) filter = Collections.emptyMap(); Iterator<D> dataIter = dataSupplier.apply(filter).iterator(); <START> return new Iterator<R>() { <END> @Override public boolean hasNext() { return dataIter.hasNext(); } @Override public R next() { return rowFunc.apply(dataIter.next()); } }; }</code><technical_language>rewrite regular F.iterator F.iterator(dataSupplier.apply(filter), rowFunc::apply, true);</technical_language>

Target:
@NotNull @Override public Iterator<R> iterator(Map<String, Object> filter) { if (filter == null) filter = Collections.emptyMap(); return F.iterator(dataSupplier.apply(filter), rowFunc::apply, true); }
Source:
<code><START> public static <T> Flowable<T> fromStream(@NonNull Stream<T> stream) { <END> ObjectHelper.requireNonNull(stream, "stream is null"); return RxJavaPlugins.onAssembly(new FlowableFromStream<>(stream)); }</code><technical_language>+NonNull for return type</technical_language>

Target:
public static <T> Flowable<@NonNull T> fromStream(@NonNull Stream<T> stream) { ObjectHelper.requireNonNull(stream, "stream is null"); return RxJavaPlugins.onAssembly(new FlowableFromStream<>(stream)); }
Source:
<code>private void assertInvalidGeometryCollectionUnion(String validWkt) { <START> assertInvalidFunction(format("ST_ASText(ST_Union(ST_GeometryFromText('%s'), ST_GeometryFromText('%s')))", validWkt, "GEOMETRYCOLLECTION(POINT(2 3))"), "ST_Union only applies to POINT or MULTI_POINT or LINE_STRING or MULTI_LINE_STRING or POLYGON or MULTI_POLYGON. Input type is: GEOMETRY_COLLECTION"); <END> assertInvalidFunction(format("ST_ASText(ST_Union(ST_GeometryFromText('%s'), ST_GeometryFromText('%s')))", "GEOMETRYCOLLECTION(POINT(2 3))", validWkt), "ST_Union only applies to POINT or MULTI_POINT or LINE_STRING or MULTI_LINE_STRING or POLYGON or MULTI_POLYGON. Input type is: GEOMETRY_COLLECTION"); }</code><technical_language>ST_Text placeholder for geometry collection necessary; simplify assertInvalidFunction(format("ST_Union(ST_GeometryFromText('%s'), ST_GeometryFromText('GEOMETRYCOLLECTION (POINT(2 3))'))", validWkt), "ST_Union applies POINT MULTI_POINT LINE_STRING MULTI_LINE_STRING POLYGON MULTI_POLYGON. Input type is: GEOMETRY_COLLECTION");</technical_language>

Target:
private void assertInvalidGeometryCollectionUnion(String validWkt) { assertInvalidFunction(format("ST_Union(ST_GeometryFromText('%s'), ST_GeometryFromText('GEOMETRYCOLLECTION (POINT(2 3))'))", validWkt), "ST_Union only applies to POINT or MULTI_POINT or LINE_STRING or MULTI_LINE_STRING or POLYGON or MULTI_POLYGON. Input type is: GEOMETRY_COLLECTION"); assertInvalidFunction(format("ST_Union(ST_GeometryFromText('GEOMETRYCOLLECTION (POINT(2 3))'), ST_GeometryFromText('%s'))", validWkt), "ST_Union only applies to POINT or MULTI_POINT or LINE_STRING or MULTI_LINE_STRING or POLYGON or MULTI_POLYGON. Input type is: GEOMETRY_COLLECTION"); }
Source:
<code>private void scanQrCode() { Intent scanQrCode = new Intent(getActivity(), ImportKeysProxyActivity.class); scanQrCode.setAction(ImportKeysProxyActivity.ACTION_SCAN_IMPORT); <START> scanQrCode.putExtra(ImportKeysProxyActivity.EXTRA_IS_INTERNAL, true); <END> startActivityForResult(scanQrCode, REQUEST_ACTION); }</code><technical_language>this removed</technical_language>

Target:
private void scanQrCode() { Intent scanQrCode = new Intent(getActivity(), ImportKeysProxyActivity.class); scanQrCode.setAction(ImportKeysProxyActivity.ACTION_SCAN_IMPORT); startActivityForResult(scanQrCode, REQUEST_ACTION); }
Source:
<code>private void setValueForTextInput(Driver driver, WebElement element, String text) { if (text == null || text.isEmpty()) { element.clear(); } else if (driver.config().fastSetValue()) { String error = setValueByJs(driver, element, text); <START> if (error != null) throw new InvalidStateException(driver, error); <END> else { events.fireEvent(driver, element, "keydown", "keypress", "input", "keyup"); } } else { element.clear(); element.sendKeys(text); } }</code><technical_language>I guess delete this part. set JavaScript, need trigger change other events. skipped set sendKeys() (because browser automatically anyway)</technical_language>

Target:
private void setValueForTextInput(Driver driver, WebElement element, String text) { if (text == null || text.isEmpty()) { element.clear(); } else if (driver.config().fastSetValue()) { String error = setValueByJs(driver, element, text); if (error != null) throw new InvalidStateException(driver, error); else { events.fireEvent(driver, element, "keydown", "keypress", "input", "keyup", "change"); } } else { element.clear(); element.sendKeys(text); } }
Source:
<code>public ElasticsearchColumnMetadata(String name, Type type, String jsonPath, String jsonType, boolean isList, int ordinalPosition) { super(name, type); <START> this.jsonPath = jsonPath; <END> this.jsonType = jsonType; this.isList = isList; this.ordinalPosition = ordinalPosition; }</code><technical_language>add non-null assertions</technical_language>

Target:
public ElasticsearchColumnMetadata(String name, Type type, String jsonPath, String jsonType, boolean isList, int ordinalPosition) { super(name, type); this.jsonPath = requireNonNull(jsonPath, "jsonPath is null"); this.jsonType = requireNonNull(jsonType, "jsonType is null"); this.isList = isList; this.ordinalPosition = ordinalPosition; }