auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@OnCheckedChanged(R.id.wiki_language_checkbox) void onCheckedChanged() { if (callback != null) { callback.onCheckedChanged(position); containerView.setBackgroundColor(checkBox.isChecked() ? getResources().getColor(R.color.accent90) : ResourceUtil.getThemedColor(getContext(), R.attr.paper_color)); } }

Target:
@OnCheckedChanged(R.id.wiki_language_checkbox) void onCheckedChanged() { if (callback != null) { callback.onCheckedChanged(position); containerView.setBackgroundColor(checkBox.isChecked() ? ResourceUtil.getThemedColor(getContext(), R.attr.multi_select_background_color) : ResourceUtil.getThemedColor(getContext(), R.attr.paper_color)); } }
Source:
protected void updateVirtioScsiEnabled(final Guid vmId, int osId) { VDSGroup cluster = getModel().getSelectedCluster(); Version clusterVersion = cluster != null ? cluster.getcompatibility_version() : null; AsyncDataProvider.getDiskInterfaceList(osId, clusterVersion, new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ArrayList<DiskInterface> diskInterfaces = (ArrayList<DiskInterface>) returnValue; boolean isOsSupportVirtioScsi = diskInterfaces.contains(DiskInterface.VirtIO_SCSI); getModel().getIsVirtioScsiEnabled().setIsChangable(isOsSupportVirtioScsi); if (!isOsSupportVirtioScsi) { getModel().getIsVirtioScsiEnabled().setEntity(false); getModel().getIsVirtioScsiEnabled().setChangeProhibitionReason(constants.cannotEnableVirtioScsiForOs()); } else { if (Guid.isNullOrEmpty(vmId)) { VDSGroup cluster = getModel().getSelectedCluster(); boolean isVirtioScsiEnabled = (Boolean) AsyncDataProvider.getConfigValuePreConverted( ConfigurationValues.VirtIoScsiEnabled, cluster.getcompatibility_version().getValue()); getModel().getIsVirtioScsiEnabled().setEntity(isVirtioScsiEnabled); } else { AsyncDataProvider.isVirtioScsiEnabledForVm(new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { getModel().getIsVirtioScsiEnabled().setEntity((Boolean) returnValue); } }), vmId); } } } })); }

Target:
protected void updateVirtioScsiEnabled(final Guid vmId, int osId) { final VDSGroup cluster = getModel().getSelectedCluster(); if (cluster == null) { return; } AsyncDataProvider.getDiskInterfaceList(osId, cluster.getcompatibility_version(), new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ArrayList<DiskInterface> diskInterfaces = (ArrayList<DiskInterface>) returnValue; boolean isOsSupportVirtioScsi = diskInterfaces.contains(DiskInterface.VirtIO_SCSI); getModel().getIsVirtioScsiEnabled().setIsChangable(isOsSupportVirtioScsi); if (!isOsSupportVirtioScsi) { getModel().getIsVirtioScsiEnabled().setEntity(false); getModel().getIsVirtioScsiEnabled().setChangeProhibitionReason(constants.cannotEnableVirtioScsiForOs()); } else { if (Guid.isNullOrEmpty(vmId)) { boolean isVirtioScsiEnabled = (Boolean) AsyncDataProvider.getConfigValuePreConverted( ConfigurationValues.VirtIoScsiEnabled, cluster.getcompatibility_version().getValue()); getModel().getIsVirtioScsiEnabled().setEntity(isVirtioScsiEnabled); } else { AsyncDataProvider.isVirtioScsiEnabledForVm(new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { getModel().getIsVirtioScsiEnabled().setEntity((Boolean) returnValue); } }), vmId); } } } })); }
Source:
public BackgroundLocationManager(LocationClient locationClient, BackgroundLocationHelper helper) { currentState = BackgroundLocationState.NOT_APPLICABLE; this.locationClient = locationClient; this.helper = helper; this.locationListener = this; }

Target:
public BackgroundLocationManager(LocationClient locationClient, BackgroundLocationHelper helper) { currentState = BackgroundLocationState.NO_BACKGROUND_LOCATION_NEEDED; this.locationClient = locationClient; this.helper = helper; this.locationListener = this; }
Source:
public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("security.config-file", "/test.json") .put("security.refresh-period", "1s") .build(); FileBasedAccessControlConfig expected = new FileBasedAccessControlConfig() .setConfigFile("/test.json") .setRefreshPeriod(Duration.valueOf("1s")); assertFullMapping(properties, expected); }

Target:
public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put(SECURITY_CONFIG_FILE, "/test.json") .put(SECURITY_REFRESH_PERIOD, "1s") .build(); FileBasedAccessControlConfig expected = new FileBasedAccessControlConfig() .setConfigFile("/test.json") .setRefreshPeriod(new Duration(1, TimeUnit.SECONDS)); assertFullMapping(properties, expected); }
Source:
private void reject(final Message message) { if (!coapstack.supportsRejects()) { LOGGER.log(Level.FINE, "Rejects not supported under this stack."); return; } EmptyMessage rst = EmptyMessage.newRST(message); rst.setToken(new byte[0]); for (MessageInterceptor messageInterceptor : interceptors) { messageInterceptor.sendEmptyMessage(rst); } if (!rst.isCanceled()) { connector.send(serializer.serializeEmptyMessage(rst)); } }

Target:
private void reject(final Message message) { EmptyMessage rst = EmptyMessage.newRST(message); rst.setToken(new byte[0]); for (MessageInterceptor messageInterceptor : interceptors) { messageInterceptor.sendEmptyMessage(rst); } if (!rst.isCanceled()) { connector.send(serializer.serializeEmptyMessage(rst)); } }
Source:
public void startEntity(final String name) { final Matcher fieldNameMatcher = FIELD_NAME_PATTERN.matcher(name); if (!fieldNameMatcher.matches()) { throw new FormatException(name); } builder.append(name.trim()+ " "); idnControlSubField = !ignoreRecordId && name.trim().equals("003@"); this.entityOpen = true; }

Target:
public void startEntity(final String name) { final Matcher fieldNameMatcher = FIELD_NAME_PATTERN.matcher(name); if (!fieldNameMatcher.matches()) { throw new FormatException(name); } if (entityOpen) { throw new FormatException(name); } builder.append(name.trim()+ " "); idnControlSubField = !ignoreRecordId && FIELD_IDN_INTERN.equals(name.trim()); this.entityOpen = true; }
Source:
protected MutableBoundedValue<Short> constructValue(Short actualValue) { return SpongeValueFactory.boundedBuilder(Keys.SPAWNER_MAXIMUM_DELAY) .minimum((short) 1) .maximum(Short.MAX_VALUE) .defaultValue((short) 800) .actualValue(actualValue) .build(); }

Target:
protected MutableBoundedValue<Short> constructValue(Short actualValue) { return SpongeValueFactory.boundedBuilder(Keys.SPAWNER_MAXIMUM_DELAY) .minimum(DataConstants.MINIMUM_SPAWNER_MAXIMUM_SPAWN_DELAY) .maximum(Short.MAX_VALUE) .defaultValue(DataConstants.DEFAULT_SPAWNER_MAXIMUM_SPAWN_DELAY) .actualValue(actualValue) .build(); }
Source:
public void test_parallelPrefix$D() { Random rand = new Random(0); double[] list = new double[1000]; for(int i = 0; i < list.length; ++i) { list[i] = rand.nextDouble() % 1000; } double[] seqResult = list.clone(); for(int i = 0; i < seqResult.length - 1; ++i) { seqResult[i + 1] += seqResult[i]; } Arrays.parallelPrefix(list, (x, y) -> x + y); int[] listInInt = Arrays.stream(list).mapToInt(x -> (int) x).toArray(); int[] seqResultInInt = Arrays.stream(seqResult).mapToInt(x -> (int) x).toArray(); assertTrue(Arrays.equals(seqResultInInt, listInInt)); try { Arrays.parallelPrefix(list, null); fail(); } catch (NullPointerException expected) { } try { Arrays.parallelPrefix((double[]) null, (x, y) -> x + y); fail(); } catch (NullPointerException expected) { } }

Target:
public void test_setAll$D() { double[] list = new double[3]; list[0] = 0.0d; list[1] = 1.0d; list[2] = 2.0d; Arrays.setAll(list, x -> x + 0.5); assertEquals(0.5d, list[0]); assertEquals(1.5d, list[1]); assertEquals(2.5d, list[2]); try { Arrays.setAll(list, null); fail(); } catch (NullPointerException expected) { } try { Arrays.setAll((double[]) null, x -> x + 0.5); fail(); } catch (NullPointerException expected) { } }
Source:
public void handleStatus(int status) { status = status / 100; switch (status) { case 1: informationalResponseCounter.increment(); break; case 2: successResponseCounter.increment(); break; case 3: redirectResponseCounter.increment(); break; case 4: clientErrorResponseCounter.increment(); break; case 5: serverErrorResponseCounter.increment(); break; } }

Target:
public void handleStatus(int status) { status = status / 100; switch (status) { case 1: informationalResponseCounter.increment(); break; case 2: successResponseCounter.increment(); break; case 3: redirectResponseCounter.increment(); break; case 4: clientErrorResponseCounter.increment(); break; case 5: serverErrorResponseCounter.increment(); break; default: LOG.warn("Unhandled HTTP status ", status); } }
Source:
public static List<String> getAllBroadcastAddresses() { List<String> broadcastAddresses = new LinkedList<String>(); try { final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { final NetworkInterface networkInterface = networkInterfaces.nextElement(); final List<InterfaceAddress> interfaceAddresses = networkInterface.getInterfaceAddresses(); for (InterfaceAddress interfaceAddress : interfaceAddresses) { final InetAddress addr = interfaceAddress.getAddress(); if (addr instanceof Inet4Address && !addr.isLinkLocalAddress() && !addr.isLoopbackAddress()) { InetAddress broadCast = interfaceAddress.getBroadcast(); if (broadCast != null) { broadcastAddresses.add(broadCast.getHostAddress()); } } } } } catch (SocketException ex) { LOGGER.error("Could not find broadcast address: {}", ex.getMessage(), ex); } return broadcastAddresses; }

Target:
public static List<String> getAllBroadcastAddresses() { List<String> broadcastAddresses = new LinkedList<String>(); try { final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { final NetworkInterface networkInterface = networkInterfaces.nextElement(); final List<InterfaceAddress> interfaceAddresses = networkInterface.getInterfaceAddresses(); for (InterfaceAddress interfaceAddress : interfaceAddresses) { final InetAddress addr = interfaceAddress.getAddress(); if (addr instanceof Inet4Address && !addr.isLinkLocalAddress() && !addr.isLoopbackAddress()) { InetAddress broadcast = interfaceAddress.getBroadcast(); if (broadcast != null) { broadcastAddresses.add(broadcast.getHostAddress()); } } } } } catch (SocketException ex) { LOGGER.error("Could not find broadcast address: {}", ex.getMessage(), ex); } return broadcastAddresses; }
Source:
protected void captureAndVerifyCommentEventNotification(Supplier<DocumentModel> supplier, String commentEventType, String documentEventType) { try (CapturingEventListener listener = new CapturingEventListener(commentEventType, documentEventType)) { DocumentModel commentDocumentModel = supplier.get(); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(commentEventType)); assertTrue(listener.hasBeenFired(documentEventType)); List<Event> handledEvents = listener.getCapturedEvents() .stream() .filter(e -> commentEventType.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); Event expectedEvent = handledEvents.get(0); assertEquals(commentEventType, expectedEvent.getName()); checkDocumentEventContext(expectedEvent, commentDocumentModel, commentedDocumentModel); } }

Target:
protected void captureAndVerifyCommentEventNotification(Supplier<DocumentModel> supplier, String commentEventType, String documentEventType) { try (CapturingEventListener listener = new CapturingEventListener(commentEventType, documentEventType)) { DocumentModel commentDocumentModel = supplier.get(); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(commentEventType)); assertTrue(listener.hasBeenFired(documentEventType)); List<Event> handledEvents = listener.streamCapturedEvents() .filter(e -> commentEventType.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); checkDocumentEventContext(handledEvents.get(0), commentDocumentModel, commentedDocumentModel); } }
Source:
private int getTotalGlobalRefCount() { int totalRefCount = 0; for (RealmCacheType type : RealmCacheType.values()) { totalRefCount += refAndCountMap.get(type).globalCount; } return totalRefCount; }

Target:
private int getTotalGlobalRefCount() { int totalRefCount = 0; for (RefAndCount refAndCount : refAndCountMap.values()) { totalRefCount += refAndCount.globalCount; } return totalRefCount; }
Source:
private File createZipFile(Set<String> bundles) throws IOException { File rootDirectory = SupportPlugin.getRootDirectory(); File zipFile = File.createTempFile( String.format("multiBundle(%s)-", bundles.size()), ".zip");; try(FileOutputStream fos = new FileOutputStream(zipFile); ZipOutputStream zos = new ZipOutputStream(fos)) { byte[] buffer = new byte[1024]; for (String bundle: bundles) { File file = new File(rootDirectory, bundle); try(FileInputStream fis = new FileInputStream(file)) { zos.putNextEntry(new ZipEntry(file.getName())); int length; while ((length = fis.read(buffer)) > 0) { zos.write(buffer, 0, length); } } } } catch (IOException e) { logger.log(Level.SEVERE, "Error creating zip file: " + zipFile.getAbsolutePath(), e); } return zipFile; }

Target:
private File createZipFile(Set<String> bundles) throws IOException { File rootDirectory = SupportPlugin.getRootDirectory(); File zipFile = File.createTempFile( String.format("multiBundle(%s)-", bundles.size()), ".zip"); zipFile.deleteOnExit(); try(FileOutputStream fos = new FileOutputStream(zipFile); ZipOutputStream zos = new ZipOutputStream(fos)) { byte[] buffer = new byte[1024]; for (String bundle: bundles) { File file = new File(rootDirectory, bundle); try(FileInputStream fis = new FileInputStream(file)) { zos.putNextEntry(new ZipEntry(file.getName())); int length; while ((length = fis.read(buffer)) > 0) { zos.write(buffer, 0, length); } } } } catch (IOException e) { logger.log(Level.SEVERE, "Error creating zip file: " + zipFile.getAbsolutePath(), e); } return zipFile; }
Source:
String serialize(final String uniqueUserId) throws AuthenticationException { if (StringExtensions.IsNullOrBlank(uniqueUserId)) { throw new IllegalArgumentException("uniqueUserId"); } if ((new BrokerProxy(mContext)).canSwitchToBroker()) { throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT,"Failed to export the FID because broker is enabled."); } final String cacheKey = CacheKey.createCacheKey(this.getAuthority(), null, AuthenticationConstants.MS_FAMILY_ID, true, uniqueUserId); final TokenCacheItem tokenItem = this.getCache().getItem(cacheKey); if (tokenItem == null) { Logger.i(TAG, "Cannot find the FoCI token cache item for this userID", ""); return null; } final SSOStateContainer blobContainer = new SSOStateContainer(tokenItem); Logger.i(TAG, "prepare to serialize",""); return blobContainer.serialize(); }

Target:
String serialize(final String uniqueUserId) throws AuthenticationException { if (StringExtensions.IsNullOrBlank(uniqueUserId)) { throw new IllegalArgumentException("uniqueUserId"); } if (mBrokerProxy.canSwitchToBroker()) { throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "Failed to export the family refresh token cache item because broker is enabled."); } final String cacheKey = CacheKey.createCacheKeyForFRT(this.getAuthority(), AuthenticationConstants.MS_FAMILY_ID, uniqueUserId); final TokenCacheItem tokenItem = this.getCache().getItem(cacheKey); if (tokenItem == null) { Logger.i(TAG, "Cannot find the family token cache item for this userID", ""); throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "Failed to export the FID because no family token cache item is found."); } if (!StringExtensions.IsNullOrBlank(tokenItem.getFamilyClientId())) { return SSOStateSerializer.serialize(tokenItem); } else { throw new IllegalArgumentException("tokenItem does not contain family refresh token"); } }
Source:
public synchronized void dispose() { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); launchManager.removeLaunchConfigurationListener(this); launchManager.removeLaunchListener(this); for (ISourceLookupParticipant participant : fParticipants) { if(participant != this) { participant.dispose(); } } fParticipants.clear(); if (fSourceContainers != null) { for (ISourceContainer fSourceContainer : fSourceContainers) { fSourceContainer.dispose(); } } fSourceContainers = null; fResolvedElements = null; }

Target:
public synchronized void dispose() { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); launchManager.removeLaunchConfigurationListener(this); launchManager.removeLaunchListener(this); for (ISourceLookupParticipant participant : fParticipants) { if(participant != this) { participant.dispose(); } } fParticipants.clear(); if (fSourceContainers != null) { for (ISourceContainer container : fSourceContainers) { container.dispose(); } } fSourceContainers = null; fResolvedElements = null; }
Source:
public void execute(final TSDB tsdb, final HttpQuery query) { if (!query.hasQueryStringParam("json") && !query.hasQueryStringParam("png") && !query.hasQueryStringParam("ascii")) { String uri = query.request().getUri(); if (uri.length() < 4) { uri = "/"; } else { uri = "/#" + uri.substring(2); } query.redirect(uri); return; } try { doGraph(tsdb, query); } catch (IOException e) { query.internalError(e); } catch (IllegalArgumentException e) { query.badRequest(e.getMessage()); } }

Target:
public void execute(final TSDB tsdb, final HttpQuery query) { if (!query.hasQueryStringParam("json") && !query.hasQueryStringParam("png") && !query.hasQueryStringParam("ascii")) { String uri = query.request().getUri(); if (uri.length() < 4) { uri = "/"; } else { uri = "/#" + uri.substring(3); } query.redirect(uri); return; } try { doGraph(tsdb, query); } catch (IOException e) { query.internalError(e); } catch (IllegalArgumentException e) { query.badRequest(e.getMessage()); } }
Source:
private void offLine(final int status, Object device) { String err = Errors.getErrorMessage(status); this.logger.warn("Warning: " + status + (err == null ? " " : err)); if (UDClientStatus.isBusy()) { return; } if (status == 1050) { this.socket_open_failed_count++; } if (this.socket_open_failed_count < 3) { return; } this.socket_open_failed_count = 0; if (device == null) { device = UDControlPoint.firstDevice; } if (device != null && device instanceof UDProxyDevice) { UDControlPoint.getInstance().offLine((UDProxyDevice) device); } }

Target:
private void offLine(final int status, Object device) { String err = Errors.getErrorMessage(status); this.logger.warn("Warning: {}", status, (err == null ? " " : err)); if (UDClientStatus.isBusy()) { return; } if (status == 1050) { this.socket_open_failed_count++; } if (this.socket_open_failed_count < 3) { return; } this.socket_open_failed_count = 0; if (device == null) { device = UDControlPoint.firstDevice; } if (device != null && device instanceof UDProxyDevice) { UDControlPoint.getInstance().offLine((UDProxyDevice) device); } }
Source:
public static <T> void persistToKnoxShell(String fileName, Map<String, List<T>> map) { String s = JsonUtils.renderAsJsonString(map); String home = System.getProperty("user.home"); try { FileUtils.write(new File( home + File.separator + ".knoxshell" + File.separator + fileName), s, StandardCharsets.UTF_8); } catch (IOException e) { e.printStackTrace(); } }

Target:
public static <T> void persistToKnoxShell(String fileName, Map<String, List<T>> map) { String s = JsonUtils.renderAsJsonString(map); String home = System.getProperty("user.home"); try { write(new File( home + File.separator + ".knoxshell" + File.separator + fileName), s, StandardCharsets.UTF_8); } catch (IOException e) { e.printStackTrace(); } }
Source:
public void init(String name, Class<? extends ITmfEvent> type) { super.init(name); fType = type; fDataQueue = (fQueueSize > 1) ? new LinkedBlockingQueue<ITmfEvent>(fQueueSize) : new SynchronousQueue<ITmfEvent>(); fExecutor.init(); fSignalDepth = 0; synchronized (fLock) { fTimer = new Timer(); } TmfProviderManager.register(fType, this); }

Target:
public void init(String name, Class<? extends ITmfEvent> type) { super.init(name); fType = type; fExecutor.init(); fSignalDepth = 0; synchronized (fLock) { fTimer = new Timer(); } TmfProviderManager.register(fType, this); }
Source:
private CardDetailsEntity buildCardDetailsEntity(AuthCardDetails authCardDetails) { CardDetailsEntity detailsEntity = new CardDetailsEntity(); detailsEntity.setCardBrand(sanitize(authCardDetails.getCardBrand())); detailsEntity.setCardHolderName(sanitize(authCardDetails.getCardHolder())); detailsEntity.setExpiryDate(authCardDetails.getEndDate()); if (authCardDetails.getCardNo().length() > 6) { detailsEntity.setFirstDigitsCardNumber(FirstDigitsCardNumber.of(StringUtils.left(authCardDetails.getCardNo(), 6))); } detailsEntity.setLastDigitsCardNumber(LastDigitsCardNumber.of(StringUtils.right(authCardDetails.getCardNo(), 4))); if (authCardDetails.getAddress().isPresent()) detailsEntity.setBillingAddress(new AddressEntity(authCardDetails.getAddress().get())); return detailsEntity; }

Target:
private CardDetailsEntity buildCardDetailsEntity(AuthCardDetails authCardDetails) { CardDetailsEntity detailsEntity = new CardDetailsEntity(); detailsEntity.setCardBrand(sanitize(authCardDetails.getCardBrand())); detailsEntity.setCardHolderName(sanitize(authCardDetails.getCardHolder())); detailsEntity.setExpiryDate(authCardDetails.getEndDate()); if (hasFullCardNumber(authCardDetails)) { detailsEntity.setFirstDigitsCardNumber(FirstDigitsCardNumber.of(StringUtils.left(authCardDetails.getCardNo(), 6))); } detailsEntity.setLastDigitsCardNumber(LastDigitsCardNumber.of(StringUtils.right(authCardDetails.getCardNo(), 4))); if (authCardDetails.getAddress().isPresent()) detailsEntity.setBillingAddress(new AddressEntity(authCardDetails.getAddress().get())); return detailsEntity; }
Source:
public Observable<Visit> getVisitByID(final Long visitID) { return makeObservable(visitTable.getVisitById(visitID)) .subscribeOn(Schedulers.computation()); }

Target:
public Observable<Visit> getVisitByID(final Long visitID) { return createObservableIO(() -> { DBOpenHelper helper = OpenMRSDBOpenHelper.getInstance().getDBOpenHelper(); Visit visit = null; String where = String.format("%s = ?", VisitTable.Column.ID); String[] whereArgs = new String[]{visitID.toString()}; String orderBy = VisitTable.Column.START_DATE + " DESC"; final Cursor cursor = helper.getReadableDatabase().query(VisitTable.TABLE_NAME, null, where, whereArgs, null, null, orderBy); if (null != cursor) { try { if (cursor.moveToFirst()) { int visitUUID_CI = cursor.getColumnIndex(VisitTable.Column.UUID); int visitID_CI = cursor.getColumnIndex(VisitTable.Column.ID); int visitType_CI = cursor.getColumnIndex(VisitTable.Column.VISIT_TYPE); int visitPlace_CI = cursor.getColumnIndex(VisitTable.Column.VISIT_PLACE); int visitStart_CI = cursor.getColumnIndex(VisitTable.Column.START_DATE); int visitStop_CI = cursor.getColumnIndex(VisitTable.Column.STOP_DATE); int visitPatientID_CI = cursor.getColumnIndex(VisitTable.Column.PATIENT_KEY_ID); visit = new Visit(); visit.setUuid(cursor.getString(visitUUID_CI)); visit.setId(cursor.getLong(visitID_CI)); visit.setVisitType(new VisitType(cursor.getString(visitType_CI))); visit.setLocation(LocationDAO.findLocationByName(cursor.getString(visitPlace_CI))); visit.setStartDatetime(cursor.getString(visitStart_CI)); visit.setStopDatetime(cursor.getString(visitStop_CI)); visit.setEncounters(new EncounterDAO().findEncountersByVisitID(visitID)); visit.setPatient(new PatientDAO().findPatientByID(String.valueOf(cursor.getLong(visitPatientID_CI)))); } } finally { cursor.close(); } } return visit; }); }
Source:
public void listPatchesAgainstBase() throws Exception { add(git, FILE_D, "4"); createCommit(git, admin.getIdent(), SUBJECT_1); pushHead(git, "refs/heads/master", false); add(git, FILE_A, "1"); rm(git, FILE_D); Commit c = createCommit(git, admin.getIdent(), SUBJECT_2); pushHead(git, "refs/for/master", false); List<PatchListEntry> entries = getCurrentPatches(c.getChangeId()); assertThat(3).isEqualTo(entries.size()); assertAdded(Patch.COMMIT_MSG, entries.get(0)); assertAdded(FILE_A, entries.get(1)); assertDeleted(FILE_D, entries.get(2)); add(git, FILE_B, "2"); c = amendCommit(git, admin.getIdent(), SUBJECT_2, c.getChangeId()); pushHead(git, "refs/for/master", false); entries = getCurrentPatches(c.getChangeId()); assertThat(4).isEqualTo(entries.size()); assertAdded(Patch.COMMIT_MSG, entries.get(0)); assertAdded(FILE_A, entries.get(1)); assertAdded(FILE_B, entries.get(2)); assertDeleted(FILE_D, entries.get(3)); }

Target:
public void listPatchesAgainstBase() throws Exception { add(git, FILE_D, "4"); createCommit(git, admin.getIdent(), SUBJECT_1); pushHead(git, "refs/heads/master", false); add(git, FILE_A, "1"); rm(git, FILE_D); Commit c = createCommit(git, admin.getIdent(), SUBJECT_2); pushHead(git, "refs/for/master", false); List<PatchListEntry> entries = getCurrentPatches(c.getChangeId()); assertThat(entries).hasSize(3); assertAdded(Patch.COMMIT_MSG, entries.get(0)); assertAdded(FILE_A, entries.get(1)); assertDeleted(FILE_D, entries.get(2)); add(git, FILE_B, "2"); c = amendCommit(git, admin.getIdent(), SUBJECT_2, c.getChangeId()); pushHead(git, "refs/for/master", false); entries = getCurrentPatches(c.getChangeId()); assertThat(entries).hasSize(4); assertAdded(Patch.COMMIT_MSG, entries.get(0)); assertAdded(FILE_A, entries.get(1)); assertAdded(FILE_B, entries.get(2)); assertDeleted(FILE_D, entries.get(3)); }
Source:
public String toString() { StringBuffer bufStr = new StringBuffer(); if (cacheBuffers != null) { for (MemoryBuffer mb : cacheBuffers) { bufStr.append(mb.getClass().getSimpleName() + " with " + mb.getByteBufferRaw().remaining() + " bytes, "); } } return "ColumnStreamData [cacheBuffers=[" + bufStr.toString() + "], indexBaseOffset=" + indexBaseOffset + "]"; }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); if (cacheBuffers != null) { Iterator<MemoryBuffer> iter = cacheBuffers.iterator(); while (iter.hasNext()) { MemoryBuffer mb = iter.next(); sb.append(mb.getClass().getSimpleName()); sb.append(" with "); sb.append(mb.getByteBufferRaw().remaining()); sb.append(" bytes"); if (iter.hasNext()) { sb.append(", "); } } } return "ColumnStreamData [cacheBuffers=[" + sb.toString() + "], indexBaseOffset=" + indexBaseOffset + "]"; }
Source:
public Cost getCost() throws SQLException { Long byteCount = getEstimatedBytesToScan(); if (byteCount == null) { return Cost.ZERO; } int parallelLevel = 1; Cost cost = CostUtil.estimateAggregateCost(byteCount, !groupBy.isUngroupedAggregate(), clientAggregators.getEstimatedByteSize(), parallelLevel); if (!orderBy.getOrderByExpressions().isEmpty()) { double outputBytes = CostUtil.estimateAggregateOutputBytes( byteCount, !groupBy.isUngroupedAggregate(), clientAggregators.getEstimatedByteSize()); Cost orderByCost = CostUtil.estimateOrderByCost(outputBytes, parallelLevel); cost = cost.plus(orderByCost); } return super.getCost().plus(cost); }

Target:
public Cost getCost() { Long byteCount = null; try { byteCount = getEstimatedBytesToScan(); } catch (SQLException e) { } if (byteCount == null) { return Cost.UNKNOWN; } int parallelLevel = CostUtil.estimateParallelLevel( false, context.getConnection().getQueryServices()); Cost cost = CostUtil.estimateAggregateCost(byteCount, groupBy, clientAggregators.getEstimatedByteSize(), parallelLevel); if (!orderBy.getOrderByExpressions().isEmpty()) { double outputBytes = CostUtil.estimateAggregateOutputBytes( byteCount, groupBy, clientAggregators.getEstimatedByteSize()); Cost orderByCost = CostUtil.estimateOrderByCost(outputBytes, parallelLevel); cost = cost.plus(orderByCost); } return super.getCost().plus(cost); }
Source:
public ConnectorAccessControl getConnectorAccessControl(FileBasedAccessControlConfig config) throws IOException { if (config.getRefreshPeriod() != null) { return refreshingConnectorAccessControl( () -> { log.info("Refreshing access control, because '%s' was modified", config.getConfigFile()); try { return new FileBasedAccessControl(config); } catch (IOException e) { throw new UncheckedIOException(e); } }, wasFileModified(Paths.get(config.getConfigFile())), config.getRefreshPeriod()); } return new FileBasedAccessControl(config); }

Target:
public ConnectorAccessControl getConnectorAccessControl(FileBasedAccessControlConfig config) { if (config.getRefreshPeriod() != null) { return ForwardingConnectorAccessControl.of(memoizeWithExpiration( () -> { log.info("Refreshing system access control from %s", config.getConfigFile()); return new FileBasedAccessControl(config); }, config.getRefreshPeriod().toMillis(), MILLISECONDS)); } return new FileBasedAccessControl(config); }
Source:
public @Nonnull String getAccessToken() { return accessToken.getPlainText(); }

Target:
public @Nonnull Secret getAccessToken() { return accessToken; }
Source:
public synchronized AdHocPlannedStatement planSqlCalcite(SqlTask task) throws ValidationException, RelConversionException, PlannerFallbackException { CacheUse cacheUse = CacheUse.FAIL; SqlNode node = task.getParsedQuery(); SqlNode node0 = node.clone(node.getParserPosition()); if (m_plannerStats != null) { m_plannerStats.startStatsCollection(); } try { AdHocPlannedStatement cachedPlan = m_calciteCache.getWithSQL(task.getSQL()); if (cachedPlan != null) { cacheUse = CacheUse.HIT1; return cachedPlan; } else { cacheUse = CacheUse.MISS; } AdHocPlannedStatement ahps = null; ParameterizedSqlTask ptask = new ParameterizedSqlTask(task); String parameterizedQuery = ptask.getParsedQuery().toString(); final CorePlan corePlan = m_calciteCache.getWithParsedQuery(parameterizedQuery); if (corePlan != null) { ahps = new AdHocPlannedStatement(ptask.getSQL().getBytes(Constants.UTF8ENCODING), corePlan, ParameterSet.fromArrayNoCopy(generateVoltParams(ptask)), null); } else { CompiledPlan plan = getCompiledPlanCalcite(m_schemaPlus, node); plan.sql = task.getSQL(); CorePlan core = new CorePlan(plan, m_catalogHash); ahps = new AdHocPlannedStatement(plan.sql.getBytes(Constants.UTF8ENCODING), core, ParameterSet.fromArrayNoCopy(generateVoltParams(ptask)), null); } throw new PlannerFallbackException(); } finally { if (m_plannerStats != null) { m_plannerStats.endStatsCollection(m_calciteCache.getLiteralCacheSize(), m_calciteCache.getCoreCacheSize(), cacheUse, -1); } } }

Target:
public synchronized AdHocPlannedStatement planSqlCalcite(SqlTask task) throws ValidationException, RelConversionException, PlannerFallbackException { CacheUse cacheUse = CacheUse.FAIL; SqlNode node = task.getParsedQuery(); if (m_plannerStats != null) { m_plannerStats.startStatsCollection(); } try { AdHocPlannedStatement cachedPlan = m_calciteCache.getWithSQL(task.getSQL()); if (cachedPlan != null) { cacheUse = CacheUse.CHIT1; throw new PlannerFallbackException(); } else { cacheUse = CacheUse.CMISS; } VoltPlanner planner = new VoltPlanner(m_schemaPlus); AdHocPlannedStatement ahps = null; ParameterizedSqlTask ptask = new ParameterizedSqlTask(task); String parameterizedQuery = ptask.getParsedQuery().toString(); final CorePlan corePlan = m_calciteCache.getWithParsedQuery(parameterizedQuery); if (corePlan != null) { ahps = new AdHocPlannedStatement(ptask.getSQL().getBytes(Constants.UTF8ENCODING), corePlan, ParameterSet.fromArrayNoCopy(generateVoltParams(ptask)), null); cacheUse = CacheUse.CHIT2; } else { planner.validate(node); CompiledPlan plan = getCompiledPlanCalcite(planner, m_schemaPlus, node); plan.sql = task.getSQL(); CorePlan core = new CorePlan(plan, m_catalogHash); ahps = new AdHocPlannedStatement(plan.sql.getBytes(Constants.UTF8ENCODING), core, ParameterSet.fromArrayNoCopy(generateVoltParams(ptask)), null); m_calciteCache.put(task.getSQL(), parameterizedQuery, ahps, null, false, false); } throw new PlannerFallbackException(); } finally { if (m_plannerStats != null) { m_plannerStats.endStatsCollection(m_calciteCache.getLiteralCacheSize(), m_calciteCache.getCoreCacheSize(), cacheUse, -1); } } }
Source:
private static IConfiguration helper_getActiveConfiguration(IProject project) { IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project); IConfiguration ActiveConf = buildInfo.getDefaultConfiguration(); return ActiveConf; }

Target:
private static IConfiguration helper_getActiveConfiguration(IProject project) { IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project); return buildInfo.getDefaultConfiguration(); }
Source:
private boolean performNextOperationLiveMerge(int completedChildren) { if (completedChildren != 0) { checkImageIdConsistency(completedChildren - 1); } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskLiveParameters(nextImageId, completedChildren); updateParameters(completedChildren, parameters.getDestinationImageId()); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDiskLive, parameters, cloneContextAndDetachFromParent()); return true; }

Target:
private boolean performNextOperationLiveMerge(int completedChildren) { if (completedChildren != 0) { checkImageIdConsistency(completedChildren - 1); } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskLiveParameters(nextImageId, completedChildren); updateParameters(completedChildren, parameters.getDestinationImageId()); persistCommand(getParameters().getParentCommand(), true); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDiskLive, parameters, cloneContextAndDetachFromParent()); return true; }
Source:
public <T> Flux<T> runQuery(SqlQuerySpec querySpec, Class<?> domainType, Class<T> returnType) { String containerName = domainType.getSimpleName(); CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); return cosmosAsyncClient.getDatabase(this.databaseName) .getContainer(containerName) .queryItems(querySpec, options, returnType) .byPage() .flatMap(cosmosItemFeedResponse -> { CosmosUtils .fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor, cosmosItemFeedResponse.getCosmosDiagnostics(), cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.getResults()); }) .onErrorResume(throwable -> CosmosExceptionUtils.exceptionHandler("Failed to find items", throwable)); }

Target:
public <T> Flux<T> runQuery(SqlQuerySpec querySpec, Class<?> domainType, Class<T> returnType) { String containerName = domainType.getSimpleName(); CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); return cosmosAsyncClient.getDatabase(this.databaseName) .getContainer(containerName) .queryItems(querySpec, options, returnType) .byPage() .publishOn(Schedulers.parallel()) .flatMap(cosmosItemFeedResponse -> { CosmosUtils .fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor, cosmosItemFeedResponse.getCosmosDiagnostics(), cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.getResults()); }) .onErrorResume(throwable -> CosmosExceptionUtils.exceptionHandler("Failed to find items", throwable)); }
Source:
public void testParcelling_withSmallBitmap_bitmapPreservedAfterParcelled() { final int testBitmapSize = 200; Bitmap testBitmap = Bitmap.createBitmap( testBitmapSize, testBitmapSize, Bitmap.Config.ARGB_8888); testBitmap.setPixel(2, 2, Color.GREEN); String testKey = MediaMetadata.METADATA_KEY_ALBUM_ART; MediaMetadata metadata = new Builder().putBitmap(testKey, testBitmap).build(); ParcelImpl parcelImpl = (ParcelImpl) ParcelUtils.toParcelable(metadata); try (AutoCloseableParcel p = AutoCloseableParcel.createWithParcelImpl(parcelImpl)) { MediaMetadata metadataFromParcel = ParcelUtils.fromParcelable(ParcelImpl.CREATOR.createFromParcel(p.parcel)); assertEquals(testBitmapSize, metadata.getBitmap(testKey).getHeight()); assertEquals(testBitmapSize, metadata.getBitmap(testKey).getWidth()); assertTrue(testBitmap.sameAs(metadata.getBitmap(testKey))); } }

Target:
public void testParcelling_withSmallBitmap_bitmapPreservedAfterParcelled() { final int testBitmapSize = 200; Bitmap testBitmap = Bitmap.createBitmap( testBitmapSize, testBitmapSize, Bitmap.Config.ARGB_8888); testBitmap.setPixel(2, 2, Color.GREEN); String testKey = MediaMetadata.METADATA_KEY_ALBUM_ART; MediaMetadata metadata = new Builder().putBitmap(testKey, testBitmap).build(); ParcelImpl parcelImpl = (ParcelImpl) ParcelUtils.toParcelable(metadata); Parcel parcel = Parcel.obtain(); try { parcelImpl.writeToParcel(parcel, 0 ); parcel.setDataPosition(0); MediaMetadata metadataFromParcel = ParcelUtils.fromParcelable(ParcelImpl.CREATOR.createFromParcel(parcel)); assertEquals(testBitmapSize, metadata.getBitmap(testKey).getHeight()); assertEquals(testBitmapSize, metadata.getBitmap(testKey).getWidth()); assertTrue(testBitmap.sameAs(metadata.getBitmap(testKey))); } finally { parcel.recycle(); } }
Source:
public String toString() { try { return String.format("%s%s%s%s", getActivityId(), getDashedString(getActivityName()), getDashedString(getWorkPackageId()), getDashedString(getName())); } catch (OseeCoreException ex) { OseeLog.log(org.eclipse.osee.ats.core.client.internal.Activator.class, OseeLevel.SEVERE_POPUP, ex); } return String.format("%s - Exception (see log file)", getName()); }

Target:
public String toString() { try { StringBuilder builder = new StringBuilder(getActivityId()); addWithHypen(builder, getActivityName()); addWithHypen(builder, getWorkPackageId()); addWithHypen(builder, getName()); return builder.toString(); } catch (OseeCoreException ex) { OseeLog.log(org.eclipse.osee.ats.core.client.internal.Activator.class, OseeLevel.SEVERE_POPUP, ex); } return String.format("%s - Exception (see log file)", getName()); }
Source:
public UserVideosResponse getUserVideos( @PathParam("userid") int userid, @QueryParam("page") String page) { Statement statement = videosByUser.bind(userid).setPageSize(ITEMS_PER_PAGE); if (page != null) { statement = statement.setPagingState(Bytes.fromHexString(page)); } ResultSet rs = session.execute(statement); String nextPage = Bytes.toHexString(rs.getExecutionInfo().getPagingState()); int remaining = rs.getAvailableWithoutFetching(); List<UserVideo> videos = new ArrayList<>(remaining); if (remaining > 0) { for (Row row : rs) { UserVideo video = new UserVideo(row.getInt("videoid"), row.getString("title"), row.getInstant("added")); videos.add(video); if (--remaining == 0) { break; } } } URI next = null; if (nextPage != null) next = uri.getAbsolutePathBuilder().queryParam("page", nextPage).build(); return new UserVideosResponse(videos, next); }

Target:
public UserVideosResponse getUserVideos( @PathParam("userid") int userid, @QueryParam("page") String page) { BoundStatementBuilder statementBuilder = videosByUser.boundStatementBuilder(userid).setPageSize(ITEMS_PER_PAGE); if (page != null) { statementBuilder.setPagingState(Bytes.fromHexString(page)); } ResultSet rs = session.execute(statementBuilder.build()); String nextPage = Bytes.toHexString(rs.getExecutionInfo().getPagingState()); int remaining = rs.getAvailableWithoutFetching(); List<UserVideo> videos = new ArrayList<>(remaining); if (remaining > 0) { for (Row row : rs) { UserVideo video = new UserVideo(row.getInt("videoid"), row.getString("title"), row.getInstant("added")); videos.add(video); if (--remaining == 0) { break; } } } URI next = null; if (nextPage != null) next = uri.getAbsolutePathBuilder().queryParam("page", nextPage).build(); return new UserVideosResponse(videos, next); }
Source:
public BlockEncodingManager(TypeManager typeManager, Set<BlockEncodingFactory<?>> blockEncodingFactories) { requireNonNull(typeManager, "typeManager is null"); addBlockEncodingFactory(new VariableWidthBlockEncodingFactory()); addBlockEncodingFactory(new FixedWidthBlockEncodingFactory()); addBlockEncodingFactory(new ByteArrayBlockEncodingFactory()); addBlockEncodingFactory(new ShortArrayBlockEncodingFactory()); addBlockEncodingFactory(new IntArrayBlockEncodingFactory()); addBlockEncodingFactory(new LongArrayBlockEncodingFactory()); addBlockEncodingFactory(new DictionaryBlockEncodingFactory()); addBlockEncodingFactory(new ArrayBlockEncodingFactory()); addBlockEncodingFactory(new MapBlockEncodingFactory(typeManager)); addBlockEncodingFactory(new SingleMapBlockEncodingFactory(typeManager)); addBlockEncodingFactory(new RowBlockEncodingFactory()); addBlockEncodingFactory(new SingleRowBlockEncodingFactory()); addBlockEncodingFactory(new RunLengthBlockEncodingFactory()); for (BlockEncodingFactory<?> factory : requireNonNull(blockEncodingFactories, "blockEncodingFactories is null")) { addBlockEncodingFactory(factory); } }

Target:
public BlockEncodingManager(TypeManager typeManager, Set<BlockEncodingFactory<?>> blockEncodingFactories) { addBlockEncodingFactory(new VariableWidthBlockEncodingFactory()); addBlockEncodingFactory(new FixedWidthBlockEncodingFactory()); addBlockEncodingFactory(new ByteArrayBlockEncodingFactory()); addBlockEncodingFactory(new ShortArrayBlockEncodingFactory()); addBlockEncodingFactory(new IntArrayBlockEncodingFactory()); addBlockEncodingFactory(new LongArrayBlockEncodingFactory()); addBlockEncodingFactory(new DictionaryBlockEncodingFactory()); addBlockEncodingFactory(new ArrayBlockEncodingFactory()); addBlockEncodingFactory(new MapBlockEncodingFactory(typeManager)); addBlockEncodingFactory(new SingleMapBlockEncodingFactory(typeManager)); addBlockEncodingFactory(new RowBlockEncodingFactory()); addBlockEncodingFactory(new SingleRowBlockEncodingFactory()); addBlockEncodingFactory(new RunLengthBlockEncodingFactory()); for (BlockEncodingFactory<?> factory : requireNonNull(blockEncodingFactories, "blockEncodingFactories is null")) { addBlockEncodingFactory(factory); } }
Source:
public Optional<Application> applicationForKey(String apiKey) { return Optional.fromNullable(translator.fromDBObject( applications.findOne( where().fieldEquals( String.format("%s.%s", MongoApplicationTranslator.CREDENTIALS_KEY, ApplicationCredentialsTranslator.API_KEY_KEY), apiKey) .build()) ) ); }

Target:
public Optional<Application> applicationForKey(String apiKey) { return Optional.fromNullable(translator.fromDBObject( applications.findOne( where().fieldEquals(CREDENTIALS_API_KEY, apiKey).build()) ) ); }
Source:
public CustomTrust() { SSLSocketFactory sslSocketFactory; try { KeyAndTrustManagers keyAndTrustManagers = trustManagerForCertificates(trustedCertificatesInputStream()); SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyAndTrustManagers.keyManagers, keyAndTrustManagers.trustManagers, null); sslSocketFactory = sslContext.getSocketFactory(); client = new OkHttpClient.Builder() .sslSocketFactory(sslSocketFactory, (X509TrustManager) keyAndTrustManagers.trustManagers[0]) .build(); } catch (GeneralSecurityException e) { throw new RuntimeException(e); } }

Target:
public CustomTrust() { SSLSocketFactory sslSocketFactory; try { KeyAndTrustManagers keyAndTrustManagers = trustManagerForCertificates(trustedCertificatesInputStream()); SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyAndTrustManagers.keyManagers, keyAndTrustManagers.trustManagers, null); sslSocketFactory = sslContext.getSocketFactory(); X509TrustManager trustManager = (X509TrustManager) keyAndTrustManagers.trustManagers[0]; client = new OkHttpClient.Builder() .sslSocketFactory(sslSocketFactory, trustManager) .build(); } catch (GeneralSecurityException e) { throw new RuntimeException(e); } }
Source:
public static void copyFileFromAssets(String fileSourcePath, String fileDestPath) throws IOException { AssetManager assetManager = InstrumentationRegistry.getInstrumentation().getContext().getAssets(); try (InputStream input = assetManager.open(fileSourcePath); OutputStream output = new FileOutputStream(fileDestPath)) { byte[] buffer = new byte[1024]; int length; while ((length = input.read(buffer)) != -1) { output.write(buffer, 0, length); } } }

Target:
public static void copyFileFromAssets(String fileSourcePath, String fileDestPath) throws IOException { AssetManager assetManager = InstrumentationRegistry.getInstrumentation().getContext().getAssets(); try (InputStream input = assetManager.open(fileSourcePath); OutputStream output = new FileOutputStream(fileDestPath)) { IOUtils.copy(input, output); } }
Source:
protected List<ScheduledActivity> performMerge(List<ScheduledActivity> scheduledActivities, Map<String, ScheduledActivity> dbMap) { List<ScheduledActivity> saves = Lists.newArrayList(); for (int i=0; i < scheduledActivities.size(); i++) { ScheduledActivity activity = scheduledActivities.get(i); ScheduledActivity dbActivity = dbMap.remove(activity.getGuid()); boolean updatableStatus = dbActivity != null && UPDATABLE_STATUSES.contains(dbActivity.getStatus()); if (dbActivity != null && (!updatableStatus || dbActivity.getClientData() != null)) { scheduledActivities.set(i, dbActivity); } else if (activity.getStatus() != ScheduledActivityStatus.EXPIRED) { saves.add(activity); } } return saves; }

Target:
protected List<ScheduledActivity> performMerge(List<ScheduledActivity> scheduledActivities, Map<String, ScheduledActivity> dbMap) { List<ScheduledActivity> saves = Lists.newArrayList(); for (int i=0; i < scheduledActivities.size(); i++) { ScheduledActivity activity = scheduledActivities.get(i); ScheduledActivity dbActivity = dbMap.remove(activity.getGuid()); if (dbActivity != null && (!UPDATABLE_STATUSES.contains(dbActivity.getStatus()) || dbActivity.getClientData() != null)) { scheduledActivities.set(i, dbActivity); } else if (activity.getStatus() != ScheduledActivityStatus.EXPIRED) { saves.add(activity); } } return saves; }
Source:
static InternationalFixedDate create(final int prolepticYear, final int month, final int dayOfMonth) { InternationalFixedChronology.YEAR_RANGE.checkValidValue(prolepticYear, ChronoField.YEAR_OF_ERA); InternationalFixedChronology.MONTH_OF_YEAR_RANGE.checkValidValue(month, ChronoField.MONTH_OF_YEAR); InternationalFixedChronology.DAY_OF_MONTH_RANGE.checkValidValue(dayOfMonth, ChronoField.DAY_OF_MONTH); if (1 > prolepticYear) { throw new DateTimeException("Invalid date: " + prolepticYear + '-' + month + '-' + dayOfMonth); } return new InternationalFixedDate(prolepticYear, month, dayOfMonth); }

Target:
static InternationalFixedDate create(final int prolepticYear, final int month, final int dayOfMonth) { YEAR_RANGE.checkValidValue(prolepticYear, ChronoField.YEAR_OF_ERA); MONTH_OF_YEAR_RANGE.checkValidValue(month, ChronoField.MONTH_OF_YEAR); DAY_OF_MONTH_RANGE.checkValidValue(dayOfMonth, ChronoField.DAY_OF_MONTH); if ((month < 1 || dayOfMonth < 1) && (dayOfMonth != month)) { throw new DateTimeException("Ambiguous Year or Leap Day: " + prolepticYear + '/' + month + '/' + dayOfMonth); } if ((month == -1) && (dayOfMonth == -1) && !INSTANCE.isLeapYear(prolepticYear)) { throw new DateTimeException("Invalid Leap Day as '" + prolepticYear + "' is not a leap year"); } return new InternationalFixedDate(prolepticYear, month, dayOfMonth); }
Source:
public Market(String name) { this.marketName = name; stockList = new HashMap<String, Stock>(); marketHistory = new MarketHistory(this); orderBook = new OrderBook(this); }

Target:
public Market(String name) { this.name = name; stockList = new HashMap<String, Stock>(); marketHistory = new MarketHistory(this); orderBook = new OrderBook(this); }
Source:
private void recordSaveables(Saveable[] sourceSaveables) { if (knownSaveables == null) knownSaveables = new HashSet<Saveable>(); for (int i = 0; i < sourceSaveables.length; i++) { Saveable saveable = sourceSaveables[i]; knownSaveables.add(saveable); } }

Target:
private void recordSaveables(Saveable[] sourceSaveables) { if (knownSaveables == null) knownSaveables = new HashSet<>(); Collections.addAll(knownSaveables, sourceSaveables); }