auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void setApp(@NonNull AppWithState app) { impl.app = app; }

Target:
void setApp(@NonNull AppWithState app) { impl.setApp(app); }
Source:
Monitor getMonitor (long hmonitor) { MONITORINFO lpmi = new MONITORINFO (); lpmi.cbSize = MONITORINFO.sizeof; OS.GetMonitorInfo (hmonitor, lpmi); Monitor monitor = new Monitor (); monitor.handle = hmonitor; Rectangle boundsInPixels = new Rectangle (lpmi.rcMonitor_left, lpmi.rcMonitor_top, lpmi.rcMonitor_right - lpmi.rcMonitor_left,lpmi.rcMonitor_bottom - lpmi.rcMonitor_top); monitor.setBounds (DPIUtil.autoScaleDown (boundsInPixels)); Rectangle clientAreaInPixels = new Rectangle (lpmi.rcWork_left, lpmi.rcWork_top, lpmi.rcWork_right - lpmi.rcWork_left, lpmi.rcWork_bottom - lpmi.rcWork_top); monitor.setClientArea (DPIUtil.autoScaleDown (clientAreaInPixels)); if (OS.WIN32_VERSION >= OS.VERSION (6, 3)) { int dpiX = new int[1]; int dpiY = new int[1]; int result = OS.GetDpiForMonitor (monitor.handle, OS.MDT_EFFECTIVE_DPI, dpiX, dpiY); result = (result == OS.S_OK) ? DPIUtil.mapDPIToZoom (dpiX[0]) : 100; monitor.zoom = DPIUtil.getZoomForAutoscaleProperty (result); } else { long hDC = OS.GetDC (0); int dpi = OS.GetDeviceCaps (hDC, OS.LOGPIXELSX); OS.ReleaseDC (0, hDC); monitor.zoom = DPIUtil.mapDPIToZoom (dpi); } return monitor; }

Target:
Monitor getMonitor (long hmonitor) { MONITORINFO lpmi = new MONITORINFO (); lpmi.cbSize = MONITORINFO.sizeof; OS.GetMonitorInfo (hmonitor, lpmi); Monitor monitor = new Monitor (); monitor.handle = hmonitor; Rectangle boundsInPixels = new Rectangle (lpmi.rcMonitor_left, lpmi.rcMonitor_top, lpmi.rcMonitor_right - lpmi.rcMonitor_left,lpmi.rcMonitor_bottom - lpmi.rcMonitor_top); monitor.setBounds (DPIUtil.autoScaleDown (boundsInPixels)); Rectangle clientAreaInPixels = new Rectangle (lpmi.rcWork_left, lpmi.rcWork_top, lpmi.rcWork_right - lpmi.rcWork_left, lpmi.rcWork_bottom - lpmi.rcWork_top); monitor.setClientArea (DPIUtil.autoScaleDown (clientAreaInPixels)); if (OS.WIN32_VERSION >= OS.VERSION (6, 3)) { int dpiX = new int[1]; int dpiY = new int[1]; int result = OS.GetDpiForMonitor (monitor.handle, OS.MDT_EFFECTIVE_DPI, dpiX, dpiY); result = (result == OS.S_OK) ? DPIUtil.mapDPIToZoom (dpiX[0]) : 100; monitor.zoom = DPIUtil.getZoomForAutoscaleProperty (result); } else { monitor.zoom = getDeviceZoom (); } return monitor; }
Source:
public void testErrorWithMaxSeverityWarn() throws IOException { warnPrinter.error(null, ERROR_MSG, new Location(LINE_NUMBER, COLUMN_NUMBER)); warnPrinter.close(); assertEquals(expectedOutput(null, Severity.WARNING, ERROR_MSG, LINE_NUMBER, COLUMN_NUMBER), outContent.toString(Charset.defaultCharset().name())); }

Target:
public void testErrorWithMaxSeverityWarn() throws IOException { warnPrinter.error(Rules.LOWER_CAMEL_CASE, ERROR_MSG, new Location(LINE_NUMBER, COLUMN_NUMBER)); warnPrinter.close(); assertEquals(expectedOutput(Rules.LOWER_CAMEL_CASE, Severity.WARNING, ERROR_MSG, LINE_NUMBER, COLUMN_NUMBER), outContent.toString(Charset.defaultCharset().name())); }
Source:
public void render(List<T> dataList) { getView().removeAllViews(); if (dataList.size() == 0) { LayoutInflater inflater = LayoutInflater.from(getContext()); View rowView = inflater.inflate(emptyViewRenderer.getRowLayout(null), getView()); emptyViewRenderer.render(rowView, null); } for (T data : dataList) { LayoutInflater inflater = LayoutInflater.from(getContext()); View rowView = inflater.inflate(rowRenderer.getRowLayout(data), getView(), false); rowRenderer.render(rowView, data); getView().addView(rowView); } }

Target:
public void render(List<T> dataList) { getView().removeAllViews(); if (dataList.size() == 0) { getView().addView(emptyView); } for (T data : dataList) { LayoutInflater inflater = LayoutInflater.from(getContext()); View rowView = inflater.inflate(rowRenderer.getRowLayout(data), getView(), false); rowRenderer.render(rowView, data); getView().addView(rowView); } }
Source:
private void unregisterListeners() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { ISelectionService selectionService = ((ISelectionService) getWorkbench().getService(ISelectionService.class)); if (selectionService != null) { selectionService.removeSelectionListener(UiPlugin.this.contextActivatingSelectionListener); } } }); CorePlugin.listenerRegistry().removeEventListener(this.workingSetsAddingProjectCreatedListener); CorePlugin.listenerRegistry().removeEventListener(this.executionShowingBuildLaunchRequestListener); DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this.consoleShowingLaunchListener); }

Target:
private void unregisterListeners() { Display display = PlatformUI.getWorkbench().getDisplay(); if (display != null && !display.isDisposed()) { display.asyncExec(new Runnable() { @Override public void run() { ISelectionService selectionService = ((ISelectionService) getWorkbench().getService(ISelectionService.class)); if (selectionService != null) { selectionService.removeSelectionListener(UiPlugin.this.contextActivatingSelectionListener); } } }); } CorePlugin.listenerRegistry().removeEventListener(this.workingSetsAddingProjectCreatedListener); CorePlugin.listenerRegistry().removeEventListener(this.executionShowingBuildLaunchRequestListener); DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this.consoleShowingLaunchListener); }
Source:
public void testSimpleAtomicBlockwisePUTWithSmallerNegociation() throws Exception { System.out.println("Simple atomic blockwise PUT with smaller size negociation"); reqtPayload = generateRandomPayload(200); respPayload = generateRandomPayload(50); String path = "test"; Request request = createRequest(PUT, path, server); request.setPayload(reqtPayload); client.sendRequest(request); server.expectRequest(CON, PUT, path).storeBoth("A").block1(0, true, 128).payload(reqtPayload.substring(0, 128)).go(); server.sendResponse(ACK, CONTINUE).loadBoth("A").block1(0, true, 32).go(); server.expectRequest(CON, PUT, path).storeBoth("B").block1(4, true, 32).payload(reqtPayload.substring(128, 160)).go(); server.sendResponse(ACK, CONTINUE).loadBoth("B").block1(4, true, 32).go(); server.expectRequest(CON, PUT, path).storeBoth("C").block1(5, true, 32).payload(reqtPayload.substring(160, 192)).go(); server.sendResponse(ACK, CHANGED).loadBoth("C").block1(5, true, 32).go(); server.expectRequest(CON, PUT, path).storeBoth("D").block1(6, false, 32).go(); server.sendResponse(ACK, CHANGED).loadBoth("D").block1(6, false, 32).payload(respPayload).go(); Response response = request.waitForResponse(1000); assertResponseContainsExpectedPayload(response, CHANGED, respPayload); printServerLog(clientInterceptor); }

Target:
public void testSimpleAtomicBlockwisePUTWithSmallerNegociation() throws Exception { System.out.println("Simple atomic blockwise PUT with smaller size negociation"); reqtPayload = generateRandomPayload(200); respPayload = generateRandomPayload(50); String path = "test"; Request request = createRequest(PUT, path, server); request.setPayload(reqtPayload); client.sendRequest(request); server.expectRequest(CON, PUT, path).storeBoth("A").block1(0, true, 128).payload(reqtPayload.substring(0, 128)).go(); server.sendResponse(ACK, CONTINUE).loadBoth("A").block1(0, true, 32).go(); server.expectRequest(CON, PUT, path).storeBoth("B").block1(4, true, 32).payload(reqtPayload.substring(128, 160)).go(); server.sendResponse(ACK, CONTINUE).loadBoth("B").block1(4, true, 32).go(); server.expectRequest(CON, PUT, path).storeBoth("C").block1(5, true, 32).payload(reqtPayload.substring(160, 192)).go(); server.sendResponse(ACK, CHANGED).loadBoth("C").block1(5, true, 32).go(); server.expectRequest(CON, PUT, path).storeBoth("D").block1(6, false, 32) .payload(reqtPayload.substring(192, 200)).go(); server.sendResponse(ACK, CHANGED).loadBoth("D").block1(6, false, 32).payload(respPayload).go(); Response response = request.waitForResponse(1000); assertResponseContainsExpectedPayload(response, CHANGED, respPayload); printServerLog(clientInterceptor); }
Source:
public void undeploySynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("Undeployment of the API named : " + artifactName + " : Started"); } try { API api = getSynapseConfiguration().getAPI(artifactName); if (api != null) { api.setLogSetterValue(); getSynapseConfiguration().removeAPI(artifactName); if (log.isDebugEnabled()) { log.debug("Undeployment of the API named : " + artifactName + " : Completed"); } String unDeployTime = String.valueOf(System.currentTimeMillis()); log.info("API named '" + api.getName() + "' has been undeployed"); executeSynapseHandlerOnArtifactUnDeployment(api.getName(),"api", unDeployTime); } else if (log.isDebugEnabled()) { log.debug("API " + artifactName + " has already been undeployed"); } } catch (Exception e) { handleSynapseArtifactDeploymentError( "Undeployment of API named : " + artifactName + " : Failed", e); } }

Target:
public void undeploySynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("Undeployment of the API named : " + artifactName + " : Started"); } try { API api = getSynapseConfiguration().getAPI(artifactName); if (api != null) { api.setLogSetterValue(); getSynapseConfiguration().removeAPI(artifactName); if (log.isDebugEnabled()) { log.debug("Undeployment of the API named : " + artifactName + " : Completed"); } String unDeployTime = String.valueOf(System.currentTimeMillis()); executeSynapseHandlerOnArtifactUnDeployment(api.getName(), SynapseConstants.FAIL_SAFE_MODE_API, unDeployTime); log.info("API named '" + api.getName() + "' has been undeployed"); } else if (log.isDebugEnabled()) { log.debug("API " + artifactName + " has already been undeployed"); } } catch (Exception e) { handleSynapseArtifactDeploymentError( "Undeployment of API named : " + artifactName + " : Failed", e); } }
Source:
public void init(FunctionInvokeContext context) throws IOException { UDFInvocationDesc udfDesc = functionDesc.getInvocation().getUDF(); URL urls = new URL { new URL(udfDesc.getPath()) }; URLClassLoader loader = new URLClassLoader(urls); try { Class<?> udfclass = loader.loadClass(udfDesc.getName()); evalMethod = getEvaluateMethod(functionDesc.getParamTypes(), udfclass); } catch (ClassNotFoundException e) { e.printStackTrace(); } }

Target:
public void init(FunctionInvokeContext context) throws IOException { UDFInvocationDesc udfDesc = functionDesc.getInvocation().getUDF(); URL urls = new URL { new URL(udfDesc.getPath()) }; URLClassLoader loader = new URLClassLoader(urls); try { Class<?> udfclass = loader.loadClass(udfDesc.getName()); evalMethod = getEvaluateMethod(functionDesc.getParamTypes(), udfclass); } catch (ClassNotFoundException e) { throw new TajoInternalError(e); } }
Source:
private static String createWithConstructorBulk(final Arguments arg, final String requestName) { String constructor = new String(); if (bulkBaseClassArgs.contains(arg.getName())) { constructor += indent(1) + "@Override\n" + withConstructorFirstLine(arg, requestName) + indent(2) + "super.with" + capFirst(arg.getName()) + "(" + uncapFirst(arg.getName()) + ");\n"; } else if (arg.getName().equals("MaxUploadSize")) { constructor += maxUploadSizeWithConstructor(arg, requestName); } else if (arg.getType().equals("void")) { constructor += voidWithConstructor(arg, requestName); } else { constructor += withConstructor(arg, requestName); } constructor += indent(2) + "return this;\n" + indent(1) + "}\n"; return constructor; }

Target:
public static String createWithConstructorBulk(final Arguments arg, final String requestName) { final StringBuilder stringBuilder = new StringBuilder(); if (bulkBaseClassArgs.contains(arg.getName())) { stringBuilder.append(indent(1) + "@Override\n" + withConstructorFirstLine(arg, requestName) + indent(2) + "super.with" + capFirst(arg.getName()) + "(" + uncapFirst(arg.getName()) + ");\n"); } else if (arg.getName().equals("MaxUploadSize")) { stringBuilder.append(maxUploadSizeWithConstructor(arg, requestName)); } else if (arg.getType().equals("void")) { stringBuilder.append(voidWithConstructor(arg, requestName)); } else { stringBuilder.append(withConstructor(arg, requestName)); } stringBuilder.append(indent(2) + "return this;\n" + indent(1) + "}\n"); return stringBuilder.toString(); }
Source:
public Page getOutput() { if (unfinishedWork != null && !processUnfinishedWork()) { return null; } if (groupByIds == null) { return null; } verify(pageBuilder.getPositionCount() == 0); verify(inputPage != null); for (int position = 0; position < groupByIds.getPositionCount(); position++) { if (groupByIds.getGroupId(position) == nextDistinctId) { pageBuilder.declarePosition(); for (int channel = 0; channel < types.size(); channel++) { Type type = types.get(channel); type.appendTo(inputPage.getBlock(channel), position, pageBuilder.getBlockBuilder(channel)); } remainingLimit--; nextDistinctId++; if (remainingLimit == 0) { break; } } } groupByIds = null; inputPage = null; Page result = null; if (!pageBuilder.isEmpty()) { result = pageBuilder.build(); pageBuilder.reset(); } updateMemory(); return result; }

Target:
public Page getOutput() { if (unfinishedWork != null && !processUnfinishedWork()) { return null; } if (groupByIds == null) { return null; } verify(pageBuilder.getPositionCount() == 0); verify(inputPage != null); for (int position = 0; position < groupByIds.getPositionCount(); position++) { if (groupByIds.getGroupId(position) == nextDistinctId) { pageBuilder.declarePosition(); for (int channel = 0; channel < types.size(); channel++) { Type type = types.get(channel); type.appendTo(inputPage.getBlock(channel), position, pageBuilder.getBlockBuilder(channel)); } remainingLimit--; nextDistinctId++; if (remainingLimit == 0) { break; } } } groupByIds = null; inputPage = null; Page result = null; if (!pageBuilder.isEmpty()) { result = pageBuilder.build(); pageBuilder.reset(); } updateMemoryReservation(); return result; }
Source:
protected static Reference findPrimaryReference(List<Reference> references) { List<Reference> followsFrom = references.stream() .filter(ref -> ref.getReferenceType() == References.FOLLOWS_FROM) .collect(Collectors.toList()); List<Reference> childOfSpan = references.stream() .filter(ref -> ref.getReferenceType() == References.CHILD_OF && ref.getReferredTo() instanceof APMSpan) .collect(Collectors.toList()); List<Reference> childOfSpanContext = references.stream() .filter(ref -> ref.getReferenceType() == References.CHILD_OF && ref.getReferredTo() instanceof APMSpanBuilder) .collect(Collectors.toList()); if (!childOfSpanContext.isEmpty()) { if (childOfSpanContext.size() == 1) { return childOfSpanContext.get(0); } return null; } if (!childOfSpan.isEmpty()) { if (childOfSpan.size() == 1) { return childOfSpan.get(0); } } if (followsFrom.size() == 1) { return followsFrom.get(0); } return null; }

Target:
public static Reference findPrimaryReference(List<Reference> references) { List<Reference> followsFrom = references.stream() .filter(ref -> References.FOLLOWS_FROM.equals(ref.getReferenceType()) && ref.getReferredTo() instanceof APMSpan) .collect(Collectors.toList()); List<Reference> childOfSpan = references.stream() .filter(ref -> References.CHILD_OF.equals(ref.getReferenceType()) && ref.getReferredTo() instanceof APMSpan) .collect(Collectors.toList()); List<Reference> extractedTraceState = references.stream() .filter(ref -> ref.getReferredTo() instanceof APMSpanBuilder) .collect(Collectors.toList()); if (!extractedTraceState.isEmpty()) { if (extractedTraceState.size() == 1) { return extractedTraceState.get(0); } return null; } if (!childOfSpan.isEmpty()) { if (childOfSpan.size() == 1) { return childOfSpan.get(0); } return null; } if (followsFrom.size() == 1) { return followsFrom.get(0); } return null; }
Source:
private void loadResourcePids() { Optional<BulkExportJobEntity> jobOpt = myBulkExportJobDao.findByJobId(myJobUUID); if (!jobOpt.isPresent()) { ourLog.info("Job appears to be deleted"); return; } myJobEntity = jobOpt.get(); ourLog.info("Bulk export starting generation for batch export job: {}", myJobEntity); IFhirResourceDao dao = myDaoRegistry.getResourceDao(myResourceType); ourLog.info("Bulk export assembling export of type for job {}", myResourceType, myJobUUID); Class<? extends IBaseResource> nextTypeClass = myContext.getResourceDefinition(myResourceType).getImplementingClass(); ISearchBuilder sb = mySearchBuilderFactory.newSearchBuilder(dao, myResourceType, nextTypeClass); SearchParameterMap map = new SearchParameterMap(); map.setLoadSynchronous(true); if (myJobEntity.getSince() != null) { map.setLastUpdated(new DateRangeParam(myJobEntity.getSince(), null)); } IResultIterator myResultIterator = sb.createQuery(map, new SearchRuntimeDetails(null, myJobUUID), null, RequestPartitionId.allPartitions()); List<ResourcePersistentId> myReadPids = new ArrayList<>(); while (myResultIterator.hasNext()) { myReadPids.add(myResultIterator.next()); } myPidIterator = myReadPids.iterator(); }

Target:
private void loadResourcePids() { Optional<BulkExportJobEntity> jobOpt = myBulkExportJobDao.findByJobId(myJobUUID); if (!jobOpt.isPresent()) { ourLog.warn("Job appears to be deleted"); return; } myJobEntity = jobOpt.get(); ourLog.info("Bulk export starting generation for batch export job: {}", myJobEntity); IFhirResourceDao dao = myDaoRegistry.getResourceDao(myResourceType); ourLog.info("Bulk export assembling export of type for job {}", myResourceType, myJobUUID); Class<? extends IBaseResource> nextTypeClass = myContext.getResourceDefinition(myResourceType).getImplementingClass(); ISearchBuilder sb = mySearchBuilderFactory.newSearchBuilder(dao, myResourceType, nextTypeClass); SearchParameterMap map = new SearchParameterMap(); map.setLoadSynchronous(true); if (myJobEntity.getSince() != null) { map.setLastUpdated(new DateRangeParam(myJobEntity.getSince(), null)); } IResultIterator myResultIterator = sb.createQuery(map, new SearchRuntimeDetails(null, myJobUUID), null, RequestPartitionId.allPartitions()); List<ResourcePersistentId> myReadPids = new ArrayList<>(); while (myResultIterator.hasNext()) { myReadPids.add(myResultIterator.next()); } myPidIterator = myReadPids.iterator(); }
Source:
public void testRdfOutput() { DumpProcessingAction action = new RdfSerializationAction(); action.open(); action.close(); assertEquals(action.getReport(), "Finished serialization of 24 RDF triples in file null"); }

Target:
public void testRdfOutput() { String[] args = { "-a", "rdf", "-o", "output/wikidata.rdf" }; ClientConfiguration configuration = new ClientConfiguration(args); DumpProcessingAction action = configuration.actions.get(0); action.open(); action.close(); assertTrue(action .getReport() .matches( "Finished serialization of \\d+ RDF triples in file output/wikidata.rdf")); }
Source:
public void testConflictingOptionsTvsP() throws Exception { exit.expectSystemExitWithStatus(-1); exit.checkAssertionAfterwards(() -> { assertEquals("Option '-t' cannot be used with other options." + System.lineSeparator(), systemOut.getLog()); assertEquals("", systemErr.getLog()); }); Main.main("-p", getPath("mycheckstyle.properties"), "-t", getNonPackagePath("checks/metrics")); }

Target:
public void testConflictingOptionsTvsP() throws Exception { exit.expectSystemExitWithStatus(-1); exit.checkAssertionAfterwards(() -> { assertEquals("Option '-t' cannot be used with other options." + System.lineSeparator(), systemOut.getLog()); assertEquals("", systemErr.getLog()); }); Main.main("-p", getPath("InputMainMycheckstyle.properties"), "-t", getPath("")); }
Source:
public void deleteAllTimestampsOnSingleHost( TableReference tableRef, InetSocketAddress host, Map<Cell, Long> maxTimestampExclusiveByCell) { if (maxTimestampExclusiveByCell.isEmpty()) { return; } try { clientPool.runWithRetryOnHost(host, new FunctionCheckedException<CassandraClient, Void, Exception>() { @Override public Void apply(CassandraClient client) throws Exception { Map<ByteBuffer, Map<String, List<Mutation>>> mutationsByRowByTable = Maps.newHashMap(); maxTimestampExclusiveByCell.forEach((cell, maxTimestampExclusive) -> { SlicePredicate pred = SlicePredicates.rangeTombstoneForColumn( cell.getColumnName(), maxTimestampExclusive); Deletion del = new Deletion(); del.setPredicate(pred); del.setTimestamp(Long.MAX_VALUE); Mutation mutation = new Mutation(); mutation.setDeletion(del); mutationsByRowByTable .computeIfAbsent(ByteBuffer.wrap(cell.getRowName()), ignored -> new HashMap<>()) .computeIfAbsent(internalTableName(tableRef), ignored -> new ArrayList<>()) .add(mutation); }); batchMutateInternal("deleteAllTimestamps", client, tableRef, mutationsByRowByTable, deleteConsistency); return null; } @Override public String toString() { return "delete_timestamp_ranges_batch_mutate(" + host + ", " + tableRef.getQualifiedName() + ", " + maxTimestampExclusiveByCell.size() + " column timestamp ranges)"; } }); } catch (UnavailableException e) { throw new InsufficientConsistencyException("Deleting requires all Cassandra nodes to be up and available.", e); } catch (Exception e) { throw QosAwareThrowables.unwrapAndThrowRateLimitExceededOrAtlasDbDependencyException(e); } }

Target:
public void deleteAllTimestampsOnSingleHost( TableReference tableRef, InetSocketAddress host, Map<Cell, Long> maxTimestampExclusiveByCell) { if (maxTimestampExclusiveByCell.isEmpty()) { return; } try { clientPool.runWithRetryOnHost(host, new FunctionCheckedException<CassandraClient, Void, Exception>() { @Override public Void apply(CassandraClient client) throws Exception { insertRangeTombstones(client, maxTimestampExclusiveByCell, tableRef); return null; } @Override public String toString() { return "delete_timestamp_ranges_batch_mutate(" + host + ", " + tableRef.getQualifiedName() + ", " + maxTimestampExclusiveByCell.size() + " column timestamp ranges)"; } }); } catch (UnavailableException e) { throw new InsufficientConsistencyException("Deleting requires all Cassandra nodes to be up and available.", e); } catch (Exception e) { throw QosAwareThrowables.unwrapAndThrowRateLimitExceededOrAtlasDbDependencyException(e); } }
Source:
public FutureSuccess(ProducerRecord record, int offset) { this.record = record; this._metadata = new RecordMetadata(new TopicPartition(record.topic(), record.partition() == null ? 0 : record.partition()), 0, offset, -1L, -1, -1, -1); }

Target:
public FutureSuccess(ProducerRecord record, int offset) { this.record = record; this._metadata = new RecordMetadata(new TopicPartition(record.topic(), record.partition() == null ? 0 : record.partition()), 0, offset, RecordBatch.NO_TIMESTAMP, -1, -1, -1); }
Source:
public void run() { File trustStoreFile = new File(TRUST_STORE); FileInputStream localTrustStoreStream; try { long lastUpdatedTimeStamp = CertificateReLoaderUtil.getLastUpdatedTimeStamp(); long lastModified = trustStoreFile.lastModified(); if (lastUpdatedTimeStamp != lastModified) { CertificateReLoaderUtil.setLastUpdatedTimeStamp(lastModified); localTrustStoreStream = new FileInputStream(trustStoreFile); KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); trustStore.load(localTrustStoreStream, TRUST_STORE_PASSWORD); ServiceReferenceHolder.getInstance().setTrustStore(trustStore); } } catch (KeyStoreException | CertificateException | IOException | NoSuchAlgorithmException e) { log.error("Certificate Couldn't find", e); } }

Target:
public void run() { if (StringUtils.isNotEmpty(TRUST_STORE_PASSWORD)) { File trustStoreFile = new File(TRUST_STORE); FileInputStream localTrustStoreStream; try { long lastUpdatedTimeStamp = CertificateReLoaderUtil.getLastUpdatedTimeStamp(); long lastModified = trustStoreFile.lastModified(); if (lastUpdatedTimeStamp != lastModified) { CertificateReLoaderUtil.setLastUpdatedTimeStamp(lastModified); localTrustStoreStream = new FileInputStream(trustStoreFile); KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); trustStore.load(localTrustStoreStream, TRUST_STORE_PASSWORD.toCharArray()); ServiceReferenceHolder.getInstance().setTrustStore(trustStore); } } catch (KeyStoreException | CertificateException | IOException | NoSuchAlgorithmException e) { log.error("Unable to find the certificate", e); } } }
Source:
protected void doDeleteItem( final ResourceStoreRequest request ) throws UnsupportedStorageOperationException, ItemNotFoundException, StorageException { super.doDeleteItem( request ); if ( getRepositoryKind().isFacetAvailable( MavenHostedRepository.class ) ) { String parentPath = request.getRequestPath(); parentPath = parentPath.substring( 0, parentPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); final String parentMetadataPath = parentPath + "/maven-metadata.xml"; try { if ( getLocalStorage().containsItem( this, new ResourceStoreRequest( parentMetadataPath ) ) ) { recreateMavenMetadata( new ResourceStoreRequest( parentPath ) ); } } catch ( Exception e ) { getLogger().warn( "Could not determine if Maven metadata should be rebuild", e ); } } }

Target:
protected void doDeleteItem( final ResourceStoreRequest request ) throws UnsupportedStorageOperationException, ItemNotFoundException, StorageException { super.doDeleteItem( request ); if ( getRepositoryKind().isFacetAvailable( MavenHostedRepository.class ) ) { String parentPath = request.getRequestPath(); parentPath = parentPath.substring( 0, parentPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); final String parentMetadataPath = parentPath + "/maven-metadata.xml"; try { if ( getLocalStorage().containsItem( this, new ResourceStoreRequest( parentMetadataPath ) ) ) { recreateMavenMetadata( new ResourceStoreRequest( parentPath ) ); } } catch ( Exception e ) { getLogger().warn( "Could not maintain Maven metadata '{}'", parentMetadataPath, e ); } } }
Source:
public long numberOfShards() { return getOrInitializeTo(NUMBER_OF_SHARDS_INDEX, true, 1L); }

Target:
public long numberOfShards() { return getOrInitializeTo(ShardAndStrategy.conservative(SHARD_COUNT_INDEX), INITIAL_SHARDS); }
Source:
public Map<Object, T> getExpandedItems() { return Collections.unmodifiableMap(expandedItems); }

Target:
public Collection<T> getExpandedItems() { return Collections.unmodifiableCollection(expandedItems.values()); }
Source:
public boolean validate(Library library) { if (library.getSample().getSampleAdditionalInfo() == null) return true; if (library.getSample().getSampleAdditionalInfo().getSampleClass().getSampleClassId() != sampleClass.getSampleClassId()) return false; if (library.getLibraryType().getLibraryTypeId() != libraryType.getLibraryTypeId()) return false; if (library.getLibrarySelectionType().getLibrarySelectionTypeId() != librarySelectionType) return false; if (library.getLibraryStrategyType().getLibraryStrategyTypeId() != libraryStrategyType) return false; return true; }

Target:
public boolean validate(Library library) { if (library.getSample().getSampleAdditionalInfo() == null) return true; if (library.getSample().getSampleAdditionalInfo().getSampleClass().getId() != sampleClass.getId()) return false; if (library.getLibraryType().getId() != libraryType.getId()) return false; if (library.getLibrarySelectionType().getId() != librarySelectionType) return false; if (library.getLibraryStrategyType().getId() != libraryStrategyType) return false; return true; }
Source:
private String keyToString(Object kvValue) { Class<?> type = kvValue.getClass(); if (type.isArray()) { if (type.getComponentType() == boolean.class) { return Arrays.toString((boolean[]) kvValue); } else if (type.getComponentType() == byte.class) { return Arrays.toString((byte[]) kvValue); } else if (type.getComponentType() == char.class) { return Arrays.toString((char[]) kvValue); } else if (type.getComponentType() == double.class) { return Arrays.toString((double[]) kvValue); } else if (type.getComponentType() == float.class) { return Arrays.toString((float[]) kvValue); } else if (type.getComponentType() == int.class) { return Arrays.toString((int[]) kvValue); } else if (type.getComponentType() == long.class) { return Arrays.toString((long[]) kvValue); } else if (type.getComponentType() == short.class) { return Arrays.toString((short[]) kvValue); } else { return Arrays.toString((Object[]) kvValue); } } else { return String.valueOf(kvValue); } }

Target:
String keyToString(Object kvValue) { if (kvValue == null) { return "null"; } Class<?> type = kvValue.getClass(); if (type.isArray()) { if (type.getComponentType() == boolean.class) { return Arrays.toString((boolean[]) kvValue); } else if (type.getComponentType() == byte.class) { return new BinaryNode((byte[]) kvValue).asText(); } else if (type.getComponentType() == char.class) { return Arrays.toString((char[]) kvValue); } else if (type.getComponentType() == double.class) { return Arrays.toString((double[]) kvValue); } else if (type.getComponentType() == float.class) { return Arrays.toString((float[]) kvValue); } else if (type.getComponentType() == int.class) { return Arrays.toString((int[]) kvValue); } else if (type.getComponentType() == long.class) { return Arrays.toString((long[]) kvValue); } else if (type.getComponentType() == short.class) { return Arrays.toString((short[]) kvValue); } else { return Arrays.toString((Object[]) kvValue); } } else { return String.valueOf(kvValue); } }
Source:
private static <T> T readContent(final String content, final Constructor constructor) throws DockstoreYamlException { try { final Yaml yaml = new Yaml(constructor); return yaml.load(content); } catch (Exception e) { String msg = ERROR_READING_DOCKSTORE_YML; String errorMsg = e.getMessage(); if (errorMsg.startsWith("Cannot create property=")) { int startIndex = errorMsg.indexOf("=") + 1; int endIndex = errorMsg.indexOf(" for JavaBean"); msg += " Unrecognized property \"" + errorMsg.substring(startIndex, endIndex) + "\"."; } else { msg += e.getMessage(); } LOG.error(msg, e); throw new DockstoreYamlException(msg); } }

Target:
private static <T> T readContent(final String content, final Constructor constructor) throws DockstoreYamlException { try { final Yaml yaml = new Yaml(constructor); return yaml.load(content); } catch (Exception e) { final String exceptionMsg = e.getMessage(); String errorMsg = ERROR_READING_DOCKSTORE_YML; final Matcher matcher = WRONG_KEY_PATTERN.matcher(exceptionMsg); if (matcher.find()) { errorMsg += " Unrecognized property \"" + matcher.group(1) + "\""; } else { errorMsg += exceptionMsg; } LOG.error(errorMsg, e); throw new DockstoreYamlException(errorMsg); } }
Source:
private Map<String, LabelInfo> labelsFor(ChangeData cd, boolean standard, boolean detailed) throws OrmException { if (!standard && !detailed) { return null; } ChangeControl ctl = control(cd); if (ctl == null) { return null; } PatchSet ps = cd.currentPatchSet(db); if (ps == null) { return null; } if (cd.getChange().getStatus().isOpen()) { return labelsForOpenChange(cd, standard, detailed); } else { return labelsForClosedChange(cd, standard, detailed); } }

Target:
private Map<String, LabelInfo> labelsFor(ChangeData cd, boolean standard, boolean detailed) throws OrmException { if (!standard && !detailed) { return null; } ChangeControl ctl = control(cd); if (ctl == null) { return Collections.emptyMap(); } PatchSet ps = cd.currentPatchSet(db); if (ps == null) { return Collections.emptyMap(); } if (cd.getChange().getStatus().isOpen()) { return labelsForOpenChange(cd, standard, detailed); } else { return labelsForClosedChange(cd, standard, detailed); } }
Source:
private void forceFailover(JedisSentinelPool pool) throws InterruptedException { HostAndPort oldMaster = pool.getCurrentHostMaster(); Jedis beforeFailoverJedis = pool.getResource(); assertEquals("PONG", beforeFailoverJedis.ping()); waitForFailover(pool, oldMaster); Jedis afterFailoverJedis = pool.getResource(); assertEquals("PONG", afterFailoverJedis.ping()); assertNotNull(afterFailoverJedis.configGet("requirepass").get(1)); assertEquals(2, afterFailoverJedis.getDB()); beforeFailoverJedis.close(); afterFailoverJedis.close(); }

Target:
private void forceFailover(JedisSentinelPool pool) throws InterruptedException { HostAndPort oldMaster = pool.getCurrentHostMaster(); Jedis beforeFailoverJedis = pool.getResource(); assertEquals("PONG", beforeFailoverJedis.ping()); waitForFailover(pool, oldMaster); Jedis afterFailoverJedis = pool.getResource(); assertEquals("PONG", afterFailoverJedis.ping()); assertEquals(2, afterFailoverJedis.getDB()); assertEquals("twice-failover-client", afterFailoverJedis.clientGetname()); beforeFailoverJedis.close(); afterFailoverJedis.close(); }
Source:
private void findRequireBundleReferences(ArrayList<TextFileChange> changes, IProgressMonitor monitor) throws CoreException { String oldId = fDesc.getSymbolicName(); BundleDescription[] dependents = fDesc.getDependents(); SubMonitor subMonitor = SubMonitor.convert(monitor, "", dependents.length); for (int i = 0; i < dependents.length; i++) { BundleSpecification[] requires = dependents[i].getRequiredBundles(); boolean found = false; for (int j = 0; j < requires.length; j++) { if (requires[j].getName().equals(oldId)) { CreateHeaderChangeOperation op = new CreateHeaderChangeOperation(PluginRegistry.findModel(dependents[i]), Constants.REQUIRE_BUNDLE, oldId, fNewId); op.run(subMonitor.newChild(1)); TextFileChange change = op.getChange(); if (change != null) changes.add(change); found = true; break; } } if (!found) subMonitor.worked(1); } }

Target:
private void findRequireBundleReferences(ArrayList<TextFileChange> changes, IProgressMonitor monitor) throws CoreException { String oldId = fDesc.getSymbolicName(); BundleDescription[] dependents = fDesc.getDependents(); SubMonitor subMonitor = SubMonitor.convert(monitor, dependents.length); for (int i = 0; i < dependents.length; i++) { BundleSpecification[] requires = dependents[i].getRequiredBundles(); SubMonitor iterationMonitor = subMonitor.newChild(1); for (int j = 0; j < requires.length; j++) { if (requires[j].getName().equals(oldId)) { CreateHeaderChangeOperation op = new CreateHeaderChangeOperation(PluginRegistry.findModel(dependents[i]), Constants.REQUIRE_BUNDLE, oldId, fNewId); op.run(iterationMonitor); TextFileChange change = op.getChange(); if (change != null) { changes.add(change); } break; } } } }
Source:
public static Set<Integer> getOptedInHistoryTypes() { return optedInHistoryTypes; }

Target:
public static Set<Integer> getOptedInHistoryTypes() { return Collections.unmodifiableSet(optedInHistoryTypes); }
Source:
public abstract T retriableCall() throws Exception; public T call() throws Exception { int retry = 0; int logCounter = 0; while (true) { try { return retriableCall(); } catch (CancellationException e) { throw e; } catch (Exception e) { retry++; if (retry == retrys) { throw e; } logger.error(String.format("Retry #%d for: %s",retry, ExceptionUtils.getFullStackTrace(e))); if(++logCounter == 1) logger.error("Exception --> "+ExceptionUtils.getFullStackTrace(e)); Thread.sleep(waitTime); } finally { forEachExecution(); } } }

Target:
public abstract T retriableCall() throws Exception; public T call() throws Exception { int retry = 0; int logCounter = 0; while (true) { try { return retriableCall(); } catch (CancellationException e) { throw e; } catch (Exception e) { retry++; if (retry == retrys) { throw e; } logger.error(String.format("Retry #%d for: %s",retry, e.getMessage())); if(++logCounter == 1) logger.error("Exception --> "+ExceptionUtils.getFullStackTrace(e)); Thread.sleep(waitTime); } finally { forEachExecution(); } } }
Source:
protected boolean canConvert(String input) { try { URI uri = new URI(input); return uri.getScheme() != null && "file".equalsIgnoreCase(uri.getScheme()); } catch (URISyntaxException e) { return false; } }

Target:
protected boolean canConvert(String input) { try { URI uri = new URI(input); return uri.getScheme() == null || "file".equalsIgnoreCase(uri.getScheme()); } catch (URISyntaxException e) { return false; } }
Source:
public StringInputRowParser( @JsonProperty("parseSpec") ParseSpec parseSpec, @JsonProperty("encoding") String encoding ) { this.parseSpec = parseSpec; this.mapParser = new MapInputRowParser(parseSpec); this.parser = parseSpec.makeParser(); parser.startFileFromBeginning(); if (encoding != null) { this.charset = Charset.forName(encoding); } else { this.charset = DEFAULT_CHARSET; } }

Target:
public StringInputRowParser( @JsonProperty("parseSpec") ParseSpec parseSpec, @JsonProperty("encoding") String encoding ) { this.parseSpec = parseSpec; this.mapParser = new MapInputRowParser(parseSpec); this.parser = parseSpec.makeParser(); if (encoding != null) { this.charset = Charset.forName(encoding); } else { this.charset = DEFAULT_CHARSET; } }
Source:
public void setListValue(List<T> value) { selectedList.clear(); selectedList.addAll(value); ListBox listBox = asListBox(); if (listBox.getSelectedIndex() > -1) { listBox.setItemSelected(listBox.getSelectedIndex(), false); } for (T item: selectedList) { if (typedItemList.indexOf(item) > -1 && typedItemList.indexOf(item) < listBox.getItemCount()) { listBox.setItemSelected(typedItemList.indexOf(item), true); } } }

Target:
public void setListValue(List<T> value) { selectedList.clear(); selectedList.addAll(value); ListBox listBox = asListBox(); if (listBox.getSelectedIndex() > -1) { listBox.setItemSelected(listBox.getSelectedIndex(), false); } for (T item: selectedList) { int itemIndex = typedItemList.indexOf(item); if (itemIndex > -1 && itemIndex < listBox.getItemCount()) { listBox.setItemSelected(itemIndex, true); } } }
Source:
VLANs(Iterable<VLANInfo> objects, PaginationOptions paginationOptions) { super(objects, paginationOptions); }

Target:
public VLANs(Iterable<VLANInfo> objects, PaginationOptions paginationOptions) { super(objects, paginationOptions); }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("iLine", iLine) .add("lastK", lastK) .add("peningSpaces", spacesPending.toString().replace("\t", "\\t")) .add("newlinesPending", newlinesPending) .add("blankLines", blankLines) .add("super", super.toString()) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("iLine", iLine) .add("lastK", lastK) .add("spacesPending", spacesPending.toString().replace("\t", "\\t")) .add("newlinesPending", newlinesPending) .add("blankLines", blankLines) .add("super", super.toString()) .toString(); }
Source:
private void backup() { if (Build.VERSION.SDK_INT >= 19) { Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT) .addCategory(Intent.CATEGORY_OPENABLE) .setType("application/x-sqlite3") .putExtra(Intent.EXTRA_TITLE, "AntennaPodBackup.db"); startActivityForResult(intent, REQUEST_CODE_BACKUP_DOCUMENT); } else { try { File sd = Environment.getExternalStorageDirectory(); File backupDB = new File(sd, "AntennaPodBackup.db"); writeBackupTo(new FileOutputStream(backupDB)); } catch (Exception e) { e.printStackTrace(); Snackbar.make(findViewById(R.id.import_export_layout), e.getMessage(), Snackbar.LENGTH_SHORT).show(); } } }

Target:
private void backup() { if (Build.VERSION.SDK_INT >= 19) { Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT) .addCategory(Intent.CATEGORY_OPENABLE) .setType("application/x-sqlite3") .putExtra(Intent.EXTRA_TITLE, EXPORT_FILENAME); startActivityForResult(intent, REQUEST_CODE_BACKUP_DOCUMENT); } else { try { File sd = Environment.getExternalStorageDirectory(); File backupDB = new File(sd, EXPORT_FILENAME); writeBackupTo(new FileOutputStream(backupDB)); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); Snackbar.make(findViewById(R.id.import_export_layout), e.getLocalizedMessage(), Snackbar.LENGTH_SHORT).show(); } } }
Source:
public void test_Constructor_URL() throws Exception { final String mockFileURL = "<LINK_0>"; MockHTTPClient mockHttpClient = new MockHTTPClient(); byte[] responseBytes = IOUtils.toByteArray(getClass().getResourceAsStream("stations-schema.json")); MockHttpResponse mockResponse = new MockHttpResponse(responseBytes, "text/json"); mockHttpClient.expectGet(mockFileURL, mockResponse); MongoSchemaStore mss = new MongoSchemaFileStore("mockshema", new URL(mockFileURL), mockHttpClient); assertEquals(1, mss.typeNames().size()); SimpleFeatureType type = mss.retrieveSchema(new NameImpl("stations")); assertNotNull(type); mss.deleteSchema(new NameImpl("stations")); }

Target:
public void test_Constructor_URL() throws Exception { final String mockFileURL = "<LINK_0>"; MockHTTPClient mockHttpClient = new MockHTTPClient(); byte[] responseBytes = IOUtils.toByteArray(getClass().getResourceAsStream("stations-schema.json")); MockHttpResponse mockResponse = new MockHttpResponse(responseBytes, "text/json"); mockHttpClient.expectGet(mockFileURL, mockResponse); SchemaStoreDirectory directory = SchemaStoreDirectoryProvider.getLowestPriority(); File downloadedFile = MongoUtil.downloadSchemaFile( "mockshema", new URL(mockFileURL), mockHttpClient, directory); MongoSchemaStore mss = new MongoSchemaFileStore(downloadedFile.getParentFile().toURI()); assertEquals(1, mss.typeNames().size()); SimpleFeatureType type = mss.retrieveSchema(new NameImpl("stations")); assertNotNull(type); mss.deleteSchema(new NameImpl("stations")); Files.walk(new File(directory.getDirectory(), "mockshema").toPath()) .sorted(Comparator.reverseOrder()) .map(Path::toFile) .forEach(File::delete); }
Source:
public void adjust(Mechanism mechanism) { if (mechanism.matches("is_open") && mechanism.requireBoolean("Doors can only be open or closed.")) { if (door.isOpen() == mechanism.getValue().asBoolean() || BigDoorsBridge.commander.isDoorBusy(door.getDoorUID())) { return; } if (!BigDoorsBridge.bigDoors.areChunksLoadedForDoor(door)) { Debug.echoError("Door chunks are not loaded. cannot open door."); return; } BigDoorsBridge.bigDoors.toggleDoor(door.getDoorUID()); return; } if (mechanism.matches("is_locked") && mechanism.requireBoolean("Doors can only be locked or unlocked.")) { BigDoorsBridge.commander.setLock(door.getDoorUID(), mechanism.getValue().asBoolean()); return; } if (mechanism.matches("auto_close") && mechanism.requireObject(DurationTag.class)) { BigDoorsBridge.commander.updateDoorAutoClose(door.getDoorUID(), mechanism.valueAsType(DurationTag.class).getSecondsAsInt()); } if (!mechanism.fulfilled()) { mechanism.reportInvalid(); } }

Target:
public void adjust(Mechanism mechanism) { if (mechanism.matches("is_open") && mechanism.requireBoolean()) { if (door.isOpen() == mechanism.getValue().asBoolean() || BigDoorsBridge.commander.isDoorBusy(door.getDoorUID())) { return; } if (!BigDoorsBridge.bigDoors.areChunksLoadedForDoor(door)) { Debug.echoError("Door chunks are not loaded. cannot open door."); return; } BigDoorsBridge.bigDoors.toggleDoor(door.getDoorUID()); return; } if (mechanism.matches("is_locked") && mechanism.requireBoolean()) { BigDoorsBridge.commander.setLock(door.getDoorUID(), mechanism.getValue().asBoolean()); return; } if (mechanism.matches("auto_close") && mechanism.requireObject(DurationTag.class)) { BigDoorsBridge.commander.updateDoorAutoClose(door.getDoorUID(), mechanism.valueAsType(DurationTag.class).getSecondsAsInt()); } if (!mechanism.fulfilled()) { mechanism.reportInvalid(); } }
Source:
private void setTabViews() { for (int i = 0; i < NavTab.size(); i++) { NavTab navTab = NavTab.of(i); getMenu().add(1, i, i, navTab.text()).setIcon(navTab.icon()); } }

Target:
private void setTabViews() { for (int i = 0; i < NavTab.size(); i++) { NavTab navTab = NavTab.of(i); getMenu().add(Menu.NONE, Menu.NONE, i, navTab.text()).setIcon(navTab.icon()); } }
Source:
public Gateway3DSAuthorisationResponse authorise3dsResponse(Auth3dsResponseGatewayRequest request) { return new Gateway3DSAuthorisationResponse(BaseAuthoriseResponse.AuthoriseStatus.EXCEPTION, null); }

Target:
public Gateway3DSAuthorisationResponse authorise3dsResponse(Auth3dsResponseGatewayRequest request) { return Gateway3DSAuthorisationResponse.ofException(); }
Source:
private ObjectMap getVariantOptions() { VariantSource source = getVariantSource(); ObjectMap variantOptions = new ObjectMap(); variantOptions.put(VariantStorageManager.VARIANT_SOURCE, source); variantOptions.put(VariantStorageManager.OVERWRITE_STATS, outputParameters.getStatisticsOverwrite()); return variantOptions; }

Target:
private ObjectMap getVariantOptions() { ObjectMap variantOptions = new ObjectMap(); variantOptions.put(VariantStorageManager.VARIANT_SOURCE, getVariantSource()); variantOptions.put(VariantStorageManager.OVERWRITE_STATS, outputParameters.getStatisticsOverwrite()); return variantOptions; }
Source:
public void testDefaultSetup() throws Exception { setupGitAndDoHardReset(null, null, null, null, "* text=auto"); collectRepositoryState(); assertEquals("text=auto", entry1.attrs); assertEquals(CONTENT_LF, entry1.file); assertEquals(CONTENT_LF, entry1.index); assertEquals(CONTENT_LF, entry2.file); assertEquals(CONTENT_LF, entry2.index); assertEquals(CONTENT_LF, entry3.file); assertEquals(CONTENT_LF, entry3.index); }

Target:
public void testDefaultSetup() throws Exception { setupGitAndDoHardReset(null, null, null, null, "* text=auto"); collectRepositoryState(); assertEquals("text=auto", entryCRLF.attrs); checkEntryContent(entryCRLF, CONTENT_LF, CONTENT_LF); checkEntryContent(entryLF, CONTENT_LF, CONTENT_LF); checkEntryContent(entryMixed, CONTENT_LF, CONTENT_LF); }
Source:
public static GameObject getEntity(GameObjectDTO dto, EntityType type) { Point2D position = new Point2D(dto.getBody().get_point().getX(), dto.getBody().get_point().getY()); switch (type) { case WALL: GameObject wall = new Wall(dto.getId(), position, dto.getBody().get_width(), dto.getBody().get_height(), defaultImages.get(EntityType.WALL)); return wall; case ENEMY_CHARACTER: GameObject enemy = new BoDCharacter(dto.getId(), position, dto.getBody().get_width(), dto.getBody().get_height(), 0, defaultImages.get(EntityType.ENEMY_CHARACTER)); return enemy; } return null; }

Target:
public static GameObject getEntity(GameObjectDTO dto, EntityType type) { BodyDTO body = dto.getBody(); Point2D position = new Point2D(body.get_point().getX(), body.get_point().getY()); switch (type) { case WALL: GameObject wall = new Wall(dto.getId(), position, body.get_width(), body.get_height(), defaultImages.get(EntityType.WALL)); return wall; case ENEMY_CHARACTER: GameObject enemy = new BoDCharacter(dto.getId(), position, body.get_width(), body.get_height(), 0, defaultImages.get(EntityType.ENEMY_CHARACTER)); return enemy; } return null; }
Source:
private void applyExpandedStateContext(ViewContext viewContext) { if (viewContext != null) { fTimeGraphViewer.setExpandedState(viewContext.getExpandedEntries(), true); } else { Object input = fTimeGraphViewer.getInput(); if (input instanceof List) { for (Object traceEntry : (List<Object>) input) { if (traceEntry instanceof ITimeGraphEntry) { setDefaultExpandState((ITimeGraphEntry) traceEntry, 0); } } } else if (input instanceof ITimeGraphEntry) { setDefaultExpandState((ITimeGraphEntry) input, 0); } else { throw new IllegalStateException("Invalid input type"); } } }

Target:
private void applyExpandedStateContext(ViewContext viewContext) { if (viewContext != null) { fTimeGraphViewer.setExpandedState(viewContext.getExpandedEntries(), true); } else { ITimeGraphEntry[] elements = fTimeGraphContentProvider.getElements(fTimeGraphViewer.getInput()); for (ITimeGraphEntry entry : elements) { fTimeGraphViewer.setDefaultExpandState(entry, 0); } } fTimeGraphViewer.refresh(); }
Source:
public Ds3ResponseType toDs3ResponseType() { Ds3ResponseType ds3ResponseType = new Ds3ResponseType(type); return ds3ResponseType; }

Target:
public Ds3ResponseType toDs3ResponseType() { final Ds3ResponseType ds3ResponseType = new Ds3ResponseType(type); return ds3ResponseType; }
Source:
public int hashCode() { int result = blockName != null ? blockName.hashCode() : 0; result = 31 * result + (int) (contentLength ^ (contentLength >>> 32)); result = 31 * result + (committed ? 1 : 0); return result; }

Target:
public int hashCode() { return Objects.hashCode(blockName, contentLength, committed); }
Source:
public boolean waitForPath(int waitTime, String path) { long timeout = System.currentTimeMillis() + waitTime; File file = new File(path); boolean exists = file.exists(); while (!exists && System.currentTimeMillis() < timeout) { try { Thread.sleep(1000); } catch (InterruptedException e) { throw new IllegalStateException(e.getMessage(), e); } exists = file.exists(); } return exists; }

Target:
public boolean waitForPath(int waitTime, String path) { long timeout = System.currentTimeMillis() + waitTime; File file = new File(path); boolean exists = file.exists(); while (!exists && System.currentTimeMillis() < timeout) { try { Thread.sleep(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException(e.getMessage(), e); } exists = file.exists(); } return exists; }