auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Collection<? extends Diff> findInterlockedOneToOneDiffs(ReferenceChange referenceChange, boolean mergeRightToLeft) { final EObject sourceContainer = ComparisonUtil.getExpectedSide(referenceChange.getMatch(), referenceChange.getSource(), mergeRightToLeft); if (sourceContainer != null) { final Object sourceValue = ReferenceUtil .safeEGet(sourceContainer, referenceChange.getReference()); if (sourceValue == sourceContainer) { final Match match = referenceChange.getMatch(); final Set<Diff> candidates = new LinkedHashSet<Diff>(); for (Diff diff : match.getDifferences()) { candidates.add(diff); if (diff.getEquivalence() != null) { candidates.addAll(diff.getEquivalence().getDifferences()); } } return filterInterlockedOneToOneDiffs(candidates, referenceChange, mergeRightToLeft); } } <START> return new LinkedHashSet<Diff>(); <END> }</code><technical_language>Please Collections.emptyList() instead. Thanks</technical_language>

Target:
private Collection<? extends Diff> findInterlockedOneToOneDiffs(ReferenceChange referenceChange, boolean mergeRightToLeft) { final EObject sourceContainer = ComparisonUtil.getExpectedSide(referenceChange.getMatch(), referenceChange.getSource(), mergeRightToLeft); if (sourceContainer != null) { final Object sourceValue = ReferenceUtil .safeEGet(sourceContainer, referenceChange.getReference()); if (sourceValue == sourceContainer) { final Match match = referenceChange.getMatch(); final Set<Diff> candidates = new LinkedHashSet<Diff>(); for (Diff diff : match.getDifferences()) { candidates.add(diff); if (diff.getEquivalence() != null) { candidates.addAll(diff.getEquivalence().getDifferences()); } } return filterInterlockedOneToOneDiffs(candidates, referenceChange, mergeRightToLeft); } } return Collections.emptyList(); }
Source:
<code>protected void acceptRead(final SAMRecord rec, final ReferenceSequence ref) { if (ref == null) { <START> if (!rec.getReadPairedFlag() || rec.getFirstOfPairFlag()) ++this.totalClusters; <END> } else { if (ref.getContigIndex() != lastContig) { refBases = ref.getBases(); StringUtil.toUpperCase(refBases); final int refLength = refBases.length; final int lastWindowStart = refLength - WINDOW_SIZE; gc = calculateAllGcs(refBases, windowsByGc, lastWindowStart); lastContig = ref.getContigIndex(); } if (!rec.getReadPairedFlag() || rec.getFirstOfPairFlag()) ++this.totalClusters; if (!rec.getReadUnmappedFlag()) { final int pos = rec.getReadNegativeStrandFlag() ? rec.getAlignmentEnd() - WINDOW_SIZE : rec.getAlignmentStart(); ++this.totalAlignedReads; if (pos > 0) { final int windowGc = gc[pos]; if (windowGc >= 0) { ++readsByGc[windowGc]; basesByGc[windowGc] += rec.getReadLength(); errorsByGc[windowGc] += SequenceUtil.countMismatches(rec, refBases, IS_BISULFITE_SEQUENCED) + SequenceUtil.countInsertedBases(rec) + SequenceUtil.countDeletedBases(rec); } } } } }</code><technical_language>This statement is sides of if (ref == null) conditional. this pulled if (ref == null) if branch eliminated? 100% can, some intervening logic in else branch this statement appears, this is a question. :smile:</technical_language>

Target:
protected void acceptRead(final SAMRecord rec, final ReferenceSequence ref) { if (!rec.getReadPairedFlag() || rec.getFirstOfPairFlag()) ++this.totalClusters; if (ref!=null) { if (ref.getContigIndex() != lastContig) { refBases = ref.getBases(); StringUtil.toUpperCase(refBases); final int refLength = refBases.length; final int lastWindowStart = refLength - WINDOW_SIZE; gc = calculateAllGcs(refBases, windowsByGc, lastWindowStart); lastContig = ref.getContigIndex(); } if (!rec.getReadPairedFlag() || rec.getFirstOfPairFlag()) ++this.totalClusters; if (!rec.getReadUnmappedFlag()) { final int pos = rec.getReadNegativeStrandFlag() ? rec.getAlignmentEnd() - WINDOW_SIZE : rec.getAlignmentStart(); ++this.totalAlignedReads; if (pos > 0) { final int windowGc = gc[pos]; if (windowGc >= 0) { ++readsByGc[windowGc]; basesByGc[windowGc] += rec.getReadLength(); errorsByGc[windowGc] += SequenceUtil.countMismatches(rec, refBases, IS_BISULFITE_SEQUENCED) + SequenceUtil.countInsertedBases(rec) + SequenceUtil.countDeletedBases(rec); } } } } }
Source:
<code>public static String join(Collection<?> collection, String delimiter) { if (collection == null || collection.isEmpty()) { return EMPTY_STRING; } else if (delimiter == null) { delimiter = EMPTY_STRING; } StringBuilder builder = new StringBuilder(); Iterator<?> it = collection.iterator(); while (it.hasNext()) { builder.append(it.next()).append(delimiter); } int length = builder.toString().length(); <START> builder.delete(length - delimiter.length(), length); <END> return builder.toString(); }</code><technical_language>a fan. ;-)</technical_language>

Target:
public static String join(Collection<?> collection, String delimiter) { if (collection == null || collection.isEmpty()) { return EMPTY_STRING; } else if (delimiter == null) { delimiter = EMPTY_STRING; } StringBuilder builder = new StringBuilder(); Iterator<?> it = collection.iterator(); while (it.hasNext()) { builder.append(it.next()).append(delimiter); } int length = builder.length(); builder.delete(length - delimiter.length(), length); return builder.toString(); }
Source:
<code>private boolean isGlacierObject(S3ObjectSummary object) { <START> return object.getStorageClass().equals(StorageClass.Glacier.toString()); <END> }</code><technical_language>In case object.getStorageClass() null, won't, defensive, please flip order: StorageClass.Glacier.toString().equals(object.getStorageClass())</technical_language>

Target:
private boolean isGlacierObject(S3ObjectSummary object) { return Glacier.toString().equals(object.getStorageClass()); }
Source:
<code>@Override public double determinant() { LUDecomposition dec = new LUDecomposition(this); double res = dec.determinant(); <START> dec.destroy(); <END> return res; }</code><technical_language>sense wrap try-finally</technical_language>

Target:
@Override public double determinant() { try (LUDecomposition dec = new LUDecomposition(this)) { return dec.determinant(); } }
Source:
<code>public GlusterVolumeProfileInfoReturnForXmlRpc(Guid clusterId, Map<String, Object> innerMap) { super(innerMap); status = new StatusForXmlRpc((Map<String, Object>) innerMap.get(STATUS)); Map<String, Object> profileInfo = (Map<String, Object>) innerMap.get(PROFILE_INFO); if (profileInfo != null) { String volumeName = (String) profileInfo.get(VOLUME_NAME); GlusterVolumeEntity volume = getGlusterVolumeDao().getByName(clusterId, volumeName); glusterVolumeProfileInfo.setVolumeId(volume.getId()); if(profileInfo.containsKey(BRICKS)) { glusterVolumeProfileInfo.setBrickProfileDetails(prepareBrickProfileDetails(volume, (Object[]) profileInfo.get(BRICKS))); } else { <START> glusterVolumeProfileInfo.setNfsProfileDetails(prepareNfsProfileDetails((Object[]) profileInfo.get(NFSSERVERS))); <END> } } }</code><technical_language>If map bricks, nfs servers ?</technical_language>

Target:
public GlusterVolumeProfileInfoReturnForXmlRpc(Guid clusterId, Map<String, Object> innerMap) { super(innerMap); status = new StatusForXmlRpc((Map<String, Object>) innerMap.get(STATUS)); Map<String, Object> profileInfo = (Map<String, Object>) innerMap.get(PROFILE_INFO); if (profileInfo != null) { String volumeName = (String) profileInfo.get(VOLUME_NAME); GlusterVolumeEntity volume = getGlusterVolumeDao().getByName(clusterId, volumeName); glusterVolumeProfileInfo.setVolumeId(volume.getId()); if(profileInfo.containsKey(BRICKS)) { glusterVolumeProfileInfo.setBrickProfileDetails(prepareBrickProfileDetails(volume, (Object[]) profileInfo.get(BRICKS))); } else if(profileInfo.containsKey(NFSSERVERS)){ glusterVolumeProfileInfo.setNfsProfileDetails(prepareNfsProfileDetails((Object[]) profileInfo.get(NFSSERVERS))); } } }
Source:
<code>public void shouldUploadReservedIdentifiers() throws Exception { String reservedIdentifiers = "{\"reservedIdentifiers\": \"100,200,300,400\"}"; MockHttpServletRequest getRequest = newGetRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID); getRequest.addParameter("v", "custom:(reservedIdentifiers)"); SimpleObject initialIdentifiers = deserialize(handle(getRequest)); assertEquals("[]", initialIdentifiers.get("reservedIdentifiers").toString()); MockHttpServletRequest postRequest = newPostRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID, reservedIdentifiers); SimpleObject uploadResult = deserialize(handle(postRequest)); assertThat( uploadResult.toString(), containsString(SEQUENTIAL_IDENTIFIER_SOURCE_UUID) ); MockHttpServletRequest getRequestAfterUpload = newGetRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID); getRequestAfterUpload.addParameter("v", "custom:(reservedIdentifiers)"); SimpleObject identifiersAfterUpload = deserialize(handle(getRequestAfterUpload)); <START> assertThat(identifiersAfterUpload.get("reservedIdentifiers").toString(), allOf( <END> containsString("100"), containsString("200"), containsString("300"), containsString("400"))); }</code><technical_language>failure caused identifiers 1,2,3,4 instead of 100,200,300,400</technical_language>

Target:
public void shouldUploadReservedIdentifiers() throws Exception { String reservedIdentifiers = "{\"reservedIdentifiers\": \"1,2,3,4\"}"; MockHttpServletRequest getRequest = newGetRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID); getRequest.addParameter("v", "custom:(reservedIdentifiers)"); SimpleObject initialIdentifiers = deserialize(handle(getRequest)); assertEquals("[]", initialIdentifiers.get("reservedIdentifiers").toString()); MockHttpServletRequest postRequest = newPostRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID, reservedIdentifiers); SimpleObject uploadResult = deserialize(handle(postRequest)); assertThat( uploadResult.toString(), containsString(SEQUENTIAL_IDENTIFIER_SOURCE_UUID) ); MockHttpServletRequest getRequestAfterUpload = newGetRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID); getRequestAfterUpload.addParameter("v", "custom:(reservedIdentifiers)"); SimpleObject identifiersAfterUpload = deserialize(handle(getRequestAfterUpload)); assertThat(identifiersAfterUpload.get("reservedIdentifiers").toString(), allOf( containsString("1"), containsString("2"), containsString("3"), containsString("4"))); }
Source:
<code>private void executeHBaseShell(String cmd, Consumer<String> stdoutProcessor) throws IOException { <START> try (AutoClosableProcess autoClosableProcess = AutoClosableProcess .create(hbaseDir.resolve(Paths.get("bin", "hbase")).toString(), "shell") .setStdoutProcessor(stdoutProcessor) .runNonBlocking()) { <END> try (PrintStream printStream = new PrintStream(autoClosableProcess.getProcess().getOutputStream(), true, StandardCharsets.UTF_8.name())) { LOG.info("Executing hbase shell: {}", cmd); printStream.println(cmd); } try { autoClosableProcess.getProcess().waitFor(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }</code><technical_language>Simplify java AutoClosableProcess .create(hbaseDir.resolve(Paths.get("bin", "hbase")).toString(), "shell") .setStdoutProcessor(stdoutProcessor) .setStdInputs(cmd) .runBlocking();</technical_language>

Target:
private void executeHBaseShell(String cmd, Consumer<String> stdoutProcessor) throws IOException { AutoClosableProcess .create(hbaseDir.resolve(Paths.get("bin", "hbase")).toString(), "shell") .setStdoutProcessor(stdoutProcessor) .setStdInputs(cmd) .runBlocking(); }
Source:
<code>public void testRestoreOfAutoCommit() throws Exception { conn.setAutoCommit(false); Xid xid = new CustomXid(14); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertTrue(!conn.getAutoCommit()); <START> conn.setAutoCommit(true); <END> xid = new CustomXid(15); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertTrue(conn.getAutoCommit()); conn.setAutoCommit(true); xid = new CustomXid(16); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.start(xid, XAResource.TMJOIN); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertTrue(conn.getAutoCommit()); }</code><technical_language>please spaces, tabs</technical_language>

Target:
public void testRestoreOfAutoCommit() throws Exception { conn.setAutoCommit(false); Xid xid = new CustomXid(14); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertFalse("XaResource should have restored connection autocommit mode after commit or rollback to the initial state.", conn.getAutoCommit()); conn.setAutoCommit(true); xid = new CustomXid(15); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertTrue("XaResource should have restored connection autocommit mode after commit or rollback to the initial state.", conn.getAutoCommit()); }
Source:
<code>BeaconGenesis(Json json) { <START> super(json.parentHash(), json.randaoReveal(), json.mainChainRef(), EMPTY, SLOT, new ArrayList<>()); <END> this.timestamp = json.timestamp(); this.initialValidators = json.validatorSet(); }</code><technical_language>Collections.emptyList() instead</technical_language>

Target:
BeaconGenesis(Json json) { super(json.parentHash(), json.randaoReveal(), json.mainChainRef(), EMPTY, SLOT, Collections.emptyList()); this.timestamp = json.timestamp(); this.initialValidators = json.validatorSet(); }
Source:
<code>public static PDataType HiveType2PDataType(String hiveType) throws SerDeException { final String lctype = hiveType.toLowerCase(); <START> if ("string".equals(lctype)) { <END> return PVarchar.INSTANCE; }else if ("varchar".equals(lctype)) { return PVarchar.INSTANCE; }else if ("char".equals(lctype)) { return PChar.INSTANCE; } else if ("float".equals(lctype)) { return PFloat.INSTANCE; } else if ("double".equals(lctype)) { return PDouble.INSTANCE; } else if ("boolean".equals(lctype)) { return PBoolean.INSTANCE; } else if ("tinyint".equals(lctype)) { return PSmallint.INSTANCE; } else if ("smallint".equals(lctype)) { return PSmallint.INSTANCE; } else if ("int".equals(lctype)) { return PInteger.INSTANCE; } else if ("bigint".equals(lctype)) { return PLong.INSTANCE; } else if ("timestamp".equals(lctype)) { return PTimestamp.INSTANCE; } else if ("binary".equals(lctype)) { return PBinary.INSTANCE; } else if ("date".equals(lctype)) { return PDate.INSTANCE; } throw new SerDeException("Phoenix unrecognized column type: " + hiveType); }</code><technical_language>earlier one</technical_language>

Target:
public static PDataType HiveType2PDataType(String hiveType) throws SerDeException { final String lctype = hiveType.toLowerCase(); if ("string".equals(lctype)) { return PVarchar.INSTANCE; }else if ("varchar".equals(lctype)) { return PVarchar.INSTANCE; }else if ("char".equals(lctype)) { return PChar.INSTANCE; } else if ("float".equals(lctype)) { return PFloat.INSTANCE; } else if ("double".equals(lctype)) { return PDouble.INSTANCE; } else if ("boolean".equals(lctype)) { return PBoolean.INSTANCE; } else if ("tinyint".equals(lctype)) { return PSmallint.INSTANCE; } else if ("smallint".equals(lctype)) { return PSmallint.INSTANCE; } else if ("int".equals(lctype)) { return PInteger.INSTANCE; } else if ("bigint".equals(lctype)) { return PLong.INSTANCE; } else if ("timestamp".equals(lctype)) { return PTimestamp.INSTANCE; } else if ("binary".equals(lctype)) { return PBinary.INSTANCE; } else if ("decimal".equals(lctype)) { return PDecimal.INSTANCE; } else if ("date".equals(lctype)) { return PDate.INSTANCE; } throw new SerDeException("Phoenix unrecognized column type: " + hiveType); }
Source:
<code><START> public void convert_not_approved() throws IOException { <END> Result sourceDataset = documentEntity(EXT_IDENTIFIERS); when(fieldApprover.approve(any())).thenReturn(false); DataSetReference metadata = converter.convert(sourceDataset); assertNotNull(metadata); assertEquals(ID, metadata.getId()); assertEquals("unspecified", metadata.getReferenceType()); assertEquals("", metadata.getIdForGivenType()); assertEquals(1, metadata.getCreatorNames().size()); assertEquals(FULL_NAME, metadata.getCreatorNames().get(0)); assertEquals(0, metadata.getTitles().size()); assertNull(metadata.getDescription()); assertNull(metadata.getPublisher()); assertNull(metadata.getPublicationYear()); assertEquals(0, metadata.getFormats().size()); assertEquals("resource_type", metadata.getResourceTypeValue()); assertNull(metadata.getAlternateIdentifiers()); }</code><technical_language>Exception is thrown</technical_language>

Target:
public void convert_not_approved() { Result sourceDataset = documentEntity(EXT_IDENTIFIERS); when(fieldApprover.approve(any())).thenReturn(false); DataSetReference metadata = converter.convert(sourceDataset); assertNotNull(metadata); assertEquals(ID, metadata.getId()); assertEquals("unspecified", metadata.getReferenceType()); assertEquals("", metadata.getIdForGivenType()); assertEquals(1, metadata.getCreatorNames().size()); assertEquals(FULL_NAME, metadata.getCreatorNames().get(0)); assertEquals(0, metadata.getTitles().size()); assertNull(metadata.getDescription()); assertNull(metadata.getPublisher()); assertNull(metadata.getPublicationYear()); assertEquals(0, metadata.getFormats().size()); assertEquals("resource_type", metadata.getResourceTypeValue()); assertNull(metadata.getAlternateIdentifiers()); }
Source:
<code>public Iterator<ProcessStatusInterval> getKernelStatuses(ICalledFunction function, Collection<Long> times) { IHostModel model = ModelManager.getModelFor(getHostId(function.getStart())); int resolution = 1; if (!times.isEmpty()) { List<Long> filtered = new ArrayList<>(); <START> times.forEach(t <END> -> { if (t >= function.getStart() && t <= function.getEnd()) { filtered.add(t); } }); Collections.sort(filtered); resolution = filtered.size() > 0 ? (int) (filtered.get(filtered.size() - 1) - filtered.get(0) / filtered.size()) : resolution; return model.getThreadStatusIntervals(function.getThreadId(), function.getStart(), function.getEnd(), resolution); } return model.getThreadStatusIntervals(function.getThreadId(), function.getStart(), function.getEnd(), resolution); }</code><technical_language>avoid forEach lambdas if this is in hotpath, jvm difficulty optimizing it, else leave this</technical_language>

Target:
public Iterable<ProcessStatusInterval> getKernelStatuses(ICalledFunction function, Collection<Long> times) { IHostModel model = ModelManager.getModelFor(getHostId(function.getStart())); int resolution = 1; if (!times.isEmpty()) { List<Long> filtered = new ArrayList<>(); for (Long time : times) { if (function.intersects(time)) { filtered.add(time); } } Collections.sort(filtered); resolution = !filtered.isEmpty() ? (int) (filtered.get(filtered.size() - 1) - filtered.get(0) / filtered.size()) : resolution; return model.getThreadStatusIntervals(function.getThreadId(), function.getStart(), function.getEnd(), resolution); } return model.getThreadStatusIntervals(function.getThreadId(), function.getStart(), function.getEnd(), resolution); }
Source:
<code>public boolean canEnable() throws JavaModelException { if (!super.canEnable() || fJavaElements.length == 0) return false; for (IJavaElement <START> fJavaElement : <END> fJavaElements) { if (fJavaElement instanceof IMember) { IMember member= (IMember) fJavaElement; if (member.isBinary() && member.getSourceRange() == null) return false; } } return true; }</code><technical_language>rename javaElement</technical_language>

Target:
public boolean canEnable() throws JavaModelException { if (!super.canEnable() || fJavaElements.length == 0) return false; for (IJavaElement javaElement : fJavaElements) { if (javaElement instanceof IMember) { IMember member= (IMember) javaElement; if (member.isBinary() && member.getSourceRange() == null) return false; } } return true; }
Source:
<code>public String render(final GetTapeFailureResult obj) { final DetailedTapeFailureList result = obj.getResult(); if( (result == null) || (null == result.getDetailedTapeFailures()) || (result.getDetailedTapeFailures().size() == 0) ) { <START> return "No taoe failures on remote appliance"; <END> } return "" + result.getDetailedTapeFailures().size() + " Tape Failures:\n" + ASCIITable.getInstance().getTable(getHeaders(), formatBucketList(result)); }</code><technical_language>taoe tape</technical_language>

Target:
public String render(final GetTapeFailureResult obj) { final DetailedTapeFailureList result = obj.getResult(); if( (result == null) || (null == result.getDetailedTapeFailures()) || (result.getDetailedTapeFailures().size() == 0) ) { return "No tape failures on remote appliance"; } return "" + result.getDetailedTapeFailures().size() + " Tape Failures:\n" + ASCIITable.getInstance().getTable(getHeaders(), formatBucketList(result)); }
Source:
<code>public void removeQuotaFromCache(Guid storagePoolId, Guid quotaId) { if (!storagePoolQuotaMap.containsKey(storagePoolId)) { return; <START> } <END> synchronized (storagePoolQuotaMap.get(storagePoolId)) { storagePoolQuotaMap.get(storagePoolId).remove(quotaId); } }</code><technical_language>thread safe, read write locks</technical_language>

Target:
public void removeQuotaFromCache(Guid storagePoolId, Guid quotaId) { lock.readLock().lock(); try { if (!storagePoolQuotaMap.containsKey(storagePoolId)) { return; } synchronized (storagePoolQuotaMap.get(storagePoolId)) { storagePoolQuotaMap.get(storagePoolId).remove(quotaId); } } finally { lock.readLock().unlock(); } }
Source:
<code>public void setOwner(PagingStore owner) { <START> new Exception("Owner - " + owner).printStackTrace(); <END> this.owner = owner; }</code><technical_language>Debug stacktrace leftover</technical_language>

Target:
public void setOwner(PagingStore owner) { this.owner = owner; }
Source:
<code>public void unsubscribe(StompConnection connection, String subscriptionID, String durableSubscriberName) throws Exception { StompSession stompSession = getSession(connection); <START> String clientID = (connection.getClientID() != null) ? connection.getClientID() : null; <END> boolean unsubscribed = stompSession.unsubscribe(subscriptionID, durableSubscriberName, clientID); if (!unsubscribed) { throw new ActiveMQStompException(connection, "Cannot unsubscribe as no subscription exists for id: " + subscriptionID); } }</code><technical_language>null check redundant, of connection.getClientID()</technical_language>

Target:
public void unsubscribe(StompConnection connection, String subscriptionID, String durableSubscriberName) throws Exception { StompSession stompSession = getSession(connection); boolean unsubscribed = stompSession.unsubscribe(subscriptionID, durableSubscriberName, connection.getClientID()); if (!unsubscribed) { throw new ActiveMQStompException(connection, "Cannot unsubscribe as no subscription exists for id: " + subscriptionID); } }
Source:
<code>public ChassisMinimumDistance(Chassis chassis, double distance, double speed, ChassisConstant fallbackCommand, CustomEncoder... encoders) <START> { <END> super(chassis, 0.0, speed, 0.0, Double.MAX_VALUE); this.encoders = encoders; this.distance = distance; this.fallbackCommand = fallbackCommand; initialDistances = new double[encoders.length]; }</code><technical_language>format</technical_language>

Target:
public ChassisMinimumDistance(Chassis chassis, double distance, double speed, ChassisConstant fallbackCommand, CustomEncoder... encoders) { this("Chassis Minimum Distance", chassis, distance, speed, fallbackCommand, encoders); }
Source:
<code>public boolean addAll(Collection<? extends TileEntity> tileEntities) { <START> for (Iterator<? extends TileEntity> iterator = tileEntities.iterator(); iterator.hasNext();) { <END> add(iterator.next()); } return true; }</code><technical_language>a for loop</technical_language>

Target:
public boolean addAll(Collection<? extends TileEntity> tileEntities) { for (TileEntity tileEntity : tileEntities) { add(tileEntity); } return true; }
Source:
<code>private void cleanupFailedImportVM(final UserVm userVm) { if (userVm == null) { return; } VirtualMachineProfile profile = new VirtualMachineProfileImpl(userVm); volumeDao.deleteVolumesByInstance(userVm.getId()); try { networkOrchestrationService.release(profile, true); } catch (Exception e) { <START> nicDao.removeNicsForInstance(userVm.getId()); <END> } vmDao.remove(userVm.getId()); }</code><technical_language>log a warning?</technical_language>

Target:
private void cleanupFailedImportVM(final UserVm userVm) { if (userVm == null) { return; } VirtualMachineProfile profile = new VirtualMachineProfileImpl(userVm); volumeDao.deleteVolumesByInstance(userVm.getId()); try { networkOrchestrationService.release(profile, true); } catch (Exception e) { LOGGER.error(String.format("Unable to release NICs for unsuccessful import unmanaged VM: %s", userVm.getInstanceName()), e); nicDao.removeNicsForInstance(userVm.getId()); } vmDao.remove(userVm.getId()); }
Source:
<code>public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(); } beginScan(presentStream, null); QualifyingSet input = inputQualifyingSet; QualifyingSet output = outputQualifyingSet; int end = input.getEnd(); int rowsInRange = end - posInRowGroup; int[] inputPositions = input.getPositions(); if (filter != null) { output.reset(rowsInRange); } ensureValuesCapacity(end, false); if (dataStream == null) { processAllNulls(); endScan(presentStream); return; } int nextActive = inputPositions[0]; int activeIdx = 0; int toSkip = 0; for (int i = 0; i < rowsInRange; i++) { if (i + posInRowGroup == nextActive) { if (presentStream != null && !present[i]) { if (filter == null || filter.testNull()) { if (filter != null) { output.append(i + posInRowGroup, activeIdx); } addNullResult(); } } else { if (toSkip > 0) { dataStream.skip(toSkip); } byte value = dataStream.next(); if (filter != null) { if (filter.testLong(value)) { output.append(i + posInRowGroup, activeIdx); addResult(value); } } else { addResult(value); } } if (++activeIdx == input.getPositionCount()) { toSkip = countPresent(i + 1, end - posInRowGroup); break; } nextActive = inputPositions[activeIdx]; if (outputChannelSet && numResults > resultSizeBudget) { <START> batchTooLarge(activeIdx); <END> } continue; } else { if (presentStream == null || present[i]) { toSkip++; } } } if (toSkip > 0) { dataStream.skip(toSkip); } endScan(presentStream); }</code><technical_language>clear this method return exception caller throw: throw batchTooLarge();</technical_language>

Target:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(); } beginScan(presentStream, null); QualifyingSet input = inputQualifyingSet; QualifyingSet output = outputQualifyingSet; int end = input.getEnd(); int rowsInRange = end - posInRowGroup; int[] inputPositions = input.getPositions(); if (filter != null) { output.reset(rowsInRange); } ensureValuesCapacity(end, false); if (dataStream == null) { processAllNulls(); endScan(presentStream); return; } int nextActive = inputPositions[0]; int activeIdx = 0; int toSkip = 0; for (int i = 0; i < rowsInRange; i++) { if (i + posInRowGroup == nextActive) { if (presentStream != null && !present[i]) { if (filter == null || filter.testNull()) { if (filter != null) { output.append(i + posInRowGroup, activeIdx); } addNullResult(); } } else { if (toSkip > 0) { dataStream.skip(toSkip); } byte value = dataStream.next(); if (filter != null) { if (filter.testLong(value)) { output.append(i + posInRowGroup, activeIdx); addResult(value); } } else { addResult(value); } } if (++activeIdx == input.getPositionCount()) { toSkip = countPresent(i + 1, end - posInRowGroup); break; } nextActive = inputPositions[activeIdx]; if (outputChannelSet && numResults > resultSizeBudget) { throw batchTooLarge(); } continue; } else { if (presentStream == null || present[i]) { toSkip++; } } } if (toSkip > 0) { dataStream.skip(toSkip); } endScan(presentStream); }
Source:
<code>public int hashCode() { return Arrays.hashCode(new Object[] {errorCode, message, fields}); <START> } <END></code><technical_language>Definitively a big issue try gc friendly I enroll hash calculation avoid creating a new array iterator (inside Arrays.hashCode) for call</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((errorCode == null) ? 0 : errorCode.hashCode()); result = prime * result + ((fields == null) ? 0 : fields.hashCode()); result = prime * result + ((message == null) ? 0 : message.hashCode()); return result; }
Source:
<code>private void verifyCachesAndGroups(IgniteEx ignite, Collection<String> cacheNames) { Map<String, DynamicCacheDescriptor> caches = ignite.context().cache().cacheDescriptors(); <START> assertEquals(3, caches.size()); <END> assertTrue(caches.keySet().contains(GridCacheUtils.UTILITY_CACHE_NAME)); assertTrue(caches.keySet().containsAll(cacheNames)); Map<Integer, CacheGroupDescriptor> groups = ignite.context().cache().cacheGroupDescriptors(); assertEquals(2, groups.size()); boolean defaultGroupFound = false; boolean staticCachesGroupFound = false; for (CacheGroupDescriptor grpDesc : groups.values()) { if (grpDesc.cacheOrGroupName().equals(GridCacheUtils.UTILITY_CACHE_NAME)) defaultGroupFound = true; else if (grpDesc.cacheOrGroupName().equals(GROUP_WITH_STATIC_CACHES)) staticCachesGroupFound = true; } assertTrue(String.format("Default group found: %b, static group found: %b", defaultGroupFound, staticCachesGroupFound), defaultGroupFound && staticCachesGroupFound); }</code><technical_language>I safer cacheNames.size() + 1 instead of hardcoded "3"</technical_language>

Target:
private void verifyCachesAndGroups(IgniteEx ignite, Collection<String> cacheNames) { Map<String, DynamicCacheDescriptor> caches = ignite.context().cache().cacheDescriptors(); assertEquals(cacheNames.size() + 1, caches.size()); assertTrue(caches.keySet().contains(GridCacheUtils.UTILITY_CACHE_NAME)); assertTrue(caches.keySet().containsAll(cacheNames)); Map<Integer, CacheGroupDescriptor> groups = ignite.context().cache().cacheGroupDescriptors(); assertEquals(2, groups.size()); boolean defaultGroupFound = false; boolean staticCachesGroupFound = false; for (CacheGroupDescriptor grpDesc : groups.values()) { if (grpDesc.cacheOrGroupName().equals(GridCacheUtils.UTILITY_CACHE_NAME)) defaultGroupFound = true; else if (grpDesc.cacheOrGroupName().equals(GROUP_WITH_STATIC_CACHES)) staticCachesGroupFound = true; } assertTrue(String.format("Default group found: %b, static group found: %b", defaultGroupFound, staticCachesGroupFound), defaultGroupFound && staticCachesGroupFound); }
Source:
<code>public void testInputCustomVariable() { <START> VariableDeclaration declaration = mock(VariableDeclaration.class); <END> org.eclipse.bpmn2.Property property = mock(org.eclipse.bpmn2.Property.class); when(declaration.getTypedIdentifier()).thenReturn(property); InitializedVariable.InitializedInputVariable input = InitializedVariable.createCustomInput("parent", declaration, "#{expression}"); assertTrue(input instanceof InitializedVariable.InputExpression); input = InitializedVariable.createCustomInput("parent", declaration, "constant"); assertTrue(input instanceof InitializedVariable.InputConstant); }</code><technical_language>Is a need mock VariableDeclaration object? In general, for domain objects (with logic around) is need mock instances, test more complex... If possible, please try new operator, create "real" instance, if necessary, spy it</technical_language>

Target:
public void testInputCustomVariable() { VariableDeclaration declaration = new VariableDeclaration("Identifier", "type"); InitializedVariable.InitializedInputVariable input = createCustomInput("parent", declaration, "#{expression}"); assertTrue(input instanceof InitializedVariable.InputExpression); input = createCustomInput("parent", declaration, "constant"); assertTrue(input instanceof InitializedVariable.InputConstant); }
Source:
<code>protected void removeDoneFileQuietly(String dataFileName) { try { <START> String doneFileName = StringUtils.substringBeforeLast(dataFileName, CuFPConstants.XML_FILE_EXTENSION) <END> + GeneralLedgerConstants.BatchFileSystem.DONE_FILE_EXTENSION; if (!FileUtils.deleteQuietly(new File(doneFileName))) { LOG.error("removeDoneFileQuietly: Could not delete .done file: " + doneFileName); } } catch (RuntimeException e) { LOG.error("removeDoneFileQuietly: Could not delete .done file for accounting document XML", e); } }</code><technical_language>batch utility service a function remove a done file passing tin data file name</technical_language>

Target:
protected void removeDoneFileQuietly(String dataFileName) { try { fileStorageService.removeDoneFiles(Collections.singletonList(dataFileName)); } catch (RuntimeException e) { LOG.error("removeDoneFileQuietly: Could not delete .done file for accounting document XML", e); } }
Source:
<code>protected void testAccessControl_giverNotModeratedStudent_inaccessible() { ______TS("Instructor moderates student's response, but response not given by moderated student, " + "should not be accessible"); loginAsInstructor(instructor1OfCourse1.googleId); <START> <END> assertEquals(FeedbackParticipantType.STUDENTS, logic.getFeedbackQuestion(testModerateResponse.getFeedbackQuestionId()).getGiverType()); assertNotEquals(student1InCourse1.getEmail(), testModerateResponse.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructor1OfCourse1.getEmail()); String[] moderatedStudentSubmissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, testModerateResponse.getId(), Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), }; verifyCannotAccess(updateRequest, moderatedStudentSubmissionParams); }</code><technical_language>Similar other tests, assert a feedback response ID "randomNonExistId" exist</technical_language>

Target:
protected void testAccessControl_giverNotModeratedStudent_inaccessible() { ______TS("Instructor moderates student's response, but response not given by moderated student, " + "should not be accessible"); StudentAttributes student2InCourse1 = typicalBundle.students.get("student2InCourse1"); StudentAttributes student5InCourse1 = typicalBundle.students.get("student5InCourse1"); FeedbackSessionAttributes session = typicalBundle.feedbackSessions.get("session1InCourse1"); FeedbackQuestionAttributes testModerateQuestion = logic.getFeedbackQuestion( session.getFeedbackSessionName(), session.getCourseId(), 2); FeedbackResponseAttributes testModerateResponse = logic.getFeedbackResponse(testModerateQuestion.getId(), student2InCourse1.getEmail(), student5InCourse1.getEmail()); loginAsInstructor(instructor1OfCourse1.googleId); assertEquals(FeedbackParticipantType.STUDENTS, logic.getFeedbackQuestion(testModerateResponse.getFeedbackQuestionId()).getGiverType()); assertNotEquals(student1InCourse1.getEmail(), testModerateResponse.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructor1OfCourse1.getEmail()); String[] moderatedStudentSubmissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, testModerateResponse.getId(), Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), }; verifyCannotAccess(updateRequest, moderatedStudentSubmissionParams); }
Source:
<code>public SendEventBatchTest(EventHubsPerfStressOptions options) throws IllegalStateException { super(options); CreateBatchOptions createBatchOptions = getBatchOptions(options); if (createBatchOptions != null) { eventDataBatch = eventHubProducerClient.createBatch(createBatchOptions); } else { eventDataBatch = eventHubProducerClient.createBatch(); } for (int i = 0; i < options.getEvents(); i++) { <START> if (!eventDataBatch.tryAdd(new EventData("static event"))) { <END> throw new IllegalStateException(String.format( "Batch can only fit %d number of messages with batch size of %d ", options.getCount(), options.getSize())); } } }</code><technical_language>new EventData() created added batch multiple times instead of creating multiple EventData instances</technical_language>

Target:
public SendEventBatchTest(EventHubsPerfStressOptions options) throws IllegalStateException { super(options); createBatchOptions = getBatchOptions(options); }
Source:
<code>public void stop() { logApplicationLifecycle("Stopping"); ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopping"); sensors().set(SERVICE_UP, false); setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPING); try { doStop(); } catch (Exception e) { setExpectedStateAndRecordLifecycleEvent(Lifecycle.ON_FIRE); log.warn("Error stopping application " + this + " (rethrowing): "+e); throw Exceptions.propagate(e); } ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopped"); setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPED); if (getParent()==null) { synchronized (this) { <START> Location location = Iterables.getFirst(getLocations(), null); <END> getEntityManager().unmanage(this); unmanageProvisionerIfNotUsed(location); } } logApplicationLifecycle("Stopped"); }</code><technical_language>getLocations return empty Collection? If so, default of null throw a null pointer exception in unmanageProvisionerIfNotUsed</technical_language>

Target:
public void stop() { logApplicationLifecycle("Stopping"); ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopping"); sensors().set(SERVICE_UP, false); setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPING); try { doStop(); } catch (Exception e) { setExpectedStateAndRecordLifecycleEvent(Lifecycle.ON_FIRE); log.warn("Error stopping application " + this + " (rethrowing): "+e); throw Exceptions.propagate(e); } ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopped"); setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPED); if (getParent()==null) { synchronized (this) { Location machineProvisioningLocation = Iterables.getFirst(getLocations(), null); getEntityManager().unmanage(this); if (machineProvisioningLocation != null) { unmanageProvisionerIfNotUsed(machineProvisioningLocation); } } } logApplicationLifecycle("Stopped"); }
Source:
<code>public ServerImpl(Server server) { <START> this(server.getRef(), server.getProtocol(), server.getAddress(), server.getUrl(), server.getPort(), (ServerPropertiesImpl) server.getProperties()); <END> }</code><technical_language>avoid casting prevents class cast exception. Please rewrite constructor instead</technical_language>

Target:
public ServerImpl(Server server) { this(server.getRef(), server.getProtocol(), server.getAddress(), server.getUrl(), server.getProperties()); }
Source:
<code>public AssertionType getAssertion(Object obj) { try { if (obj != null) { if (obj instanceof AssertionType) { return (AssertionType) obj; } else { return getAssertionType(obj.getClass().getDeclaredMethods(), obj); } } } catch (IllegalAccessException | InvocationTargetException ex) { <START> LOG.info("Unable to extract AssertionType from Object", ex); <END> } return null; }</code><technical_language>log object well? object's class. I consider this "Error" level, Info</technical_language>

Target:
public AssertionType getAssertion(Object obj) { try { if (obj != null) { if (obj instanceof AssertionType) { return (AssertionType) obj; } else { return getAssertionType(obj.getClass().getDeclaredMethods(), obj); } } } catch (IllegalAccessException | InvocationTargetException ex) { LOG.error("Unable to extract AssertionType from Object: {}", ex.getLocalizedMessage(), ex); } return null; }
Source:
<code>public void testSourceFileIsSourceFile() { <START> assertTrue(policy.isStudentSourceFile(Paths.get("src/hello.rs"))); <END> }</code><technical_language>NIT: Paths.get("src", "hello.rs")</technical_language>

Target:
public void testSourceFileIsSourceFile() { assertTrue(policy.isStudentSourceFile(Paths.get("src", "hello.rs"))); }
Source:
<code><START> public void cleanUp() throws Exception { <END> super.cleanup(); }</code><technical_language>Need restore configurations serverConfigurationManager.restoreToLastConfiguration() changes done configuration files reverted</technical_language>

Target:
public void cleanUp() throws Exception { super.cleanup(); serverConfigurationManager.restoreToLastConfiguration(); }
Source:
<code>void onPlayPause() { if(controller == null) { return; } <START> controller.init(); <END> controller.playPause(); }</code><technical_language>Init called single time constructing controller. is done in OnStart. Please add a space if (</technical_language>

Target:
void onPlayPause() { if (controller == null) { return; } controller.playPause(); }
Source:
<code>public static boolean delete(File file) <START> { <END> Assert.notNull(file, "File to delete must not be null."); return delete(file, false); }</code><technical_language>This replaced this code: <LINK_0></technical_language>

Target:
public static boolean delete(File file) throws IOException { Assert.notNull(file, "File to delete must not be null."); return delete(file, false); }
Source:
<code>public void setDiskState(HardwareState state, boolean allowChangesThroughClusterMap) { <START> this.allowChangesThroughClustermap = allowChangesThroughClusterMap; <END> this.state = state; }</code><technical_language>ah I this need synchronized other methods. Add keyword synchronized setDiskState(), onDiskError() onDiskOk()</technical_language>

Target:
public synchronized void setDiskState(HardwareState state, boolean allowChangesThroughClusterMap) { this.allowChangesThroughClustermap = allowChangesThroughClusterMap; this.state = state; }
Source:
<code>private void validateCertificateChain(Certificate[] certs) throws KeyStoreException, CertificateExpiredException, CertificateNotYetValidException { if(certs == null) { throw new KeyStoreException("Empty chain"); } int len = certs.length; Date nextMonth = new Date(); nextMonth.setMonth((nextMonth.getMonth()%12) + 1); for (int i = 0; i < len; i++) { if(certs[i].getType().equals("X.509")) { X509Certificate xCert = (X509Certificate)certs[i]; boolean valid = false; try { xCert.checkValidity(); valid = true; xCert.checkValidity(nextMonth); } catch (CertificateExpiredException e) { if(!valid) { <START> throw new CertificateExpiredException("The folowing certificate has expired\n" <END> + xCert); } logger.warn("The following certificate will expire soon\n" + xCert); } catch (CertificateNotYetValidException e) { throw new CertificateNotYetValidException( "The following certificate is not yet valid\n" + xCert); } } } }</code><technical_language>typo "folowing" - do put newlines in logs... ther harder parse (f.ex: a grep show certificate message is about)</technical_language>

Target:
private void validateCertificateChain(Certificate[] certs) throws KeyStoreException, CertificateExpiredException, CertificateNotYetValidException { if(certs == null) { throw new KeyStoreException("Empty chain"); } int len = certs.length; Date nextMonth = new Date(); nextMonth.setMonth((nextMonth.getMonth()%12) + 1); for (int i = 0; i < len; i++) { if(certs[i].getType().equals("X.509")) { X509Certificate xCert = (X509Certificate)certs[i]; xCert.checkValidity(); try { xCert.checkValidity(nextMonth); } catch (CertificateExpiredException e) { logger.warn("The following certificate will expire soon " + xCert); } } } }
Source:
<code>public void gc() { if (garbageSendingDeque.size() == SENDING_QUEUE_CAPACITY) { log.info("Drains sending queue"); <START> sendGarbage(); <END> } if (garbageSendingDeque.size() == SENDING_QUEUE_CAPACITY) { log.info("Stop drains receiving queue because sending queue is full"); return; } Map<Long, SMRGarbageEntry> addressToGarbage = new HashMap<>(); int drainCount = 0; SMRGarbageEntry garbageEntry; while ((garbageEntry = garbageReceivingQueue.poll()) != null && drainCount < BATCH_SIZE) { long globalAddress = garbageEntry.getGlobalAddress(); if (!addressToGarbage.containsKey(globalAddress)) { addressToGarbage.put(globalAddress, garbageEntry); } else { addressToGarbage.get(globalAddress).merge(garbageEntry); } ++drainCount; } if (drainCount == 0) { log.trace("Garbage Informer has nothing to send"); } GarbageBatch garbageBatch = new GarbageBatch(addressToGarbage.values(), lastMarkers, rt); lastMarkers.clear(); garbageSendingDeque.offer(garbageBatch); sendGarbage(); }</code><technical_language>need synchronized</technical_language>

Target:
public synchronized void gc() { if (garbageSendingDeque.size() >= SENDING_QUEUE_CAPACITY) { log.debug("GarbageInformer: Drains sending queue"); sendGarbage(); } if (garbageSendingDeque.size() >= SENDING_QUEUE_CAPACITY) { log.debug("GarbageInformer: Stop drains receiving queue because sending queue is full"); return; } Map<UUID, Long> lastMarkers = new HashMap<>(); Map<Long, SMRGarbageEntry> addressToGarbage = new HashMap<>(); List<SMRGarbageEntry> garbageEntries = new ArrayList<>(); garbageReceivingQueue.drainTo(garbageEntries, BATCH_SIZE); if (garbageEntries.isEmpty()) { log.trace("Garbage Informer has nothing to send"); return; } for (SMRGarbageEntry garbageEntry : garbageEntries) { long globalAddress = garbageEntry.getGlobalAddress(); if (!addressToGarbage.containsKey(globalAddress)) { addressToGarbage.put(globalAddress, garbageEntry); } else { addressToGarbage.get(globalAddress).merge(garbageEntry); } } GarbageBatch garbageBatch = new GarbageBatch(addressToGarbage.values(), lastMarkers); garbageSendingDeque.offer(garbageBatch); sendGarbage(); }
Source:
<code>private boolean isChildObjectRemoved(Set<Object> children, Set<Object> childrenFromTreeContextEntry, int notificationType) { <START> return !children.containsAll(childrenFromTreeContextEntry) && (Notification.REMOVE == notificationType || Notification.REMOVE_MANY == notificationType); <END> }</code><technical_language>turn this around? I guess type check is faster a containsAll</technical_language>

Target:
private boolean isChildObjectRemoved(Set<Object> children, Set<Object> childrenFromTreeContextEntry, int notificationType) { return (Notification.REMOVE == notificationType || Notification.REMOVE_MANY == notificationType) && !children.containsAll(childrenFromTreeContextEntry); }
Source:
<code>private void validateParameter(String name, String value) { Class<? extends IParameterValidator> validators[] = wrappedParameter.validateWith(); <START> if (validators != null && validators.length>0) { <END> for(final Class<? extends IParameterValidator> validator: validators) { validateParameter(this, validator, name, value); } } }</code><technical_language>Spaces: length > 0</technical_language>

Target:
private void validateParameter(String name, String value) { final Class<? extends IParameterValidator> validators[] = wrappedParameter.validateWith(); if (validators != null && validators.length > 0) { for(final Class<? extends IParameterValidator> validator: validators) { validateParameter(this, validator, name, value); } } }
Source:
<code>static long Proc (long handle, long user_data) { long webView = handle; if (OS.G_TYPE_CHECK_INSTANCE_TYPE (handle, WebKitGTK.webkit_download_get_type ())) { webView = <START> WebKitGTK.webkit_download_get_web_view(handle); <END> } Browser browser = FindBrowser (webView); if (browser == null) return 0; WebKit webkit = (WebKit)browser.webBrowser; return webkit.webViewProc (handle, user_data); }</code><technical_language>this is a webkit2 function. I sleep night if this if statement a 'if (WEBKIT2 ...) guard of sort</technical_language>

Target:
static long Proc (long handle, long user_data) { long webView = handle; if (WEBKIT2 && OS.G_TYPE_CHECK_INSTANCE_TYPE (handle, WebKitGTK.webkit_download_get_type ())) { webView = WebKitGTK.webkit_download_get_web_view(handle); } Browser browser = FindBrowser (webView); if (browser == null) return 0; WebKit webkit = (WebKit)browser.webBrowser; return webkit.webViewProc (handle, user_data); }