auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void parse(byte[] vmdkFileContent) throws IOException { BufferedReader in = null; try { in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkFileContent),"UTF-8")); String line; while ((line = in.readLine()) != null) { line = line.trim(); if (line.isEmpty()) { continue; } if (line.charAt(0) == '#') { continue; } final String[] tokens = line.split("="); if (tokens.length == 2) { final String name = tokens[0].trim(); String value = tokens[1].trim(); if (value.charAt(0) == '\"') { value = value.substring(1, value.length() - 1); } _properties.put(name, value); } else { if (line.startsWith("RW")) { final int startPos = line.indexOf('\"'); final int endPos = line.lastIndexOf('\"'); assert startPos > 0; assert endPos > 0; _baseFileName = line.substring(startPos + 1, endPos); } else { s_logger.warn("Unrecognized vmdk line content: " + line); } } } } finally { if (in != null) { in.close(); } } }

Target:
public void parse(byte[] vmdkFileContent) throws IOException { try (BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkFileContent),"UTF-8"));) { String line; while ((line = in.readLine()) != null) { line = line.trim(); if (line.isEmpty() || line.charAt(0) == '#') { continue; } final String[] tokens = line.split("="); if (tokens.length == 2) { final String name = tokens[0].trim(); String value = tokens[1].trim(); if (value.charAt(0) == '\"') { value = value.substring(1, value.length() - 1); } _properties.put(name, value); } else { if (line.startsWith("RW")) { final int startPos = line.indexOf('\"'); final int endPos = line.lastIndexOf('\"'); Preconditions.checkState(startPos > 0); Preconditions.checkState(startPos < endPos); _baseFileName = line.substring(startPos + 1, endPos); } else { s_logger.warn("Unrecognized vmdk line content: " + line); } } } } }
Source:
public static int compareValues(Object value1, Object value2) { if (value1 instanceof Comparable && value2 instanceof Comparable && value2 != null) { return ((Comparable) value1).compareTo(value2); } else if (value1 != null && value2 != null) { return value1.toString().compareTo(value2.toString()); } else if (value1 != null && value2 == null) { return 1; } else if (value1 == null && value2 != null) { return -1; } return 0; }

Target:
public static int compareValues(Object value1, Object value2) { if (value1 instanceof Comparable && value2 instanceof Comparable) { return ((Comparable) value1).compareTo(value2); } else if (value1 != null && value2 != null) { return value1.toString().compareTo(value2.toString()); } else if (value1 != null) { return 1; } else if (value2 != null) { return -1; } return 0; }
Source:
public void returnsA500ForViewsWithBadTemplatePaths() throws Exception { try { target("/test/bad").request().get(String.class); assertThat(1 == 0).isTrue(); } catch (WebApplicationException e) { assertThat(e.getResponse().getStatus()) .isEqualTo(500); final String responseStr = e.getResponse().readEntity(String.class); assertThat(responseStr) .isEqualTo("<html><head><title>Missing Template</title></head><body><h1>Missing Template</h1><p>Template /woo-oo-ahh.txt.mustache not found.</p></body></html>"); } }

Target:
public void returnsA500ForViewsWithBadTemplatePaths() throws Exception { try { target("/test/bad").request().get(String.class); failBecauseExceptionWasNotThrown(WebApplicationException.class); } catch (WebApplicationException e) { assertThat(e.getResponse().getStatus()) .isEqualTo(500); assertThat(e.getResponse().readEntity(String.class)) .isEqualTo("<html><head><title>Missing Template</title></head><body><h1>Missing Template</h1><p>Template /woo-oo-ahh.txt.mustache not found.</p></body></html>"); } }
Source:
private EventAuditLogSubscriber getEventAuditLogSubscriber(ResultSet rs) throws SQLException { EventAuditLogSubscriber eals = new EventAuditLogSubscriber(); eals.setevent_type(rs.getInt("event_type")); eals.setsubscriber_id(Guid.createGuidFromStringDefaultEmpty(rs.getString("subscriber_id"))); eals.setevent_up_name(rs.getString("event_up_name")); eals.setEventNotificationMethod(EventNotificationMethod.valueOf(rs.getString("notification_method"))); String methodAddress = rs.getString("method_address"); if (methodAddress == null) { } eals.setmethod_address(methodAddress); eals.settag_name(rs.getString("tag_name")); eals.setaudit_log_id(rs.getLong("audit_log_id")); eals.setuser_id(Guid.createGuidFromString(rs.getString("user_id"))); eals.setuser_name(rs.getString("user_name")); eals.setvm_id(Guid.createGuidFromString(rs.getString("vm_id"))); eals.setvm_name(rs.getString("vm_name")); eals.setvm_template_id(Guid.createGuidFromString(rs.getString("vm_template_id"))); eals.setvm_template_name(rs.getString("vm_template_name")); eals.setvds_id(Guid.createGuidFromString(rs.getString("vds_id"))); eals.setvds_name(rs.getString("vds_name")); eals.setstorage_pool_id(Guid.createGuidFromStringDefaultEmpty(rs.getString("storage_pool_id"))); eals.setstorage_pool_name(rs.getString("storage_pool_name")); eals.setstorage_domain_id(Guid.createGuidFromStringDefaultEmpty(rs.getString("storage_domain_id"))); eals.setstorage_domain_name(rs.getString("storage_domain_name")); eals.setlog_time(rs.getTimestamp("log_time")); eals.setseverity(rs.getInt("severity")); eals.setmessage(rs.getString("message")); return eals; }

Target:
private EventAuditLogSubscriber getEventAuditLogSubscriber(ResultSet rs) throws SQLException { EventAuditLogSubscriber eals = new EventAuditLogSubscriber(); eals.setevent_type(rs.getInt("event_type")); eals.setsubscriber_id(Guid.createGuidFromStringDefaultEmpty(rs.getString("subscriber_id"))); eals.setevent_up_name(rs.getString("event_up_name")); eals.setmethod_id(rs.getInt("method_id")); eals.setmethod_address(rs.getString("method_address")); eals.settag_name(rs.getString("tag_name")); eals.setaudit_log_id(rs.getLong("audit_log_id")); eals.setuser_id(Guid.createGuidFromString(rs.getString("user_id"))); eals.setuser_name(rs.getString("user_name")); eals.setvm_id(Guid.createGuidFromString(rs.getString("vm_id"))); eals.setvm_name(rs.getString("vm_name")); eals.setvm_template_id(Guid.createGuidFromString(rs.getString("vm_template_id"))); eals.setvm_template_name(rs.getString("vm_template_name")); eals.setvds_id(Guid.createGuidFromString(rs.getString("vds_id"))); eals.setvds_name(rs.getString("vds_name")); eals.setstorage_pool_id(Guid.createGuidFromStringDefaultEmpty(rs.getString("storage_pool_id"))); eals.setstorage_pool_name(rs.getString("storage_pool_name")); eals.setstorage_domain_id(Guid.createGuidFromStringDefaultEmpty(rs.getString("storage_domain_id"))); eals.setstorage_domain_name(rs.getString("storage_domain_name")); eals.setlog_time(rs.getTimestamp("log_time")); eals.setseverity(rs.getInt("severity")); eals.setmessage(rs.getString("message")); return eals; }
Source:
public void reset() { view.reset(); if (!saveEnabled) { view.getSaveButton().removeFromParent(); } settingsScenarioSimulationDropdown.clear(); }

Target:
public void reset() { view.reset(); if (!saveEnabled) { view.removeSaveButton(); } settingsScenarioSimulationDropdown.clear(); }
Source:
public boolean isApplicable(IPerson p) { boolean isApplicable = false; if (LOG.isInfoEnabled()) LOG.info(">>>> calling " + name + ".isApplicable( " + p.getAttribute("username") + " )"); try { if (evaluators == null) { if (LOG.isDebugEnabled()) { LOG.debug("isApplicable()=false due to evaluators collection being null"); } } else { for (Evaluator v : evaluators) { if (v.isApplicable(p)) { isApplicable = true; break; } } } } catch (Exception e) { throw new RuntimeException("Failed to evaluate whether fragment '" + this.getName() + "' is applicable to user '" + p.getUserName() + "'"); } if (LOG.isInfoEnabled()) { LOG.info("---- " + name + ".isApplicable( " + p.getAttribute( "username" ) + " )=" + isApplicable); } return isApplicable; }

Target:
public boolean isApplicable(IPerson p) { boolean isApplicable = false; if (LOG.isInfoEnabled()) LOG.info(">>>> calling " + name + ".isApplicable( " + p.getAttribute("username") + " )"); try { if (evaluators == null) { LOG.debug("isApplicable()=false due to evaluators collection being null"); } else { for (Evaluator v : evaluators) { if (v.isApplicable(p)) { isApplicable = true; break; } } } } catch (Exception e) { throw new RuntimeException("Failed to evaluate whether fragment '" + this.getName() + "' is applicable to user '" + p.getUserName() + "'", e); } if (LOG.isInfoEnabled()) { LOG.info("---- " + name + ".isApplicable( " + p.getAttribute( "username" ) + " )=" + isApplicable); } return isApplicable; }
Source:
protected String getCachedString(String str) { WeakReference<String> internedString = stringCache.get(str); if ( internedString == null ) { internedString = new WeakReference<>(str); stringCache.put(str, internedString); } return internedString.get(); }

Target:
protected String getCachedString(String str) { if (!vcfCodecUseStringsCache) return str; WeakReference<String> stringWeakReference = stringCache.get(str); if ( stringWeakReference != null) { String ret = stringWeakReference.get(); if (ret != null) return ret; } stringWeakReference = new WeakReference<>(str); stringCache.put(str, stringWeakReference); return str; }
Source:
public String getInstallationAccessTokenFromCache(String installationId) { try { CacheStats cacheStats = installationAccessTokenCache.stats(); LOG.info(cacheStats.toString()); return installationAccessTokenCache.get(installationId); } catch (Exception ex) { LOG.error("Error retrieving token " + ex.getMessage()); } return null; }

Target:
public String getInstallationAccessTokenFromCache(String installationId) { try { CacheStats cacheStats = installationAccessTokenCache.stats(); LOG.info(cacheStats.toString()); return installationAccessTokenCache.get(installationId); } catch (Exception ex) { LOG.error("Error retrieving token", ex); } return null; }
Source:
public void shouldRemoveRepeatedContributorsWhenAdding() { DocumentModel doc = session.createDocumentModel("/", "file", "File"); doc.setProperty("dublincore", "creator", "Administrator"); doc.setProperty("dublincore", "lastContributor", "Administrator"); doc.setProperty("dublincore", "contributors", new String[] { "user:Administrator", "user:Administrator", "user:Administrator", "user:Administrator" }); Map<String, Object> originalProperties = new HashMap<>(doc.getProperties("dublincore")); Set<String> expectedChangedProperties = new HashSet<>(); expectedChangedProperties.add("dc:contributors"); Event event = getEvent(BEFORE_DOC_UPDATE, session, session.getPrincipal()); storageService.addContributor(doc, event); assertDocumentPropertiesChanges(doc, originalProperties, expectedChangedProperties); String principalName = session.getPrincipal().getName(); List<String> contributors = Arrays.asList((String[]) doc.getPropertyValue("dc:contributors")); assertEquals(1, contributors.size()); assertTrue(!contributors.contains("user:Administrator")); assertTrue(contributors.contains(principalName)); }

Target:
public void shouldRemoveRepeatedContributorsWhenAdding() { DocumentModel doc = session.createDocumentModel("/", "file", "File"); doc.setPropertyValue("dc:creator", "Administrator"); doc.setPropertyValue("dc:lastContributor", "Administrator"); doc.setPropertyValue("dc:contributors", new String[] { "user:Administrator", "user:Administrator", "user:Administrator", "user:Administrator" }); Map<String, Object> originalProperties = new HashMap<>(doc.getProperties("dublincore")); Set<String> expectedChangedProperties = Collections.singleton("dc:contributors"); Event event = getEventFromDocumentContext(BEFORE_DOC_UPDATE, session, session.getPrincipal()); storageService.addContributor(doc, event); assertDocumentPropertiesChanges(doc, originalProperties, expectedChangedProperties); String principalName = session.getPrincipal().getName(); List<String> contributors = Arrays.asList((String[]) doc.getPropertyValue("dc:contributors")); assertEquals(1, contributors.size()); assertFalse(contributors.contains("user:Administrator")); assertTrue(contributors.contains(principalName)); }
Source:
public KafkaMessageContentsBuilder appendIntBigEndian(int v) { for (int i = 3; i >= 0; --i) { contents.write((v & 0xff << i * 8) >> (i + 1) * 8); } return this; }

Target:
public KafkaMessageContentsBuilder appendIntBigEndian(int v) { for (int i = 3; i >= 0; --i) { contents.write((v >> (i * 8)) & 0xff); } return this; }
Source:
public void processOutStream(int type, final BinaryRawWriterEx writer) throws IgniteCheckedException { if (type == OP_GET_FIELD_NAMES) { FieldsQueryCursor fq = (FieldsQueryCursor) cursor(); int cnt = fq.getColumnsCount(); writer.writeInt(cnt); for (int i = 0; i < cnt; i++) { writer.writeString(fq.getFieldName(i)); } } else if (type == OP_GET_FIELDS_META) { QueryCursorEx<List<?>> cursor = cursor(); List<GridQueryFieldMetadata> metadatas = cursor.fieldsMeta(); writer.writeInt(metadatas.size()); for (GridQueryFieldMetadata metadata: metadatas){ writer.writeString(metadata.fieldName()); writer.writeString(metadata.fieldTypeName()); } } else { super.processOutStream(type, writer); } }

Target:
@Override public void processOutStream(int type, final BinaryRawWriterEx writer) throws IgniteCheckedException { if (type == OP_GET_FIELD_NAMES) { FieldsQueryCursor fq = (FieldsQueryCursor) cursor(); int cnt = fq.getColumnsCount(); writer.writeInt(cnt); for (int i = 0; i < cnt; i++) { writer.writeString(fq.getFieldName(i)); } } else if (type == OP_GET_FIELDS_META) { QueryCursorEx<List<?>> cursor = cursor(); List<GridQueryFieldMetadata> metas = cursor.fieldsMeta(); if (metas == null) { writer.writeInt(0); } else { writer.writeInt(metas.size()); for (GridQueryFieldMetadata meta : metas) { writer.writeString(meta.fieldName()); writer.writeString(meta.fieldTypeName()); } } } else { super.processOutStream(type, writer); } }
Source:
public void testResolveMappedEntryNumber() { final Map<Integer, Integer> designExpectedEntriesMap = new HashMap<>(); designExpectedEntriesMap.put(9, 3); designExpectedEntriesMap.put(10, 5); final Integer result1 = experimentDesignGenerator.resolveMappedEntryNumber(9, designExpectedEntriesMap); Assert.assertEquals("Lookup value 9 should return 3", Integer.valueOf(3), result1); final Integer result2 = experimentDesignGenerator.resolveMappedEntryNumber(10, designExpectedEntriesMap); Assert.assertEquals("Lookup value 10 should return 5", Integer.valueOf(5), result2); final Integer result5 = experimentDesignGenerator.resolveMappedEntryNumber(9999, designExpectedEntriesMap); Assert.assertEquals("9999 is not in map of checks, the return value should be the same number", Integer.valueOf(9999), result5); }

Target:
public void testResolveMappedEntryNumber() { final Map<Integer, Integer> designExpectedEntriesMap = new HashMap<>(); designExpectedEntriesMap.put(ENTRY_NO_9, ENTRY_NO_3); designExpectedEntriesMap.put(ENTRY_NO_10, ENTRY_NO_5); final Integer result1 = experimentDesignGenerator.resolveMappedEntryNumber(9, designExpectedEntriesMap); Assert.assertEquals("Lookup value 9 should return 3", Integer.valueOf(3), result1); final Integer result2 = experimentDesignGenerator.resolveMappedEntryNumber(10, designExpectedEntriesMap); Assert.assertEquals("Lookup value 10 should return 5", Integer.valueOf(5), result2); final Integer result5 = experimentDesignGenerator.resolveMappedEntryNumber(9999, designExpectedEntriesMap); Assert.assertEquals("9999 is not in map of checks, the return value should be the same number", Integer.valueOf(9999), result5); }
Source:
private void scrollCommentAndDiff(Point location, int lineHeight) { Rectangle size = commentAndDiffScrolledComposite.getBounds(); ScrollBar bar = commentAndDiffScrolledComposite.getVerticalBar(); if (bar != null) { size.width = Math.max(0, size.width - bar.getSize().x); } bar = commentAndDiffScrolledComposite.getHorizontalBar(); if (bar != null) { size.height = Math.max(0, size.height - bar.getSize().y); } Point topLeft = commentAndDiffScrolledComposite.getOrigin(); size.x = topLeft.x; size.y = topLeft.y; if (location.y >= size.y) { location.y += lineHeight; } if (!size.contains(location)) { int left = size.x; int top = size.y; if (location.x < left) { left = location.x; } else if (location.x > left + size.width) { left = Math.max(0, location.x - size.width); } if (location.y < top) { top = location.y; } else if (location.y > top + size.height) { top = Math.max(0, location.y - size.height); } commentAndDiffScrolledComposite.setOrigin(left, top); } }

Target:
private void scrollCommentAndDiff(Point location, int lineHeight) { Rectangle size = commentAndDiffScrolledComposite.getBounds(); ScrollBar bar = commentAndDiffScrolledComposite.getVerticalBar(); if (bar != null && bar.isVisible()) { size.width = Math.max(0, size.width - bar.getSize().x); } bar = commentAndDiffScrolledComposite.getHorizontalBar(); if (bar != null && bar.isVisible()) { size.height = Math.max(0, size.height - bar.getSize().y); } Point topLeft = commentAndDiffScrolledComposite.getOrigin(); size.x = topLeft.x; size.y = topLeft.y; if (location.y >= size.y) { location.y += lineHeight; } if (!size.contains(location)) { int left = size.x; int top = size.y; int minScroll = size.width / 4; if (location.x < left) { left = Math.max(0, left - Math.max(left - location.x, minScroll)); } else if (location.x > left + size.width) { int maxWidth = commentAndDiffComposite.getSize().x; int right = Math.max(location.x, left + size.width + minScroll); left = Math.min(right, maxWidth) - size.width; } if (location.y < top) { top = location.y; } else if (location.y > top + size.height) { top = location.y - size.height; } commentAndDiffScrolledComposite.setOrigin(left, top); } }
Source:
private @Nullable ByteBuffer parsePacketHeader() throws IOException, BadPcapFileException { ByteBuffer pcapPacketHeader; SeekableByteChannel fFileChannel = getFileChannel(); if (fFileChannel.size() - fFileChannel.position() == 0) { return null; } if (fFileChannel.size() - fFileChannel.position() < PcapFileValues.PCAPNG_PACKET_HEADER_SIZE) { throw new BadPcapFileException("A pcapng header is invalid."); } pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PCAPNG_PACKET_HEADER_SIZE); pcapPacketHeader.clear(); ByteOrder byteOrder = getByteOrder(); pcapPacketHeader.order(byteOrder); fFileChannel.read(pcapPacketHeader); pcapPacketHeader.flip(); return pcapPacketHeader; }

Target:
private @Nullable ByteBuffer parsePacketHeader() throws IOException, BadPcapFileException { ByteBuffer pcapPacketHeader; SeekableByteChannel fileChannel = getFileChannel(); if (fileChannel.size() - fileChannel.position() == 0) { return null; } if (fileChannel.size() - fileChannel.position() < PcapFileValues.PCAPNG_PACKET_HEADER_SIZE) { throw new BadPcapFileException("A pcapng header is invalid."); } pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PCAPNG_PACKET_HEADER_SIZE); pcapPacketHeader.clear(); ByteOrder byteOrder = getByteOrder(); pcapPacketHeader.order(byteOrder); fileChannel.read(pcapPacketHeader); pcapPacketHeader.flip(); return pcapPacketHeader; }
Source:
public void queryUpdateConvertsExceptions() throws Exception { ConstraintViolationException cve = new ConstraintViolationException( "Duplicate entry 'studyTest-email@email.com' for key 'Accounts-StudyId-Email-Index'", null, null); PersistenceException ex = new PersistenceException(cve); reset(helper); doThrow(ex).when(mockSessionFactory).openSession(); HibernateAccount account = new HibernateAccount(); account.setStudyId("testStudy"); helper.update(account); }

Target:
public void queryUpdateConvertsExceptions() throws Exception { ConstraintViolationException cve = new ConstraintViolationException( "Duplicate entry 'studyTest-email@email.com' for key 'Accounts-StudyId-Email-Index'", null, null); PersistenceException ex = new PersistenceException(cve); reset(helper); doThrow(ex).when(mockSessionFactory).openSession(); HibernateAccount account = new HibernateAccount(); account.setStudyId("testStudy"); when(mockExceptionConverter.convert(ex, null)).thenReturn(TEST_EXCEPTION); try { helper.queryUpdate("query string", ImmutableMap.of()); fail("Should have thrown exception"); } catch(Exception e) { assertSame(TEST_EXCEPTION, e); } verify(mockExceptionConverter).convert(ex, null); }
Source:
public int getVisibility(IBinding member) { if (member instanceof ICPPSpecialization) { return getSpecializedBinding().getVisibility(((ICPPSpecialization)member).getSpecializedBinding()); } try { PDOMCPPMemberBlock members = new PDOMCPPMemberBlock(getLinkage(), record + MEMBERLIST); return members.getVisibility(member); } catch (CoreException e) { CCorePlugin.log(e); throw new IllegalArgumentException(member.getName() + " is not a member of " + getName()); } }

Target:
public int getVisibility(IBinding member) { if (member instanceof ICPPSpecialization) { return getSpecializedBinding().getVisibility(((ICPPSpecialization)member).getSpecializedBinding()); } try { PDOMCPPMemberBlock members = new PDOMCPPMemberBlock(getLinkage(), record + MEMBERLIST); return members.getVisibility(member); } catch (CoreException e) { CCorePlugin.log(e); return v_public; } }
Source:
public void loginAsync_errorHandlerThrows() { SyncCredentials credentials = SyncCredentials.usernamePassword("IWantToHackYou", "GeneralPassword", false); SyncUser.loginAsync(credentials, Constants.AUTH_URL, new SyncUser.Callback() { @Override public void onSuccess(SyncUser user) { fail(); } @Override public void onError(ObjectServerError error) { assertEquals(ErrorCode.INVALID_CREDENTIALS, error.getErrorCode()); looperThread.testComplete(); } }); }

Target:
public void loginAsync_errorHandlerThrows() throws InterruptedException { final AtomicBoolean errorThrown = new AtomicBoolean(false); Thread t = new Thread(new Runnable() { private volatile Handler handler; @Override public void run() { Looper.prepare(); try { handler = new Handler(); handler.post(new Runnable() { @Override public void run() { SyncCredentials credentials = SyncCredentials.usernamePassword("IWantToHackYou", "GeneralPassword", false); SyncUser.loginAsync(credentials, Constants.AUTH_URL, new SyncUser.Callback() { @Override public void onSuccess(SyncUser user) { fail(); } @Override public void onError(ObjectServerError error) { assertEquals(ErrorCode.INVALID_CREDENTIALS, error.getErrorCode()); throw new IllegalArgumentException("BOOM"); } }); } }); Looper.loop(); } catch (IllegalArgumentException e) { errorThrown.set(true); } } }); t.start(); t.join(TimeUnit.SECONDS.toMillis(10)); assertTrue(errorThrown.get()); }
Source:
public static DataWord of(byte[] data) { if (data == null || data.length == 0) { return DataWord.ZERO; } boolean allExceptLastIsZero = true; for (int i = 0; i < (data.length - 1); ++i) { if (data[i] != 0) { allExceptLastIsZero = false; break; } } if (allExceptLastIsZero) { if (data[data.length - 1] == 0) return DataWord.ZERO; if (data[data.length - 1] == 1) return DataWord.ONE; } if (data.length == 32) return new DataWord(Arrays.copyOf(data, data.length)); else if (data.length <= 32) { byte[] bytes = new byte[32]; System.arraycopy(data, 0, bytes, 32 - data.length, data.length); return new DataWord(bytes); } else { throw new RuntimeException(String.format("Data word can't exceed 32 bytes: 0x%s", ByteUtil.toHexString(data))); } }

Target:
public static DataWord of(byte[] data) { if (data == null || data.length == 0) { return DataWord.ZERO; } int leadingZeroBits = numberOfLeadingZeros(data); int valueBits = 8 * data.length - leadingZeroBits; if (valueBits <= 8) { if (data[data.length - 1] == 0) return DataWord.ZERO; if (data[data.length - 1] == 1) return DataWord.ONE; } if (data.length == 32) return new DataWord(Arrays.copyOf(data, data.length)); else if (data.length <= 32) { byte[] bytes = new byte[32]; System.arraycopy(data, 0, bytes, 32 - data.length, data.length); return new DataWord(bytes); } else { throw new RuntimeException(String.format("Data word can't exceed 32 bytes: 0x%s", ByteUtil.toHexString(data))); } }
Source:
private void setBackgroundText() { OCFileListFragment listFragment = getListOfFilesFragment(); if (listFragment != null) { int message = R.string.file_list_loading; if (!mSyncInProgress) { message = R.string.file_list_empty_moving; if (listFragment.getProgressBar() != null && listFragment.getShadowView() != null) { listFragment.getProgressBar().setVisibility(View.GONE); listFragment.getShadowView().setVisibility(View.VISIBLE); } } listFragment.setMessageForEmptyList(getString(message)); } else { Timber.e("OCFileListFragment is null"); } }

Target:
private void setBackgroundText() { OCFileListFragment listFragment = getListOfFilesFragment(); if (listFragment != null) { int message = R.string.file_list_loading; if (!mSyncInProgress) { message = R.string.file_list_empty_moving; if (listFragment.getProgressBar() != null) { listFragment.getProgressBar().setVisibility(View.GONE); } if (listFragment.getShadowView() != null) { listFragment.getShadowView().setVisibility(View.VISIBLE); } } listFragment.setMessageForEmptyList(getString(message)); } else { Timber.e("OCFileListFragment is null"); } }
Source:
public void prepareQuery(ExpressionBuilder queryBuilder, Options options) { if (options.containsKey(COMPONENT_STATUS)) { final Boolean isActive = options.get(COMPONENT_STATUS, Boolean.class); queryBuilder.filter(Expressions.match(COMPONENT_STATUS, isActive)); } if (options.containsKey(COMPONENT_MODULE_ID)) { final Collection<String> moduleIds = options.getCollection(COMPONENT_MODULE_ID, String.class); queryBuilder.filter(Expressions.matchAny(COMPONENT_MODULE_ID, moduleIds)); } if (options.containsKey(CONCEPT_STATUS)) { final Boolean isConceptActive = options.get(CONCEPT_STATUS, Boolean.class); queryBuilder.filter(Expressions.match(CONCEPT_STATUS, isConceptActive)); } if (options.containsKey(CONTENT_TYPE)) { final Boolean contentTypeFilter = options.get(CONTENT_TYPE, Boolean.class); if (contentTypeFilter != null && contentTypeFilter) { if (options.containsKey(COMPONENT_EFFECTIVE_TIME_START) || options.containsKey(COMPONENT_EFFECTIVE_TIME_END)) { final Long start = options.get(COMPONENT_EFFECTIVE_TIME_START, Long.class); final Long end = options.get(COMPONENT_EFFECTIVE_TIME_END, Long.class); final Expression effectiveTimeExpression = Expressions.matchRange(SnomedDocument.Fields.EFFECTIVE_TIME, start == null ? 0L : start, end == null ? Long.MAX_VALUE : end ); queryBuilder.filter(effectiveTimeExpression); } else { queryBuilder.filter(SnomedDocument.Expressions.effectiveTime(0L, Long.MAX_VALUE)); } } else if (contentTypeFilter != null && !contentTypeFilter) { queryBuilder.filter(SnomedDocument.Expressions.effectiveTime(EffectiveTimes.UNSET_EFFECTIVE_TIME)); } } }

Target:
public void prepareQuery(ExpressionBuilder queryBuilder, Options options) { if (options.containsKey(COMPONENT_STATUS)) { final Boolean isActive = options.get(COMPONENT_STATUS, Boolean.class); queryBuilder.filter(Expressions.match(COMPONENT_STATUS, isActive)); } if (options.containsKey(COMPONENT_MODULE_ID)) { final Collection<String> moduleIds = options.getCollection(COMPONENT_MODULE_ID, String.class); queryBuilder.filter(Expressions.matchAny(COMPONENT_MODULE_ID, moduleIds)); } if (options.containsKey(CONCEPT_STATUS)) { final Boolean isConceptActive = options.get(CONCEPT_STATUS, Boolean.class); queryBuilder.filter(Expressions.match(CONCEPT_STATUS, isConceptActive)); } if (options.containsKey(CONTENT_TYPE)) { final Boolean contentTypeFilter = options.get(CONTENT_TYPE, Boolean.class); if (contentTypeFilter != null && contentTypeFilter) { if (options.containsKey(COMPONENT_EFFECTIVE_TIME_START) || options.containsKey(COMPONENT_EFFECTIVE_TIME_END)) { final Long start = options.get(COMPONENT_EFFECTIVE_TIME_START, Long.class); final Long end = options.get(COMPONENT_EFFECTIVE_TIME_END, Long.class); final Expression effectiveTimeExpression = Expressions.matchRange(SnomedDocument.Fields.EFFECTIVE_TIME, start == null ? 0L : start, end == null ? Long.MAX_VALUE : end ); queryBuilder.filter(effectiveTimeExpression); } } else if (contentTypeFilter != null && !contentTypeFilter) { queryBuilder.filter(SnomedDocument.Expressions.effectiveTime(EffectiveTimes.UNSET_EFFECTIVE_TIME)); } } }
Source:
public void tagPicture(View view) { MapleApplication app = (MapleApplication) getApplication(); companyTag = companySuggest.getText().toString(); app.setCurrentCompany(companyTag); ((TextView) this.findViewById(R.id.header)) .setText("Customize Your Ad"); ((Button) findViewById(R.id.changeTag)).setText(companyTag); toggleOptions(); }

Target:
public void tagPicture(View view) { companyTag = companySuggest.getText().toString(); app.setCurrentCompany(companyTag); ((TextView) this.findViewById(R.id.header)) .setText("Customize Your Ad"); ((Button) findViewById(R.id.changeTag)).setText(companyTag); toggleOptions(); }
Source:
public void addApplicationDataForDeferredProcessing(RawData outgoingMessage) { int max = maxDeferredProcessedOutgoingApplicationDataMessages == 0 ? 1 : maxDeferredProcessedOutgoingApplicationDataMessages; if (deferredApplicationData.size() < max) { deferredApplicationData.add(outgoingMessage); } }

Target:
public void addApplicationDataForDeferredProcessing(RawData outgoingMessage) { if (deferredApplicationData.size() < maxDeferredProcessedOutgoingApplicationDataMessages) { deferredApplicationData.add(outgoingMessage); } }
Source:
public void testFieldsBinding() throws Exception { Handle h = dbRule.openHandle(); Update s = h.createUpdate("insert into something (id, name) values (:id, :name)"); s.bindFields(new Object() { @SuppressWarnings("unused") public int id = 0; @SuppressWarnings("unused") public String name = "Keith"; }); int insert_count = s.execute(); assertThat(insert_count).isEqualTo(1); }

Target:
public void testFieldsBinding() throws Exception { Handle h = dbRule.openHandle(); Update s = h.createUpdate("insert into something (id, name) values (:id, :name)"); s.bindFields(new Object() { @SuppressWarnings("unused") public int id = 0; @SuppressWarnings("unused") public String name = "Keith"; }); int insert_count = s.execute(); Query q = h.createQuery("select * from something where id = :id").bind("id", 0); final Something fromDb = q.mapToBean(Something.class).findOnly(); assertThat(insert_count).isEqualTo(1); assertThat(fromDb).extracting(Something::getId, Something::getName).containsExactly(0, "Keith"); }
Source:
public static UserSqlSandbox getStaticStorage(String username, String path) { System.out.println("Get STatic storage path: " + path); return new UserSqlSandbox(username, path); }

Target:
public static UserSqlSandbox getStaticStorage(String username, String path) { return new UserSqlSandbox(username, path); }
Source:
public static void warn() { if (PORT > 0) { LOGGER.warning("UDP broadcast capability has been removed from Jenkins."); } }

Target:
public static void warn() { if (PORT > 0) { LOGGER.warning("UDP broadcast capability has been removed from Jenkins. More information: <LINK_0>"); } }
Source:
public BlockPlacementData(Vector3ic blockPosition, Side attachmentSide, Vector3fc viewingDirection, Vector2fc relativeAttachmentPosition) { this.blockPosition = new Vector3i(blockPosition); this.attachmentSide = attachmentSide; this.viewingDirection = new Vector3f(viewingDirection); this.relativeAttachmentPosition = new Vector2f(relativeAttachmentPosition); }

Target:
public BlockPlacementData(Vector3ic blockPosition, Side attachmentSide, Vector3fc viewingDirection, Vector2fc relativeAttachmentPosition) { this.blockPosition = new Vector3i(Preconditions.checkNotNull(blockPosition)); this.attachmentSide = Preconditions.checkNotNull(attachmentSide); this.viewingDirection = new Vector3f(Preconditions.checkNotNull(viewingDirection)); this.relativeAttachmentPosition = new Vector2f(Preconditions.checkNotNull(relativeAttachmentPosition)); }
Source:
public void setupToC(final Page page, Site site, boolean firstPage) { funnel = new ToCInteractionFunnel((WikipediaApp)slidingPane.getContext().getApplicationContext(), site); tocProgress.setVisibility(View.GONE); tocList.setLayoutDirection(isLangRTL(site.getLanguageCode()) ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR); tocList.setVisibility(View.VISIBLE); headerView.setText(Html.fromHtml(page.getDisplayTitle())); headerView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { scrollToSection(page.getSections().get(0)); wasClicked = true; funnel.logClick(); hide(); } }); tocList.setAdapter(new ToCAdapter(page)); tocList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Section section = (Section) parent.getAdapter().getItem(position); scrollToSection(section); wasClicked = true; funnel.logClick(); hide(); } }); if (!page.isMainPage() && !firstPage) { if (WikipediaApp.getInstance().getOnboardingStateMachine().isTocTutorialEnabled()) { showTocOnboarding(); } } }

Target:
public void setupToC(final Page page, Site site, boolean firstPage) { funnel = new ToCInteractionFunnel((WikipediaApp)slidingPane.getContext().getApplicationContext(), site); tocProgress.setVisibility(View.GONE); setLayoutDirection(tocList, site.getLanguageCode()); tocList.setVisibility(View.VISIBLE); headerView.setText(Html.fromHtml(page.getDisplayTitle())); headerView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { scrollToSection(page.getSections().get(0)); wasClicked = true; funnel.logClick(); hide(); } }); tocList.setAdapter(new ToCAdapter(page)); tocList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Section section = (Section) parent.getAdapter().getItem(position); scrollToSection(section); wasClicked = true; funnel.logClick(); hide(); } }); if (!page.isMainPage() && !firstPage) { if (WikipediaApp.getInstance().getOnboardingStateMachine().isTocTutorialEnabled()) { showTocOnboarding(); } } }
Source:
private boolean isMessageLoggedWithAdditionalContext() { if (loggingMethodInvocations.isEmpty()) { return false; } for (MethodInvocationTree mit : loggingMethodInvocations) { if (hasGetMessageInvocation(mit) && hasDynamicExceptionMessageUsage(mit)) { return true; } } return false; }

Target:
private boolean isMessageLoggedWithAdditionalContext() { return loggingMethodInvocations.stream().anyMatch(mit -> hasGetMessageInvocation(mit) && hasDynamicExceptionMessageUsage(mit)); }
Source:
MergingIterator() { this.queue = new TreeSet<>(new PeekFileRecordIteratorComparator()); int n = 0; log.info(String.format("Creating merging iterator from %d files", files.size())); int suggestedBufferSize = checkMemoryAndAdjustBuffer(files.size(), Defaults.BUFFER_SIZE); for (final Path f : files) { final FileRecordIterator it = new FileRecordIterator(f, suggestedBufferSize); if (it.hasNext()) { this.queue.add(new PeekFileRecordIterator(it, n++)); } else { it.close(); } } }

Target:
MergingIterator() { this.queue = new TreeSet<>(new PeekFileRecordIteratorComparator()); int n = 0; log.info(String.format("Creating merging iterator from %d files", files.size())); int suggestedBufferSize = checkMemoryAndAdjustBuffer(files.size()); for (final Path f : files) { final FileRecordIterator it = new FileRecordIterator(f, suggestedBufferSize); if (it.hasNext()) { this.queue.add(new PeekFileRecordIterator(it, n++)); } else { it.close(); } } }
Source:
public void verifyNoDomainForMemoryWhenDomainHasLowSpace() { when(validStorageDomainValidator.isDomainWithinThresholds()) .thenReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)); verifyNoDomainForMemory(Arrays.asList(validStorageDomain)); }

Target:
public void verifyNoDomainForMemoryWhenDomainHasLowSpace() { when(validStorageDomainValidator.isDomainWithinThresholds()) .thenReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)); verifyNoDomainForMemory(Collections.singletonList(validStorageDomain)); }
Source:
private List<ThemeModel> filter(@NonNull List<ThemeModel> themes) { if (TextUtils.isEmpty(mLastSearch)) { return themes; } List<ThemeModel> filteredThemes = new ArrayList<>(); for (ThemeModel theme : themes) { if (theme.getName().toLowerCase().contains(mLastSearch.toLowerCase())) { filteredThemes.add(theme); } } return filteredThemes; }

Target:
private List<ThemeModel> filter(@NonNull List<ThemeModel> themes) { if (TextUtils.isEmpty(mLastSearch)) { return themes; } List<ThemeModel> filteredThemes = new ArrayList<>(); String lcSearch = mLastSearch.toLowerCase(); for (ThemeModel theme : themes) { if (theme.getName().toLowerCase().contains(lcSearch) || (theme.getDescription() != null && theme.getDescription().toLowerCase().contains(lcSearch))) { filteredThemes.add(theme); } } return filteredThemes; }
Source:
public boolean supports(final RepositoryPath repositoryPath) { if (repositoryPath == null) { return false; } if (!MetadataHelper.MAVEN_METADATA_XML.equals(repositoryPath.getFileName().toString())) { return false; } Repository repository = repositoryPath.getRepository(); RepositoryProvider provider = repositoryProviderRegistry.getProvider(repository.getType()); return provider instanceof ProxyRepositoryProvider; }

Target:
public boolean supports(final RepositoryPath repositoryPath) { if (repositoryPath == null) { return false; } try { if (!RepositoryFiles.isMetadata(repositoryPath)) { return false; } } catch (IOException e) { throw new UndeclaredThrowableException(e); } Repository repository = repositoryPath.getRepository(); return repository.getRemoteRepository() != null; }
Source:
public ValidationResult isReadOnlyPropertyCompatibleWithLunInterface() { if (Boolean.TRUE.equals(disk.getReadOnly()) && disk.getDiskInterface() == DiskInterface.VirtIO_SCSI && disk.getDiskStorageType() == DiskStorageType.LUN) { return new ValidationResult( VdcBllMessages.ACTION_TYPE_FAILED_VIRT_IO_SCSI_INTERFACE_FOR_LUN_DISKS_DOES_NOT_SUPPORT_READ_ONLY_ATTR); } return ValidationResult.VALID; }

Target:
public ValidationResult isReadOnlyPropertyCompatibleWithLunInterface() { if (Boolean.TRUE.equals(disk.getReadOnly()) && disk.getDiskInterface() == DiskInterface.VirtIO_SCSI) { return new ValidationResult( VdcBllMessages.ACTION_TYPE_FAILED_VIRT_IO_SCSI_INTERFACE_FOR_LUN_DISKS_DOES_NOT_SUPPORT_READ_ONLY_ATTR); } return ValidationResult.VALID; }
Source:
private <Q, R> List<MessageHandler<? super QueryMessage<?, ?>>> getHandlersForMessage( QueryMessage<Q, R> queryMessage) { ResponseType<R> responseType = queryMessage.getResponseType(); return subscriptions.getOrDefault(queryMessage.getQueryName(), new CopyOnWriteArrayList<>()) .stream() .filter(querySubscription -> responseType.matches(querySubscription.getResponseType())) .map((Function<QuerySubscription, MessageHandler>) QuerySubscription::getQueryHandler) .map(queryHandler -> (MessageHandler<? super QueryMessage<?, ?>>) queryHandler) .collect(Collectors.toList()); }

Target:
private <Q, R> List<MessageHandler<? super QueryMessage<?, ?>>> getHandlersForMessage( QueryMessage<Q, R> queryMessage) { ResponseType<R> responseType = queryMessage.getResponseType(); return subscriptions.computeIfAbsent(queryMessage.getQueryName(), k -> new CopyOnWriteArrayList<>()) .stream() .filter(querySubscription -> responseType.matches(querySubscription.getResponseType())) .map((Function<QuerySubscription, MessageHandler>) QuerySubscription::getQueryHandler) .map(queryHandler -> (MessageHandler<? super QueryMessage<?, ?>>) queryHandler) .collect(Collectors.toList()); }
Source:
public void testUseDatabase() throws Exception { TestingExecutor executor = new TestingExecutorBuilder() .setUseDatabaseConsumer((ignored1, databaseName) -> { if (!databaseName.equals("db")) { throw new SqlExecutionException("unexpected database name: " + databaseName); } }) .build(); InputStream inputStream = new ByteArrayInputStream("use db;\n".getBytes()); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(256); CliClient cliClient = null; SessionContext sessionContext = new SessionContext("test-session", new Environment()); String sessionId = executor.openSession(sessionContext); try (Terminal terminal = new DumbTerminal(inputStream, outputStream)) { cliClient = new CliClient(terminal, sessionId, executor, File.createTempFile("history", "tmp").toPath()); cliClient.open(); assertThat(executor.getNumUseDatabaseCalls(), is(1)); String output = new String(outputStream.toByteArray()); assertFalse(output.contains("unexpected database name")); } finally { if (cliClient != null) { cliClient.close(); } } }

Target:
public void testUseDatabase() throws Exception { TestingExecutor executor = new TestingExecutorBuilder() .setUseDatabaseConsumer((ignored1, databaseName) -> { if (!databaseName.equals("db")) { throw new SqlExecutionException("unexpected database name: " + databaseName); } }) .build(); String output = testExecuteSql(executor, "use db;"); assertThat(executor.getNumUseDatabaseCalls(), is(1)); assertFalse(output.contains("unexpected database name")); }
Source:
private void controlLoop() { try { kafkaConsumer.subscribe(Collections.singleton(topic), new RebalanceListener()); while (running) { ConsumerRecords<?, ?> records = flowControlledPoll(); addRecordsToStream(records); Map<TopicPartition, OffsetAndMetadata> offsets = acknowledgmentHandler.getAcknowledged(); commitOffsets(offsets); } } catch (WakeupException e) { log.info("Wakeup, controlLoop exiting"); } catch (InterruptedException e) { log.info("Interrupted, controlLoop exiting"); } catch (Throwable t) { log.error("controlLoop error, exiting", t); throw t; } finally { running = false; synchronized (this) { this.notifyAll(); } try { Map<TopicPartition, OffsetAndMetadata> finalOffsets = new HashMap<>(); if (failedOffset != null) { finalOffsets.putAll(failedOffset); } finalOffsets.putAll(acknowledgmentHandler.removePartitions(kafkaConsumer.assignment())); try { log.info("closing offset size committed: " + finalOffsets.size()); try { kafkaConsumer.commitSync(finalOffsets); } catch (WakeupException expected) { log.info("controlLoop wakeup on closing commitSync, retrying"); kafkaConsumer.commitSync(finalOffsets); } } catch (Throwable e) { log.error("controlLoop error commiting sync", e); } } catch (InterruptedException e) { log.info("controlLoop failed to commit offsets on shutdown", e); } log.info("controlLoop closing kafkaConsumer"); kafkaConsumer.close(); } }

Target:
private void controlLoop() { try { kafkaConsumer.subscribe(Collections.singleton(topic), new RebalanceListener()); while (running) { ConsumerRecords<?, ?> records = flowControlledPoll(); addRecordsToStream(records); Map<TopicPartition, OffsetAndMetadata> offsets = acknowledgmentHandler.getAcknowledged(); commitOffsets(offsets); } } catch (WakeupException e) { log.info("Wakeup, controlLoop exiting"); } catch (InterruptedException e) { log.info("Interrupted, controlLoop exiting"); } catch (Throwable t) { log.error("controlLoop error, exiting", t); throw t; } finally { running = false; try { Map<TopicPartition, OffsetAndMetadata> finalOffsets = new HashMap<>(); if (failedOffset != null) { finalOffsets.putAll(failedOffset); } finalOffsets.putAll(acknowledgmentHandler.removePartitions(kafkaConsumer.assignment())); try { log.info("closing offset size committed: " + finalOffsets.size()); try { kafkaConsumer.commitSync(finalOffsets); } catch (WakeupException expected) { log.info("controlLoop wakeup on closing commitSync, retrying"); kafkaConsumer.commitSync(finalOffsets); } } catch (Throwable e) { log.error("controlLoop error commiting sync", e); } } catch (InterruptedException e) { log.info("controlLoop failed to commit offsets on shutdown", e); } log.info("controlLoop closing kafkaConsumer"); kafkaConsumer.close(); } }
Source:
public void initTest() { EnvConfig envConfig = EnvConfig.getDefaultEnvConfig(); ControlMessage lastControlMessage = new ControlMessage(); lastControlMessage.setId("1"); lastControlMessage.setOffset(1l); when(consumerUtilsCore.getLastEvent(envConfig.getControlTopicName(), envConfig.getPollTimeout())).thenReturn(lastControlMessage); when(defaultSessionSnapShooter.getLastSnapshotTime()).thenReturn(LocalDateTime.now()); when(handler.initializeKieSessionFromSnapshotOnDemand(any(EnvConfig.class), any(SnapshotInfos.class))).thenReturn(Boolean.TRUE); consumer = new DefaultKafkaConsumer(EnvConfig.getDefaultEnvConfig(), producer, primaryConsumer, secondaryConsumer, consumerUtilsCore, defaultSessionSnapShooter, snapshotOnDemandUtils, handler); }

Target:
public void initTest() { EnvConfig envConfigTest = EnvConfig.getDefaultEnvConfig(); ControlMessage lastControlMessage = new ControlMessage(); lastControlMessage.setId("1"); lastControlMessage.setOffset(1l); when(consumerUtilsCoreMock.getLastEvent(envConfigTest.getControlTopicName(), envConfigTest.getPollTimeout())).thenReturn(lastControlMessage); when(defaultSessionSnapShooterMock.getLastSnapshotTime()).thenReturn(LocalDateTime.now()); when(handlerMock.initializeKieSessionFromSnapshotOnDemand(any(EnvConfig.class), any(SnapshotInfos.class))).thenReturn(Boolean.TRUE); spy = Mockito.spy(new DefaultKafkaConsumer(){ { this.envConfig = envConfigTest; this.producer = mockProducer; this.consumerUtilsCore = consumerUtilsCoreMock; this.snapShooter = defaultSessionSnapShooterMock; this.snapshotOnDemandUtils = snapshotOnDemandUtilsMock; this.consumerHandler = handlerMock; initKafkaConsumer(); updateKafkaSecondaryConsumer(); } @Override public void initKafkaConsumer() { this.kafkaConsumer = primaryConsumerMock; } @Override public void updateKafkaSecondaryConsumer() { this.kafkaSecondaryConsumer = secondaryConsumerMock; } }); }
Source:
public void getSetBits(int batchSize, boolean[] vector, boolean[] isNull) throws IOException { for (int i = 0; i < batchSize; i++) { if (!isNull[i]) { vector[i] = nextBit(); } } }

Target:
public int getSetBits(int batchSize, boolean[] vector, boolean[] isNull) throws IOException { int count = 0; for (int i = 0; i < batchSize; i++) { if (!isNull[i]) { vector[i] = nextBit(); count += vector[i] ? 1 : 0; } } return count; }
Source:
public boolean equals(Object obj) { if (obj instanceof PanStampBindingSettings) { PanStampBindingSettings other = (PanStampBindingSettings) obj; return !serialDiffers(other) && (networkChannel == other.networkChannel) && (networkId == other.networkId) && (networkDeviceAddress == other.networkDeviceAddress) && (networkSecurityOption == other.networkSecurityOption) && xmlDir.equals(other.xmlDir) && (debugPort == other.debugPort) && (debugEnabled == other.debugEnabled); } return false; }

Target:
public boolean equals(Object obj) { if (obj instanceof PanStampBindingSettings) { PanStampBindingSettings other = (PanStampBindingSettings) obj; return !serialDiffers(other) && !networkDiffers(other) && !debugDiffers(other) && !directoriesDiffers(other); } return false; }
Source:
public void setup(Context.OperatorContext context) { if (scanService == null) { scanService = Executors.newSingleThreadExecutor(); } sleepMillis = context.getValue(Context.OperatorContext.SPIN_MILLIS); if (filePatternRegularExp != null) { regex = Pattern.compile(filePatternRegularExp); } if (ignoreFilePatternRegularExp != null) { ignoreRegex = Pattern.compile(this.ignoreFilePatternRegularExp); } try { fs = getFSInstance(); } catch (IOException e) { throw new RuntimeException("opening fs", e); } }

Target:
public void setup(Context.OperatorContext context) { if (scanService != null) { throw new RuntimeException("multiple calls to setup() detected!"); } scanService = Executors.newSingleThreadExecutor(); discoveredFiles = new LinkedBlockingDeque<>(); atomicThrowable = new AtomicReference<>(); ignoredFiles = Sets.newHashSet(); sleepMillis = context.getValue(Context.OperatorContext.SPIN_MILLIS); if (filePatternRegularExp != null) { regex = Pattern.compile(filePatternRegularExp); } if (ignoreFilePatternRegularExp != null) { ignoreRegex = Pattern.compile(this.ignoreFilePatternRegularExp); } try { fs = getFSInstance(); } catch (IOException e) { throw new RuntimeException("opening fs", e); } }
Source:
public static <T> int chooseTaskIndex(List<T> keys, int numTasks) { return Math.abs(listHashCode(keys) % numTasks); }

Target:
public static <T> int chooseTaskIndex(List<T> keys, int numTasks) { return Math.floorMod(listHashCode(keys), numTasks); }