auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Connection acquireConnection() throws ClassNotFoundException, SQLException { <START> Class.forName("org.apache.ignite.IgniteJdbcThinDriver"); <END> StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append("jdbc:ignite:thin://"); urlBuilder.append(igniteParameters.getHost()); if (igniteParameters.getPort() != null) { urlBuilder.append(":" + igniteParameters.getPort()); } if (igniteParameters.getSchema() != null) { urlBuilder.append("/" + igniteParameters.getSchema()); } if (igniteParameters.getUser() != null) { urlBuilder.append(";" + igniteParameters.getUser()); } if (igniteParameters.getPassword() != null) { urlBuilder.append(";" + igniteParameters.getPassword()); } if (igniteParameters.getAdditionalConfigurations() != null) { urlBuilder.append(igniteParameters.getAdditionalConfigurations()); } return DriverManager.getConnection(urlBuilder.toString()); }</code><technical_language>String constant here, move constant file refer there. Eg:- DRIVER_NAME = org.apache.ignite.IgniteJdbcThinDriver;</technical_language>

Target:
private Connection acquireConnection() throws ClassNotFoundException, SQLException { Class.forName(IgniteBackendConstants.DRIVER_NAME); StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append(IgniteBackendConstants.JDBC_PREFIX); urlBuilder.append(igniteParameters.getHost()); if (igniteParameters.getPort() != null) { urlBuilder.append(":" + igniteParameters.getPort()); } if (igniteParameters.getSchema() != null) { urlBuilder.append("/" + igniteParameters.getSchema()); } if (igniteParameters.getUser() != null) { urlBuilder.append(";" + igniteParameters.getUser()); } if (igniteParameters.getPassword() != null) { urlBuilder.append(";" + igniteParameters.getPassword()); } if (igniteParameters.getAdditionalConfigurations() != null) { urlBuilder.append(igniteParameters.getAdditionalConfigurations()); } return DriverManager.getConnection(urlBuilder.toString()); }
Source:
<code>public void broadcastUpdateNotebookJobInfo(long lastUpdateUnixTime) throws IOException { List<Map<String, Object>> notebookJobs; <START> notebookJobs = notebook().getJobListforNotebookFromUnixTime(false, lastUpdateUnixTime, null); <END> Map<String, Object> response = new HashMap<>(); response.put("lastResponseUnixTime", System.currentTimeMillis()); response.put("jobs", notebookJobs); broadcast(JOB_MANAGER_SERVICE.JOB_MANAGER_PAGE.getKey(), new Message(OP.LIST_UPDATE_NOTEBOOK_JOBS).put("notebookRunningJobs", response)); }</code><technical_language>is passing 'null' for subject intended change</technical_language>

Target:
public void broadcastUpdateNotebookJobInfo(long lastUpdateUnixTime) throws IOException { List<Map<String, Object>> notebookJobs = new LinkedList<>(); Notebook notebookObject = notebook(); List<Map<String, Object>> jobNotes = null; if (notebookObject != null) { jobNotes = notebook().getJobListByUnixTime(false, lastUpdateUnixTime, null); notebookJobs = jobNotes == null ? notebookJobs : jobNotes; } Map<String, Object> response = new HashMap<>(); response.put("lastResponseUnixTime", System.currentTimeMillis()); response.put("jobs", notebookJobs != null ? notebookJobs : new LinkedList<>()); broadcast(JOB_MANAGER_SERVICE.JOB_MANAGER_PAGE.getKey(), new Message(OP.LIST_UPDATE_NOTEBOOK_JOBS).put("notebookRunningJobs", response)); }
Source:
<code>protected boolean onSave(CommitBuilder commit) throws IOException, ConfigInvalidException { if <START> (commit.getMessage() == null || "".equals(commit.getMessage())) <END> { commit.setMessage("Updated reviewers configuration\n"); } saveConfig(FILENAME, cfg); return true; }</code><technical_language>Strings.isNullOrEmpty</technical_language>

Target:
protected boolean onSave(CommitBuilder commit) throws IOException, ConfigInvalidException { if (Strings.isNullOrEmpty(commit.getMessage())) { commit.setMessage("Update reviewers configuration\n"); } saveConfig(FILENAME, cfg); return true; }
Source:
<code>public HostConnectionPool<CL> getPoolForOperation(BaseOperation<CL, ?> op, String hashtag) throws NoAvailableHostsException { String key = op.getKey(); HostToken hToken = null; if (hashtag == null) { hToken = this.getTokenForKey(key); } else { <START> String hashValue = StringUtils.substringBetween(key,Character.toString(hashtag.charAt(0)), Character.toString(hashtag.charAt(1))); <END> hToken = this.getTokenForKey(hashValue); } HostConnectionPool<CL> hostPool = null; if (hToken != null) { hostPool = tokenPools.get(hToken.getToken()); } if (hashtag == null) { if (hostPool == null) { throw new NoAvailableHostsException( "Could not find host connection pool for key: " + key + ", hash: " + tokenMapper.hash(key)); } } else { if (hostPool == null) { throw new NoAvailableHostsException( "Could not find host connection pool for hashtag: " + hashtag + ", hash: " + tokenMapper.hash(hashtag)); } } return hostPool; }</code><technical_language>discussed verify substringBetween right for</technical_language>

Target:
public HostConnectionPool<CL> getPoolForOperation(BaseOperation<CL, ?> op, String hashtag) throws NoAvailableHostsException { String key = op.getKey(); HostToken hToken = null; if (hashtag == null || hashtag.isEmpty()) { hToken = this.getTokenForKey(key); } else { String hashValue = StringUtils.substringBetween(key,Character.toString(hashtag.charAt(0)), Character.toString(hashtag.charAt(1))); hToken = this.getTokenForKey(hashValue); } HostConnectionPool<CL> hostPool = null; if (hToken != null) { hostPool = tokenPools.get(hToken.getToken()); } if (hostPool == null) { throw new NoAvailableHostsException( "Could not find host connection pool for key: " + key + ", hash: " + tokenMapper.hash(key)); } return hostPool; }
Source:
<code>public boolean isFulfilled(@NonNull ITmfTrace trace) { if ((trace instanceof ITmfTraceWithPreDefinedEvents)) { Set<String> mandatoryValues = getValues(ValuePriorityLevel.MANDATORY); if (mandatoryValues.isEmpty()) { return true; } Multimap<@NonNull String, @NonNull String> traceEvents = TmfEventTypeCollectionHelper.getEventFieldNames((((ITmfTraceWithPreDefinedEvents) trace).getContainedEventTypes())); <START> Predicate<String> predicate = new Predicate<String>() { <END> @Override public boolean test(@NonNull String eventName) { Collection<@NonNull String> fields = traceEvents.get(eventName); return fields.containsAll(mandatoryValues); } }; if (fEventNames.isEmpty()) { return traceEvents.keys().stream().allMatch(predicate); } return fEventNames.stream().anyMatch(predicate); } return true; }</code><technical_language>lambda</technical_language>

Target:
public boolean isFulfilled(@NonNull ITmfTrace trace) { if ((trace instanceof ITmfTraceWithPreDefinedEvents)) { Set<String> mandatoryValues = getValues(ValuePriorityLevel.MANDATORY); if (mandatoryValues.isEmpty()) { return true; } Multimap<@NonNull String, @NonNull String> traceEvents = TmfEventTypeCollectionHelper.getEventFieldNames((((ITmfTraceWithPreDefinedEvents) trace).getContainedEventTypes())); if (fEventName.isEmpty()) { return traceEvents.keys().stream().allMatch(eventName -> { Collection<@NonNull String> fields = traceEvents.get(fEventName); return fields.containsAll(mandatoryValues); }); } Collection<@NonNull String> fields = traceEvents.get(fEventName); return fields.containsAll(mandatoryValues); } return true; }
Source:
<code>private void executeToolForMutableTables(Connection conn, ConnectionQueryServices queryServices, Configuration conf, ArrayList<String> mutableTables) { LOGGER.info("Started " + operation + " for mutable tables"); try (Admin admin = queryServices.getAdmin()) { for (String dataTableFullName : mutableTables) { dataTableFullNameGlobal = dataTableFullName; HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); LOGGER.info("Executing " + operation + " of " + dataTableFullName); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); enableTable(admin, dataTableFullName, indexes); LOGGER.info("Completed " + operation + " of " + dataTableFullName); } } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while executing " + operation + " steps for "+ dataTableFullNameGlobal + " " + e); <START> handleFailure(queryServices, dataTableFullNameGlobal, mutableTables); <END> } rebuildIndexes(conn, conf, mutableTables); }</code><technical_language>Similar problem .. exception handling misplaced</technical_language>

Target:
private void executeToolForMutableTables(Connection conn, ConnectionQueryServices queryServices, Configuration conf, ArrayList<String> mutableTables) { LOGGER.info("Started " + operation + " for mutable tables"); for (String dataTableFullName : mutableTables) { try (Admin admin = queryServices.getAdmin()) { HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); LOGGER.info("Executing " + operation + " of " + dataTableFullName); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); enableTable(admin, dataTableFullName, indexes); LOGGER.info("Completed " + operation + " of " + dataTableFullName); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while executing " + operation + " steps for "+ dataTableFullName + " " + e); handleFailure(queryServices, dataTableFullName, mutableTables); } } rebuildIndexes(conn, conf, mutableTables); }
Source:
<code>public static void validateExternalPropertyActivation(MavenProject project, List<ImageConfiguration> images) throws MojoFailureException { String prop = getExternalConfigActivationProperty(project); if(prop == null) { return; } if(images.size() == 1) return; int imagesWithoutExternalConfig = 0; for (ImageConfiguration image : images) { if(PropertyConfigHandler.canCoexistWithOtherPropertyConfiguredImages(image.getExternalConfig())) <START> continue; <END> imagesWithoutExternalConfig++; } if(imagesWithoutExternalConfig > 1) { throw new MojoFailureException("Configuration error: Cannot use property "+EXTERNALCONFIG_ACTIVATION_PROPERTY+" on projects with multiple images without explicit image external configuration."); } }</code><technical_language>please agree adding brackets single line conditionals ? This is existing style error-prone (believe, I hit adding a line). Also, prefer spaces if( dogmatic ;-)</technical_language>

Target:
public static void validateExternalPropertyActivation(MavenProject project, List<ImageConfiguration> images) throws MojoFailureException { String prop = getExternalConfigActivationProperty(project); if(prop == null) { return; } if(images.size() == 1) { return; } int imagesWithoutExternalConfig = 0; for (ImageConfiguration image : images) { if(PropertyConfigHandler.canCoexistWithOtherPropertyConfiguredImages(image.getExternalConfig())) { continue; } imagesWithoutExternalConfig++; } if(imagesWithoutExternalConfig > 1) { throw new MojoFailureException("Configuration error: Cannot use property "+EXTERNALCONFIG_ACTIVATION_PROPERTY+" on projects with multiple images without explicit image external configuration."); } }
Source:
<code>protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> vanillaValues = new HashSet<>(); vanillaValues.add(this.displayName().asImmutable()); vanillaValues.add(this.passengers().asImmutable()); vanillaValues.add(this.onGround().asImmutable()); vanillaValues.add(this.velocity().asImmutable()); vanillaValues.add(this.gravity().asImmutable()); if (this.shadow$getLowestRidingEntity() != null) { <START> this.baseVehicle().map(Value::asImmutable).ifPresent(vanillaValues::add); <END> } return vanillaValues; }</code><technical_language>Delete if, isPresent work fine Gabe below</technical_language>

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = new HashSet<>(); values.add(this.displayName().asImmutable()); values.add(this.passengers().asImmutable()); values.add(this.onGround().asImmutable()); values.add(this.velocity().asImmutable()); values.add(this.gravity().asImmutable()); values.add(this.silent().asImmutable()); this.baseVehicle().map(Value::asImmutable).ifPresent(values::add); this.creator().map(Value::asImmutable).ifPresent(values::add); this.notifier().map(Value::asImmutable).ifPresent(values::add); this.fireTicks().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
<code>public EachQuorumTokenRingDiagnosticGenerator( @NonNull Metadata metadata, @NonNull KeyspaceMetadata keyspace, @NonNull Map<String, ReplicationFactor> replicationFactorsByDc) { super(metadata, keyspace); Objects.requireNonNull(replicationFactorsByDc, "replicationFactorsByDc cannot be null"); <START> this.requiredReplicasByDc = replicationFactorsByDc.entrySet().stream() .collect( ImmutableMap.toImmutableMap( Entry::getKey, entry -> ConsistencyLevels.requiredReplicas( ConsistencyLevel.EACH_QUORUM, entry.getValue()))); <END> }</code><technical_language>rehash this, I once: this stuff is hard read</technical_language>

Target:
public EachQuorumTokenRingDiagnosticGenerator( @NonNull Metadata metadata, @NonNull KeyspaceMetadata keyspace, @NonNull Map<String, ReplicationFactor> replicationFactorsByDc) { super(metadata, keyspace); Objects.requireNonNull(replicationFactorsByDc, "replicationFactorsByDc cannot be null"); ImmutableMap.Builder<String, Integer> replicationFactorsByDcBuilder = ImmutableMap.builder(); for (String datacenter : replicationFactorsByDc.keySet()) { int requiredReplicasInDc = ConsistencyLevels.requiredReplicas( ConsistencyLevel.EACH_QUORUM, replicationFactorsByDc.get(datacenter)); replicationFactorsByDcBuilder.put(datacenter, requiredReplicasInDc); } this.requiredReplicasByDc = replicationFactorsByDcBuilder.build(); }
Source:
<code>public static LocalDate decryptDate(byte[] ciphertext) { if (ciphertext == null) { return null; } <START> return LocalDate.parse(new String(decryptBytes(ciphertext), StandardCharsets.UTF_8)); <END> }</code><technical_language>is format for parsing. do so</technical_language>

Target:
public static LocalDate decryptDate(byte[] ciphertext) { if (ciphertext == null) { return null; } return LocalDate.parse(new String(decryptBytes(ciphertext), StandardCharsets.UTF_8), DateTimeFormatter.ISO_LOCAL_DATE); }
Source:
<code>public void shutdownNotificationService() { if (execution != null) { execution.cancel(true); } <START> if (enabled) { <END> notifiers.forEach(NotifierHandler::destroy); } }</code><technical_language>this guard. If notifiers empty destroy run disabled? if I do bootstrap, disable service get here, destroy</technical_language>

Target:
public void shutdownNotificationService() { notifiers.forEach(NotifierHandler::destroy); }
Source:
<code>public void testDecode() { byte[] b = new byte[2048]; new Random().nextBytes(b); ch.writeInbound(wrappedBuffer(b)); <START> assertThat(ch.readInbound(), is(b)); <END> }</code><technical_language>I this is work, readInbound is object b is a byte array, want method assertThat(byte[], byte[]) for correct comparison. I vague recollections cast required in junits</technical_language>

Target:
public void testDecode() { byte[] b = new byte[2048]; new Random().nextBytes(b); ch.writeInbound(wrappedBuffer(b)); assertThat((byte[]) ch.readInbound(), is(b)); }
Source:
<code>private Gson buildGson() { return new GsonBuilder() <START> .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") <END> .registerTypeAdapter(Person.class, new Person.PersonSerializer()).create(); }</code><technical_language>setting dateFormat is redundant</technical_language>

Target:
private Gson buildGson() { return new GsonBuilder() .registerTypeAdapter(Person.class, new Person.PersonSerializer()) .create(); }
Source:
<code>public Access checkPermission(Document doc, ACP mergedAcp, NuxeoPrincipal principal, String permission, String[] resolvedPermissions, String[] additionalPrincipals) { Access access = Access.UNKNOWN; <START> if (Boolean.TRUE.equals(ignorePolicy.get())) { <END> return access; } if (resolvedPermissions == null || !Arrays.asList(resolvedPermissions).contains(SecurityConstants.WRITE)) { return access; } String username = principal.getName(); Lock lock = doc.getLock(); if (lock != null && !username.equals(lock.getOwner())) { access = Access.DENY; } return access; }</code><technical_language>Move Boolean.TRUE.equals(ignorePolicy.get()) a static method called isIgnorePolicy</technical_language>

Target:
public Access checkPermission(Document doc, ACP mergedAcp, NuxeoPrincipal principal, String permission, String[] resolvedPermissions, String[] additionalPrincipals) { Access access = Access.UNKNOWN; if (isIgnorePolicy()) { return access; } if (resolvedPermissions == null || !Arrays.asList(resolvedPermissions).contains(SecurityConstants.WRITE)) { return access; } String username = principal.getName(); Lock lock = doc.getLock(); if (lock != null && !username.equals(lock.getOwner())) { access = Access.DENY; } return access; }
Source:
<code>protected Map<String, Serializable> getEvaluatedInputExpressions(Map<String, SExpression> contractInputs, SExpressionContext context) throws SExpressionTypeUnknownException, SExpressionDependencyMissingException, SExpressionEvaluationException, SInvalidExpressionException { final Map<String, Serializable> inputExpressionsMap = new HashMap<>(contractInputs.size()); <START> for (Map.Entry<String, SExpression> entry : contractInputs.entrySet()) { <END> inputExpressionsMap.put(entry.getKey(), (Serializable) expressionResolverService.evaluate(entry.getValue(), context)); } return inputExpressionsMap; }</code><technical_language>batch evaluate of expression here</technical_language>

Target:
protected Map<String, Serializable> getEvaluatedInputExpressions(Map<String, SExpression> contractInputs, SExpressionContext context) throws SExpressionTypeUnknownException, SExpressionDependencyMissingException, SExpressionEvaluationException, SInvalidExpressionException { List<SExpression> expressions = new ArrayList<>(contractInputs.size()); expressions.addAll(contractInputs.values()); final List<Object> exprResults = expressionResolverService.evaluate(expressions, context); final Map<String, Serializable> inputExpressionsMap = new HashMap<>(contractInputs.size()); for (Map.Entry<String, SExpression> entry : contractInputs.entrySet()) { inputExpressionsMap.put(entry.getKey(), getExpressionResultWithDiscriminant(entry.getValue().getDiscriminant(), expressions, exprResults)); } return inputExpressionsMap; }
Source:
<code>public OptionsPopupView(EventBus eventBus) { super(eventBus); connectAutomaticallyEditor = new EntityModelCheckBoxEditor(Align.RIGHT); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); connectAutomaticallyEditor.setLabel(constants.connectAutomaticallyLabel()); connectAutomaticallyMessage.setText(constants.connectAutomaticallyMessage()); publicKeyEditor.setLabel(constants.consolePublicKey()); <START> publicKeyEditor.addContentWidgetContainerStyleName(style.publickKeyEditor()); <END> publicKeyEditor.addContentWidgetStyleName(style.publickKeyEditor()); ViewIdHandler.idHandler.generateAndSetIds(this); driver.initialize(this); }</code><technical_language>set style in uibinder file</technical_language>

Target:
public OptionsPopupView(EventBus eventBus) { super(eventBus); connectAutomaticallyEditor = new EntityModelCheckBoxEditor(Align.RIGHT); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); connectAutomaticallyEditor.setLabel(constants.connectAutomaticallyLabel()); connectAutomaticallyMessage.setText(constants.connectAutomaticallyMessage()); publicKeyLabel.setText(constants.consolePublicKeyLabel()); publicKeyEditor.setLabel(constants.consolePublicKeyMessage()); publicKeyEditor.addContentWidgetContainerStyleName(style.publickKeyEditorTextArea()); publicKeyEditor.addContentWidgetStyleName(style.publickKeyEditorTextArea()); ViewIdHandler.idHandler.generateAndSetIds(this); driver.initialize(this); }
Source:
<code>public void testReadWriteV3() throws Exception { <START> final File file = pathOf("gitgit.index.v3"); <END> final DirCache dc = new DirCache(file, FS.DETECTED); dc.read(); assertEquals(10, dc.getEntryCount()); assertV3TreeEntry(0, "dir1/file1.txt", false, false, dc); assertV3TreeEntry(1, "dir2/file2.txt", true, false, dc); assertV3TreeEntry(2, "dir3/file3.txt", false, false, dc); assertV3TreeEntry(3, "dir3/file3a.txt", true, false, dc); assertV3TreeEntry(4, "dir4/file4.txt", true, false, dc); assertV3TreeEntry(5, "dir4/file4a.txt", false, false, dc); assertV3TreeEntry(6, "file.txt", true, false, dc); assertV3TreeEntry(7, "newdir1/newfile1.txt", false, true, dc); assertV3TreeEntry(8, "newdir1/newfile2.txt", false, true, dc); assertV3TreeEntry(9, "newfile.txt", false, true, dc); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); dc.writeTo(bos); final byte[] indexBytes = bos.toByteArray(); final byte[] expectedBytes = IO.readFully(file); for (int i = 0; i < expectedBytes.length; i++) { assertEquals(expectedBytes[i], indexBytes[i]); } }</code><technical_language>file name is "gitgit.index.v3.skipWorkTree"</technical_language>

Target:
public void testReadWriteV3() throws Exception { final File file = pathOf("gitgit.index.v3.skipWorkTree"); final DirCache dc = new DirCache(file, FS.DETECTED); dc.read(); assertEquals(7, dc.getEntryCount()); assertV3TreeEntry(0, "dir1/file1.txt", false, false, dc); assertV3TreeEntry(1, "dir2/file2.txt", true, false, dc); assertV3TreeEntry(2, "dir3/file3.txt", false, false, dc); assertV3TreeEntry(3, "dir3/file3a.txt", true, false, dc); assertV3TreeEntry(4, "dir4/file4.txt", true, false, dc); assertV3TreeEntry(5, "dir4/file4a.txt", false, false, dc); assertV3TreeEntry(6, "file.txt", true, false, dc); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); dc.writeTo(bos); final byte[] indexBytes = bos.toByteArray(); final byte[] expectedBytes = IO.readFully(file); assertTrue(Arrays.equals(expectedBytes, indexBytes)); }
Source:
<code>protected void applyRow(SnomedSimpleMapRefSetMember member, SimpleMapRefSetRow row, Collection<SnomedSimpleMapRefSetMember> componentsToAttach) { member.setUuid(row.getUuid().toString()); if (row.getEffectiveTime() != null) { member.setEffectiveTime(row.getEffectiveTime()); member.setReleased(true); } else { member.unsetEffectiveTime(); } member.setRefSet(getOrCreateRefSet(row.getRefSetId(), row.getReferencedComponentId())); member.setActive(row.isActive()); member.setModuleId(row.getModuleId()); member.setReferencedComponentId(row.getReferencedComponentId()); member.setMapTargetComponentId(row.getAssociatedComponentId()); <START> if (extended) { <END> member.setMapTargetComponentDescription(((SimpleMapRefSetRow) row).getMapTargetDescription()); } }</code><technical_language>naming of this field confusing if complex map importer this class side-by-side (both maps "extended" in a sense, additional column is in meaning). Please rename this hasMapTargetDescription similar</technical_language>

Target:
protected void applyRow(SnomedSimpleMapRefSetMember member, SimpleMapRefSetRow row, Collection<SnomedSimpleMapRefSetMember> componentsToAttach) { if (row.getEffectiveTime() != null) { member.setEffectiveTime(row.getEffectiveTime()); member.setReleased(true); } else { member.unsetEffectiveTime(); } member.setRefSet(getOrCreateRefSet(row.getRefSetId(), row.getReferencedComponentId())); member.setActive(row.isActive()); member.setModuleId(row.getModuleId()); member.setReferencedComponentId(row.getReferencedComponentId()); member.setMapTargetComponentId(row.getAssociatedComponentId()); if (hasMapTargetDescription) { member.setMapTargetComponentDescription(((SimpleMapRefSetRow) row).getMapTargetDescription()); } }
Source:
<code>public void visit(BuiltinMap builtinMap) { for (java.util.Map.Entry<Term, Term> entry : builtinMap.getEntries().entrySet()) { entry.getKey().accept(this); entry.getValue().accept(this); } <START> for (KItem pattern : builtinMap.collectionPatterns()) { <END> pattern.accept(this); } for (Variable variable : builtinMap.collectionVariables()) { variable.accept(this); } for (Term term : builtinMap.collectionFunctions()) { term.accept(this); } visit((Collection) builtinMap); }</code><technical_language>a new method in AssociativeCommutativeCollection returns union of collections? In this way, shorter code in Visitors Transformers. Besides, next time want change contents of AssociativeCommutativeCollection, places change</technical_language>

Target:
public void visit(BuiltinMap builtinMap) { for (java.util.Map.Entry<Term, Term> entry : builtinMap.getEntries().entrySet()) { entry.getKey().accept(this); entry.getValue().accept(this); } for (Term term : builtinMap.baseTerms()) { term.accept(this); } visit((Collection) builtinMap); }
Source:
<code>Mono<Response<Void>> publishTelemetryWithResponse(String digitalTwinId, String payload, PublishTelemetryRequestOptions publishTelemetryRequestOptions, Context context) { return protocolLayer.getDigitalTwins().sendTelemetryWithResponseAsync( digitalTwinId, publishTelemetryRequestOptions.getMessageId(), <START> payload, <END> publishTelemetryRequestOptions.getTimestamp().toString(), context); }</code><technical_language>need pre-emptively serialize this string PL deserializes string user provided</technical_language>

Target:
Mono<Response<Void>> publishTelemetryWithResponse(String digitalTwinId, String payload, PublishTelemetryRequestOptions publishTelemetryRequestOptions, Context context) { Object payloadObject = null; try { payloadObject = mapper.readValue(payload, Object.class); } catch (JsonProcessingException e) { logger.error("Could not parse the payload [%s]: %s", payload, e); return Mono.error(e); } return protocolLayer.getDigitalTwins().sendTelemetryWithResponseAsync( digitalTwinId, publishTelemetryRequestOptions.getMessageId(), payloadObject, publishTelemetryRequestOptions.getTimestamp().toString(), context); }
Source:
<code><START> @Test public void createZipFileSystemFromExistingTest() throws IOException, JarToBundleConverterException { <END> FileSystem fileSystem = BundleGeneratorUtils.createZipFileSystem(TestConstants.SAMPLE_JAR_FILE, false); Assert.assertNotNull(fileSystem); fileSystem.close(); }</code><technical_language>check formatting</technical_language>

Target:
public void createZipFileSystemFromExistingTest() throws IOException, JarToBundleConverterException { FileSystem fileSystem = BundleGeneratorUtils.createZipFileSystem(TestConstants.SAMPLE_JAR_FILE, false); Assert.assertNotNull(fileSystem); fileSystem.close(); }
Source:
<code>public void test_self_ref_with_parents() throws Exception { FindRequest fr=new FindRequest(); fr.setQuery(query("{'field':'_id','op':'=','rvalue':'img1'}")); fr.setProjection(projection("[{'field':'*','recursive':true},{'field':'vulnerabilities.*.packages.*.fixed_by_images.*'}]")); fr.setEntityVersion(new EntityVersion("containerImage-self","0.0.1")); Response response=mediator.find(fr); <START> System.out.println(response.getEntityData()); <END> }</code><technical_language>assert anything</technical_language>

Target:
public void test_self_ref_with_parents() throws Exception { FindRequest fr=new FindRequest(); fr.setQuery(query("{'field':'_id','op':'=','rvalue':'img1'}")); fr.setProjection(projection("[{'field':'*','recursive':true},{'field':'vulnerabilities.*.packages.*.fixed_by_images.*'}]")); fr.setEntityVersion(new EntityVersion("containerImage-self","0.0.1")); Response response=mediator.find(fr); System.out.println(response.getEntityData()); Assert.assertEquals(1,response.getEntityData().size()); Assert.assertTrue(response.getEntityData().get(0).get("vulnerabilities").get(0).get("packages").get(0).get("fixed_by_images").size()==1); }
Source:
<code>public Builder mergeFrom(io.netty.example.worldclock.WorldClockProtocol.Locations other) { if (other == io.netty.example.worldclock.WorldClockProtocol.Locations.getDefaultInstance()) { <START> return this; <END> } if (locationBuilder_ == null) { if (!other.location_.isEmpty()) { if (location_.isEmpty()) { location_ = other.location_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLocationIsMutable(); location_.addAll(other.location_); } onChanged(); } } else { if (!other.location_.isEmpty()) { if (locationBuilder_.isEmpty()) { locationBuilder_.dispose(); locationBuilder_ = null; location_ = other.location_; bitField0_ = (bitField0_ & ~0x00000001); locationBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getLocationFieldBuilder() : null; } else { locationBuilder_.addAllMessages(other.location_); } } } this.mergeUnknownFields(other.getUnknownFields()); return this; }</code><technical_language>4 spaces</technical_language>

Target:
public Builder mergeFrom(io.netty.example.worldclock.WorldClockProtocol.Locations other) { if (other == io.netty.example.worldclock.WorldClockProtocol.Locations.getDefaultInstance()) return this; if (locationBuilder_ == null) { if (!other.location_.isEmpty()) { if (location_.isEmpty()) { location_ = other.location_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLocationIsMutable(); location_.addAll(other.location_); } onChanged(); } } else { if (!other.location_.isEmpty()) { if (locationBuilder_.isEmpty()) { locationBuilder_.dispose(); locationBuilder_ = null; location_ = other.location_; bitField0_ = (bitField0_ & ~0x00000001); locationBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getLocationFieldBuilder() : null; } else { locationBuilder_.addAllMessages(other.location_); } } } this.mergeUnknownFields(other.getUnknownFields()); return this; }
Source:
<code>public void enteringVertex(ModelClass object, Vertex vertex) { <START> this.registry.addEntry(object, vertex); <END> sendNewModelEvent(MessageType.ENTERING_VERTEX, object.getClass().getCanonicalName(), getIdentifierOf(object), vertex.getClass().getCanonicalName()); }</code><technical_language>animate transitions</technical_language>

Target:
public void enteringVertex(ModelClass object, Vertex vertex) { String vertexName = vertex.getClass().getCanonicalName(); server.register(object, vertexName); sendNewModelEvent(MessageType.ENTERING_VERTEX, object.getClass().getCanonicalName(), getIdentifierOf(object), vertexName); }
Source:
<code>public ParseStatus parseJavadocAsDetailNode(DetailAST javadocCommentAst) { blockCommentLineNumber = javadocCommentAst.getLineNo(); final String javadocComment = JavadocUtils.getJavadocCommentContent(javadocCommentAst); errorListener = new DescriptiveErrorListener(); errorListener.setOffset(javadocCommentAst.getLineNo() - 1); final ParseStatus result = new ParseStatus(); try { final ParseTree parseTree = parseJavadocAsParseTree(javadocComment); final DetailNode tree = convertParseTreeToDetailNode(parseTree); adjustFirstLineToJavadocIndent(tree, javadocCommentAst.getColumnNo() + JAVADOC_START.length()); result.setTree(tree); <START> } <END> catch (ParseCancellationException | IllegalArgumentException ex) { ParseErrorMessage parseErrorMessage = null; if (ex.getCause() instanceof FailedPredicateException || ex.getCause() instanceof NoViableAltException) { final RecognitionException recognitionEx = (RecognitionException) ex.getCause(); if (recognitionEx.getCtx() instanceof JavadocParser.HtmlElementContext || recognitionEx.getCtx() instanceof JavadocParser.HtmlTagContext) { parseErrorMessage = generateMissedHtmlTagErrorMessage(recognitionEx); } } if (parseErrorMessage == null) { parseErrorMessage = errorListener.getErrorMessage(); } if (parseErrorMessage == null) { parseErrorMessage = new ParseErrorMessage(javadocCommentAst.getLineNo(), MSG_KEY_UNRECOGNIZED_ANTLR_ERROR, javadocCommentAst.getColumnNo(), ex.getMessage()); } result.setParseErrorMessage(parseErrorMessage); } return result; }</code><technical_language>I test check messages for viable alternative, do cover FailedPredicateException</technical_language>

Target:
public ParseStatus parseJavadocAsDetailNode(DetailAST javadocCommentAst) { blockCommentLineNumber = javadocCommentAst.getLineNo(); final String javadocComment = JavadocUtils.getJavadocCommentContent(javadocCommentAst); errorListener = new DescriptiveErrorListener(); errorListener.setOffset(javadocCommentAst.getLineNo() - 1); final ParseStatus result = new ParseStatus(); try { final ParseTree parseTree = parseJavadocAsParseTree(javadocComment); final DetailNode tree = convertParseTreeToDetailNode(parseTree); adjustFirstLineToJavadocIndent(tree, javadocCommentAst.getColumnNo() + JAVADOC_START.length()); result.setTree(tree); } catch (ParseCancellationException | IllegalArgumentException ex) { ParseErrorMessage parseErrorMessage = null; if (ex.getCause() instanceof FailedPredicateException || ex.getCause() instanceof NoViableAltException) { final RecognitionException recognitionEx = (RecognitionException) ex.getCause(); if (recognitionEx.getCtx() instanceof JavadocParser.HtmlTagContext) { final Token htmlTagNameStart = getMissedHtmlTag(recognitionEx); parseErrorMessage = new ParseErrorMessage( errorListener.offset + htmlTagNameStart.getLine(), MSG_JAVADOC_MISSED_HTML_CLOSE, htmlTagNameStart.getCharPositionInLine(), htmlTagNameStart.getText()); } } if (parseErrorMessage == null) { parseErrorMessage = errorListener.getErrorMessage(); } result.setParseErrorMessage(parseErrorMessage); } return result; }
Source:
<code>public String getUnifiedDiff() { PatchList patchList; try { patchList = getPatchList(); if (patchList.getOldId() == null) { <START> return "[Octopus merge, cannot be formatted as a diff.]"; <END> } } catch (PatchListNotAvailableException e) { log.error("Cannot format patch", e); return ""; } TemporaryBuffer.Heap buf = new TemporaryBuffer.Heap(args.settings.maximumDiffSize); DiffFormatter fmt = new DiffFormatter(buf); Repository git; try { git = args.server.openRepository(change.getProject()); } catch (IOException e) { log.error("Cannot open repository to format patch", e); return ""; } try { fmt.setRepository(git); fmt.setDetectRenames(true); fmt.format(patchList.getOldId(), patchList.getNewId()); return RawParseUtils.decode(buf.toByteArray()); } catch (IOException e) { if (JGitText.get().inMemoryBufferLimitExceeded.equals(e.getMessage())) { return ""; } log.error("Cannot format patch", e); return ""; } finally { fmt.release(); git.close(); } }</code><technical_language>comma odd me. I suggest removing replacing a semi-colon</technical_language>

Target:
public String getUnifiedDiff() { PatchList patchList; try { patchList = getPatchList(); if (patchList.getOldId() == null) { return "[Octopus merge; cannot be formatted as a diff.]\n"; } } catch (PatchListNotAvailableException e) { log.error("Cannot format patch", e); return ""; } TemporaryBuffer.Heap buf = new TemporaryBuffer.Heap(args.settings.maximumDiffSize); DiffFormatter fmt = new DiffFormatter(buf); Repository git; try { git = args.server.openRepository(change.getProject()); } catch (IOException e) { log.error("Cannot open repository to format patch", e); return ""; } try { fmt.setRepository(git); fmt.setDetectRenames(true); fmt.format(patchList.getOldId(), patchList.getNewId()); return RawParseUtils.decode(buf.toByteArray()); } catch (IOException e) { if (JGitText.get().inMemoryBufferLimitExceeded.equals(e.getMessage())) { return ""; } log.error("Cannot format patch", e); return ""; } finally { fmt.release(); git.close(); } }
Source:
<code>public static List<Pair<EditableDeviceOnVmStatusField, Boolean>> getVmDevicesFieldsToUpdateOnNextRun( Guid vmId, VMStatus vmStatus, Object objectWithEditableDeviceFields) { List<Pair<EditableDeviceOnVmStatusField, Boolean>> fieldList = new ArrayList<>(); List<Pair<EditableDeviceOnVmStatusField , Field>> pairList = BaseHandler.extractAnnotatedFields( EditableDeviceOnVmStatusField.class, objectWithEditableDeviceFields.getClass()); for (Pair<EditableDeviceOnVmStatusField, Field> pair : pairList) { EditableDeviceOnVmStatusField annotation = pair.getFirst(); Field field = pair.getSecond(); field.setAccessible(true); Boolean isEnabled = null; try { isEnabled = (Boolean) field.get(objectWithEditableDeviceFields); } catch (IllegalAccessException | ClassCastException e) { <START> log.warn("VmHandler:: isUpdateValidForVmDevices: Reflection error"); <END> } String device = null; if (annotation.type() != VmDeviceType.UNKNOWN) { device = annotation.type().getName(); } if (isEnabled == null || !VmDeviceUtils.vmDeviceChanged(vmId, annotation.generalType(), device, isEnabled)) { continue; } if (!VmHandler.isUpdateValidForVmDevice(field.getName(), vmStatus)) { fieldList.add(new Pair<>(annotation, isEnabled)); } } return fieldList; }</code><technical_language>adding message exception log message provide more information</technical_language>

Target:
public static List<Pair<EditableDeviceOnVmStatusField, Boolean>> getVmDevicesFieldsToUpdateOnNextRun( Guid vmId, VMStatus vmStatus, Object objectWithEditableDeviceFields) { List<Pair<EditableDeviceOnVmStatusField, Boolean>> fieldList = new ArrayList<>(); List<Pair<EditableDeviceOnVmStatusField , Field>> pairList = BaseHandler.extractAnnotatedFields( EditableDeviceOnVmStatusField.class, objectWithEditableDeviceFields.getClass()); for (Pair<EditableDeviceOnVmStatusField, Field> pair : pairList) { EditableDeviceOnVmStatusField annotation = pair.getFirst(); Field field = pair.getSecond(); field.setAccessible(true); Boolean isEnabled = null; try { isEnabled = (Boolean) field.get(objectWithEditableDeviceFields); } catch (IllegalAccessException | ClassCastException e) { log.warn("VmHandler:: isUpdateValidForVmDevices: Reflection error"); log.debug("Original exception was:", e); } String device = null; if (annotation.type() != VmDeviceType.UNKNOWN) { device = annotation.type().getName(); } if (isEnabled == null || !VmDeviceUtils.vmDeviceChanged(vmId, annotation.generalType(), device, isEnabled)) { continue; } if (!VmHandler.isUpdateValidForVmDevice(field.getName(), vmStatus)) { fieldList.add(new Pair<>(annotation, isEnabled)); } } return fieldList; }
Source:
<code>private void rollbackTransaction() { if (!unitOfWork.transactional()) { return; } final Transaction txn = session.getTransaction(); <START> if (txn != null && (txn.getStatus() == ACTIVE || txn.getStatus() == MARKED_ROLLBACK)) { <END> txn.rollback(); } }</code><technical_language>[TransactionStatus#canRollback()](<LINK_0> here</technical_language>

Target:
private void rollbackTransaction() { if (!unitOfWork.transactional()) { return; } final Transaction txn = session.getTransaction(); if (txn != null && txn.getStatus().canRollback()) { txn.rollback(); } }
Source:
<code><START> public MetricServiceExecutorConf getServerMetricConf() { <END> return MetricServiceExecutorConf.newBuilder() .setCustomMetricCodec(ETDolphinMetricMsgCodec.class) .build(); }</code><technical_language>I this method getWorkerMetricConf()</technical_language>

Target:
public MetricServiceExecutorConf getServerMetricConf() { return MetricServiceExecutorConf.newBuilder() .setMetricFlushPeriodMs(serverMetricFlushPeriodMs) .build(); }
Source:
<code>private ByteBuffer parsePacketIDBAndNRB(int blockLength) throws IOException { ByteBuffer pcapPacketData; pcapPacketData = ByteBuffer.allocate(blockLength - PcapFileValues.PCAPNG_PACKET_HEADER_SIZE); <START> pcapPacketData.position(PcapFileValues.PCAPNG_PACKET_HEADER_SIZE); <END> pcapPacketData.clear(); SeekableByteChannel fFileChannel; try { fFileChannel = getFileChannel(); fFileChannel.read(pcapPacketData); } catch (BadPcapFileException e1) { } pcapPacketData.flip(); return pcapPacketData; }</code><technical_language>This is useless clear() resets position zero</technical_language>

Target:
private ByteBuffer parsePacketIDBAndNRB(int blockLength) throws IOException { ByteBuffer pcapPacketData; pcapPacketData = ByteBuffer.allocate(blockLength - PcapFileValues.PCAPNG_PACKET_HEADER_SIZE); pcapPacketData.clear(); SeekableByteChannel fFileChannel; try { fFileChannel = getFileChannel(); fFileChannel.read(pcapPacketData); } catch (BadPcapFileException e1) { } pcapPacketData.flip(); return pcapPacketData; }
Source:
<code>public DataTransactionResult remove(DataHolder dataHolder) { if (supports(dataHolder)) { if (dataHolder instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) dataHolder; player.capabilities.allowFlying = false; } else { ((net.minecraft.entity.Entity) (dataHolder)).isAirBorne = false; } <START> return DataTransactionBuilder.builder().result(DataTransactionResult.Type.SUCCESS).build(); <END> } return DataTransactionBuilder.builder().result(DataTransactionResult.Type.FAILURE).build(); }</code><technical_language>need get previous state if is changed</technical_language>

Target:
public DataTransactionResult remove(DataHolder dataHolder) { return DataTransactionBuilder.failNoData(); }
Source:
<code>CommonMetrics() { <START> _metrics = MetricsManager.INSTANCE.getRegistry(); <END> setupAllMetrics(); }</code><technical_language>I a bit concerned coding style here. Azkaban a coding style LinkedIn. If moving LinkedIn standard, change entire codebase move it. Else stick Azkaban's default. styles in codebase idea</technical_language>

Target:
CommonMetrics() { registry = MetricsManager.INSTANCE.getRegistry(); setupAllMetrics(); }
Source:
<code>public void removeService(Object service) { Path path = service.getClass().getAnnotation(Path.class); if (path != null) { services.remove(path.value()); updateMetadata(); } else { <START> log.warn("Service removal fail, class '" + service.getClass().getName() + "' doesn't contain a root Path"); <END> } }</code><technical_language>change this log Service removal failed. Microservice class '" + service.getClass().getName() + "' a root Path</technical_language>

Target:
public void removeService(Object service) { if (service == null) { log.error("Service cannot be null."); return; } Path path = service.getClass().getAnnotation(Path.class); if (path == null) { log.warn("Service removal failed. Microservice class '" + service.getClass().getName() + "' doesn't contain a root Path."); return; } services.remove(path.value()); updateMetadata(); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { binding = DataBindingUtil.inflate(inflater, R.layout.fragment_view_subjects, container, false); initSubjectsGrid(); initSubjectsSearch(); if (savedInstanceState != null) { <START> searchQuery = savedInstanceState.getString("query"); <END> if (!TextUtils.isEmpty(searchQuery)) { performSearch(searchQuery); } } analyticsRegistry.trackScreenView(Analytics.Screens.ALL_SUBJECTS); return binding.getRoot(); }</code><technical_language>query put extra keys in class constants</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { binding = DataBindingUtil.inflate(inflater, R.layout.fragment_view_subjects, container, false); initSubjectsGrid(); initSubjectsSearch(); if (savedInstanceState != null) { searchQuery = savedInstanceState.getString(KEY_SEARCH_QUERY); if (!TextUtils.isEmpty(searchQuery)) { performSearch(searchQuery); } } analyticsRegistry.trackScreenView(Analytics.Screens.ALL_SUBJECTS); return binding.getRoot(); }
Source:
<code>public void adsFandomBtfBlockMobile(String article) { String testedPage = urlBuilder.getUrlForFandomPage(article); AdsFandomObject fandomPage = new AdsFandomObject(driver, testedPage); <START> getJquery(); <END> fandomPage.verifyTopLeaderboard(); fandomPage.verifyTopBoxad(); fandomPage.verifyNoBottomBoxad(); fandomPage.verifyNoBottomLeaderboard(); }</code><technical_language>java String testedPage = urlBuilder.getUrlForFandomPage(article); AdsFandomObject fandomPage = new AdsFandomObject(driver, testedPage); getJquery(); do creating method in AdsFandomTestTemplate more DRY</technical_language>

Target:
public void adsFandomBtfBlockMobile(String article) { AdsFandomObject fandomPage = loadPage(article); fandomPage.verifySlot(AdsFandomContent.TOP_LEADERBOARD); fandomPage.verifySlot(AdsFandomContent.TOP_BOXAD); Assertion.assertNull(fandomPage.getSlot(AdsFandomContent.BOTTOM_BOXAD), ASSERT_MESSAGE); Assertion.assertNull(fandomPage.getSlot(AdsFandomContent.BOTTOM_LEADERBOARD), ASSERT_MESSAGE); }
Source:
<code>public Selector parseRawSelector(String selector) { if (!selector.startsWith("@")) { throw new IllegalArgumentException("Invalid selector " + selector); } int argListIndex = selector.indexOf('['); if (argListIndex < 0) { argListIndex = selector.length(); } String typeStr = selector.substring(1, argListIndex); <START> Optional<SelectorType> type = Sponge.getGame().getRegistry().getType(SelectorType.class, typeStr); <END> if (!type.isPresent()) { throw new IllegalArgumentException("No type known as '" + typeStr + "'"); } try { Map<String, String> rawMap; if (argListIndex == selector.length()) { rawMap = ImmutableMap.of(); } else { rawMap = PlayerSelector.getArgumentMap(selector.substring(argListIndex + 1, selector.length() - 1)); } Map<ArgumentType<?>, Argument<?>> arguments = parseArguments(rawMap); return new SpongeSelector(type.get(), ImmutableMap.copyOf(arguments)); } catch (Exception e) { throw new IllegalArgumentException("Invalid selector " + selector, e); } }</code><technical_language>This part work keys registered selectors though</technical_language>

Target:
public Selector parseRawSelector(String selector) { if (!selector.startsWith("@")) { throw new IllegalArgumentException("Invalid selector " + selector); } int argListIndex = selector.indexOf('['); if (argListIndex < 0) { argListIndex = selector.length(); } String typeStr = selector.substring(1, argListIndex); if (!idToType.containsKey(typeStr)) { throw new IllegalArgumentException("No type known as '" + typeStr + "'"); } SelectorType type = idToType.get(typeStr); try { Map<String, String> rawMap; if (argListIndex == selector.length()) { rawMap = ImmutableMap.of(); } else { rawMap = PlayerSelector.getArgumentMap(selector.substring(argListIndex + 1, selector.length() - 1)); } Map<ArgumentType<?>, Argument<?>> arguments = parseArguments(rawMap); return new SpongeSelector(type, ImmutableMap.copyOf(arguments)); } catch (Exception e) { throw new IllegalArgumentException("Invalid selector " + selector, e); } }
Source:
<code><START> public final boolean equals(Object that) { <END> if (this == that) return true; if (that == null || getClass() != that.getClass()) return false; return name.equals(((Label)that).name); }</code><technical_language>If equals final need hashCode compareTo final</technical_language>

Target:
public final boolean equals(Object that) { if (this == that) return true; if (that == null || getClass() != that.getClass()) return false; return matches(((Label)that).name); }
Source:
<code>public short readShort() { short v = (short) (bytes[pos] << 8 | (bytes[pos + 1] & 0xff)); pos += 2; return v; <START> } <END></code><technical_language>methods do size checks readByte throw EOFException. get IndexOutOfBoundsException instead</technical_language>

Target:
public short readShort() throws EOFException { checkPosLength(2); short v = (short) (bytes[pos] << 8 | (bytes[pos + 1] & 0xff)); pos += 2; return v; }
Source:
<code>private List<? extends Reference> getReferences(JSONArray jsonReferences) { List<Reference> result = new LinkedList<>(); for (int i = 0; i < jsonReferences.length(); i++) { try { JSONArray jsonSingleRef = jsonReferences.getJSONArray(i); List<ValueSnak> valueSnaks = new LinkedList<>(); for (int j = 0; j < jsonSingleRef.length(); j++) { try { JSONArray jsonValueSnak = jsonSingleRef.getJSONArray(j); ValueSnak currentValueSnak = this .getValueSnak(jsonValueSnak); valueSnaks.add(currentValueSnak); } catch (JSONException e) { <START> continue; <END> } } Reference singleReference = factory.getReference(valueSnaks); result.add(singleReference); } catch (JSONException e) { continue; } } return result; }</code><technical_language>general note error handling recovery</technical_language>

Target:
private List<? extends Reference> getReferences(JSONArray jsonReferences) { List<Reference> result = new ArrayList<>(jsonReferences.length()); for (int i = 0; i < jsonReferences.length(); i++) { try { JSONArray jsonRef = jsonReferences.getJSONArray(i); result.add(this.getReference(jsonRef)); } catch (JSONException e) { JsonConverter.logger .error("Problem when parsing reference. Error was: " + e.toString()); } } return result; }