auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void generate() throws MojoExecutionException, MojoFailureException { log.info(format("Mirroring repository for [%s]", project.toString())); try { initializeProjectBuildingRequest(); ArtifactLocator artifactLocator = buildArtifactLocator(); Set<Artifact> artifacts = artifactLocator.getArtifacts(); Set<Artifact> excludedArtifacts = artifactLocator.getExclusions(); File repositoryFolder = getRepositoryFolder(); ArtifactInstaller artifactInstaller = buildArtifactInstaller(remoteArtifactRepositories); installArtifacts(repositoryFolder, artifacts, artifactInstaller); generateExcludedDependenciesMetadata(repositoryFolder, excludedArtifacts, artifactInstaller); } catch (Exception e) { log.debug(format("There was an exception while building [%s]", project.toString()), e); try { throw e; } catch (DependencyTreeBuilderException e1) { log.debug(format("There was an exception while resolving transitive dependencies of [%s]", project.toString()), e); } } }

Target:
public void generate() throws MojoExecutionException, MojoFailureException { log.info(format("Mirroring repository for [%s]", project.toString())); try { initializeProjectBuildingRequest(); ArtifactLocator artifactLocator = buildArtifactLocator(); Set<Artifact> artifacts = artifactLocator.getArtifacts(); Set<Artifact> excludedArtifacts = artifactLocator.getExclusions(); File repositoryFolder = getRepositoryFolder(); ArtifactInstaller artifactInstaller = buildArtifactInstaller(remoteArtifactRepositories); installArtifacts(repositoryFolder, artifacts, artifactInstaller); generateExcludedDependenciesMetadata(repositoryFolder, excludedArtifacts, artifactInstaller); } catch (DependencyTreeBuilderException e) { log.debug(format("There was an exception while resolving transitive dependencies of [%s]", project.toString()), e); } catch (Exception e) { log.debug(format("There was an exception while building [%s]", project.toString()), e); } }
Source:
private InitializationManager() { WatchDogGlobals.setLogDirectory( "watchdog" + File.separator + "logs" + File.separator); WatchDogGlobals.setPreferences(Preferences.getInstance()); File baseFolder = Activator.getDefault().getStateLocation().toFile(); File toTransferDatabaseFile = new File(baseFolder, "watchdog.mapdb"); File statisticsDatabaseFile = new File(baseFolder, "watchdogStatistics.mapdb"); toTransferPersister = new PersisterBase(toTransferDatabaseFile); statisticsPersister = new PersisterBase(statisticsDatabaseFile); new ClientVersionChecker(); intervalManager = new IntervalManager(toTransferPersister, statisticsPersister); eventManager = new EventManager(toTransferPersister, statisticsPersister); eventManager.setSessionSeed(intervalManager.getSessionSeed()); watchDogEventManager = new WatchDogEventManager(intervalManager, USER_ACTIVITY_TIMEOUT); new TimeSynchronityChecker(intervalManager, watchDogEventManager); WorkbenchListener workbenchListener = new WorkbenchListener( watchDogEventManager, new TransferManager(toTransferPersister, WatchDogUtils.getWorkspaceName())); workbenchListener.attachListeners(); DebugPlugin.getDefault().getBreakpointManager() .addBreakpointListener(new BreakpointListener(eventManager)); DebugPlugin.getDefault() .addDebugEventListener(new DebugEventListener(eventManager)); }

Target:
private InitializationManager() { WatchDogGlobals.setLogDirectory( "watchdog" + File.separator + "logs" + File.separator); WatchDogGlobals.setPreferences(Preferences.getInstance()); File baseFolder = Activator.getDefault().getStateLocation().toFile(); File toTransferDatabaseFile = new File(baseFolder, "watchdog.mapdb"); File statisticsDatabaseFile = new File(baseFolder, "watchdogStatistics.mapdb"); toTransferPersister = new PersisterBase(toTransferDatabaseFile); statisticsPersister = new PersisterBase(statisticsDatabaseFile); new ClientVersionChecker(); intervalManager = new IntervalManager(toTransferPersister, statisticsPersister); debugEventManager = new DebugEventManager(toTransferPersister, statisticsPersister); debugEventManager.setSessionSeed(intervalManager.getSessionSeed()); watchDogEventManager = new WatchDogEventManager(intervalManager, USER_ACTIVITY_TIMEOUT); new TimeSynchronityChecker(intervalManager, watchDogEventManager); WorkbenchListener workbenchListener = new WorkbenchListener( watchDogEventManager, debugEventManager, new TransferManager( toTransferPersister, WatchDogUtils.getWorkspaceName())); workbenchListener.attachListeners(); }
Source:
Leader(QuorumPeer self,LeaderZooKeeperServer zk) throws IOException, X509Exception { this.self = self; try { if (self.shouldUsePortUnification()) { if (self.getQuorumListenOnAllIPs()) { ss = new UnifiedServerSocket(new QuorumX509Util(), self.getQuorumAddress().getPort()); } else { ss = new UnifiedServerSocket(new QuorumX509Util()); } } else if (self.isSslQuorum()) { if (self.getQuorumListenOnAllIPs()) { ss = new QuorumX509Util().createSSLServerSocket(self.getQuorumAddress().getPort()); } else { ss = new QuorumX509Util().createSSLServerSocket(); } } else { if (self.getQuorumListenOnAllIPs()) { ss = new ServerSocket(self.getQuorumAddress().getPort()); } else { ss = new ServerSocket(); } } ss.setReuseAddress(true); if (!self.getQuorumListenOnAllIPs()) { ss.bind(self.getQuorumAddress()); } } catch (X509Exception e) { LOG.error("failed to setup ssl server socket", e); throw e; } catch (BindException e) { if (self.getQuorumListenOnAllIPs()) { LOG.error("Couldn't bind to port " + self.getQuorumAddress().getPort(), e); } else { LOG.error("Couldn't bind to " + self.getQuorumAddress(), e); } throw e; } this.zk = zk; }

Target:
Leader(QuorumPeer self,LeaderZooKeeperServer zk) throws IOException, X509Exception { this.self = self; this.proposalStats = new BufferStats(); try { if (self.shouldUsePortUnification()) { if (self.getQuorumListenOnAllIPs()) { ss = new UnifiedServerSocket(new QuorumX509Util(), self.getQuorumAddress().getPort()); } else { ss = new UnifiedServerSocket(new QuorumX509Util()); } } else if (self.isSslQuorum()) { if (self.getQuorumListenOnAllIPs()) { ss = new QuorumX509Util().createSSLServerSocket(self.getQuorumAddress().getPort()); } else { ss = new QuorumX509Util().createSSLServerSocket(); } } else { if (self.getQuorumListenOnAllIPs()) { ss = new ServerSocket(self.getQuorumAddress().getPort()); } else { ss = new ServerSocket(); } } ss.setReuseAddress(true); if (!self.getQuorumListenOnAllIPs()) { ss.bind(self.getQuorumAddress()); } } catch (X509Exception e) { LOG.error("Failed to setup ssl server socket", e); throw e; } catch (BindException e) { if (self.getQuorumListenOnAllIPs()) { LOG.error("Couldn't bind to port " + self.getQuorumAddress().getPort(), e); } else { LOG.error("Couldn't bind to " + self.getQuorumAddress(), e); } throw e; } this.zk = zk; }
Source:
public void queryPageWithComplexStartEndKeyAndJsonObjectValue() { init(); View view = db.view("example/boolean_creator_created") .startKey(false ,"uuid",1) .endKey(false ,"uuid", 2000); Page page = null; try { page = view.queryPage(30, null, Object.class); } catch (Exception e) { e.printStackTrace(); } assertThat(page.getResultList().size(), is(1)); }

Target:
public void queryPageWithComplexStartEndKeyAndJsonObjectValue() { init(); View view = db.view("example/boolean_creator_created") .startKey(true ,"uuid",1) .endKey(true ,"uuid", 2000); Page page = view.queryPage(30, null, Object.class); assertThat(page.getResultList().size(), is(2)); Gson gson = new Gson(); ArrayList<JsonObject> expectedJsonObject = new ArrayList<JsonObject>(), actualJsonObject = new ArrayList<JsonObject>(); for(int i = 0; i < page.getResultList().size(); i++) { expectedJsonObject.add(multiValueKeyInit(null, i + 1)); JsonObject actualJsonContentObject = (gson.toJsonTree(page.getResultList().get(i))) .getAsJsonObject().get("contentArray") .getAsJsonArray().get(0).getAsJsonObject(); actualJsonObject.add(actualJsonContentObject); } assertJsonObjectKeysAndValues(expectedJsonObject, actualJsonObject); }
Source:
public boolean isCellEditable(int row, int col) { if (row == myAssignments.size()) { return true; } if (Column.UNIT.equals(Column.values()[col])) { return true; } return false; }

Target:
public boolean isCellEditable(int row, int col) { if (row == myAssignments.size()) { return Column.NAME.equals(Column.values()[col]); } else { return Column.UNIT.equals(Column.values()[col]); } }
Source:
public void startOvertime() { synchronized (runLock) { requestBatchStart(); ClockModel pc = getClockModel(Clock.ID_PERIOD); ClockModel jc = getClockModel(Clock.ID_JAM); ClockModel lc = getClockModel(Clock.ID_LINEUP); ClockModel tc = getClockModel(Clock.ID_TIMEOUT); if (pc.isRunning() || jc.isRunning()) return; if (pc.getNumber() < pc.getMaximumNumber()) return; if (!pc.isTimeAtEnd()) return; createSnapshot(ACTION_OVERTIME); setInOvertime(true); if (tc.isRunning()) { _endTimeout(); } long otLineupTime = settings.getLong("Clock." + Clock.ID_LINEUP + ".OvertimeTime"); if (lc.getMaximumTime() < otLineupTime) { lc.setMaximumTime(otLineupTime); } _startLineup(); requestBatchEnd(); } }

Target:
public void startOvertime() { synchronized (runLock) { ClockModel pc = getClockModel(Clock.ID_PERIOD); ClockModel jc = getClockModel(Clock.ID_JAM); ClockModel lc = getClockModel(Clock.ID_LINEUP); if (pc.isRunning() || jc.isRunning()) return; if (pc.getNumber() < pc.getMaximumNumber()) return; if (!pc.isTimeAtEnd()) return; createSnapshot(ACTION_OVERTIME); requestBatchStart(); setInOvertime(true); _endTimeout(); long otLineupTime = settings.getLong("Clock." + Clock.ID_LINEUP + ".OvertimeTime"); if (lc.getMaximumTime() < otLineupTime) { lc.setMaximumTime(otLineupTime); } _startLineup(); requestBatchEnd(); } }
Source:
public void shouldGenerateCoverageMeasures() throws Exception { parser.parse(getReportsWithAbsolutePath("phpunit.coverage.xml")); ArgumentCaptor<Measure> measures = ArgumentCaptor.forClass(Measure.class); verify(context, atLeastOnce()).saveMeasure(any(Resource.class), measures.capture()); for (Measure measure : measures.getAllValues()) { if (measure.getMetricKey().equals(CoreMetrics.COVERAGE_LINE_HITS_DATA_KEY)) { assertThat(measure.getData()).isEqualTo("34=1;35=1;38=1;40=0;45=1;46=1"); } else if (measure.getMetricKey().equals(CoreMetrics.UNCOVERED_LINES_KEY)) { assertThat(measure.getValue()).isEqualTo(2.); } } }

Target:
public void shouldGenerateCoverageMeasures() throws Exception { parser.parse(getReportsWithAbsolutePath("phpunit.coverage.xml")); ArgumentCaptor<Measure> measures = ArgumentCaptor.forClass(Measure.class); verify(context, atLeastOnce()).saveMeasure(any(Resource.class), measures.capture()); Measure coverageLineHitsDataMeasure = getMeasure(measures, CoreMetrics.COVERAGE_LINE_HITS_DATA_KEY); assertThat(coverageLineHitsDataMeasure).isNotNull(); assertThat(coverageLineHitsDataMeasure.getData()).isEqualTo("34=1;35=1;38=1;40=0;45=1;46=1"); verify(context, atLeastOnce()).saveMeasure(any(Resource.class), eq(CoreMetrics.UNCOVERED_LINES), eq(2.)); }
Source:
public void RequestDirections() { AsynchUtil.runAsynchronously(new Runnable() { @Override public void run() { try { performRequest(); } catch (IOException e) { form.dispatchErrorOccurredEvent(Navigation.this, "RequestDirections", ErrorMessages.ERROR_DEFAULT); } catch (JSONException je) { form.dispatchErrorOccurredEvent(Navigation.this, "RequestDirections", ErrorMessages.ERROR_DEFAULT); } } }); }

Target:
public void RequestDirections() { if (apiKey.equals("")) { form.dispatchErrorOccurredEvent(this, "Authorization", ErrorMessages.ERROR_INVALID_API_KEY); return; } final GeoPoint startLocation = this.startLocation; final GeoPoint endLocation = this.endLocation; final TransportMethod method = this.method; AsynchUtil.runAsynchronously(new Runnable() { @SuppressWarnings("TryWithIdenticalCatches") @Override public void run() { try { performRequest(startLocation, endLocation, method); } catch (IOException e) { form.dispatchErrorOccurredEvent(Navigation.this, "RequestDirections", ErrorMessages.ERROR_DEFAULT); } catch (JSONException je) { form.dispatchErrorOccurredEvent(Navigation.this, "RequestDirections", ErrorMessages.ERROR_DEFAULT); } } }); }
Source:
public void testObtainPublicNetworkSeveralExternalNetworks () throws OpenStackException { String CONTENT_NETWORKS= "{\"networks\": [{\"status\": \"ACTIVE\", \"subnets\": [\"eb602a2b-13cd-46c8-9055-99ad45180730\"],"+ "\"name\": \"net04_ext\", \"provider:physical_network\": null, \"admin_state_up\": true, \"tenant_id\": "+ "\"eab8403e83e048719ab220353c10806f\", \"provider:network_type\": \"gre\", \"router:external\": true, \"shared\": "+ "true, \"id\": \"04c9aedf-aeb6-4553-8ddb-845701da71bd\", \"provider:segmentation_id\": 3}, "+ "{\"status\": \"ACTIVE\", \"subnets\": [\"6ba86d6b-b7ad-4d0b-b552-cb63b36c9ef2\"], \"name\": \"sec_ext_net\", "+ "\"provider:physical_network\": \"physnet1\", \"admin_state_up\": true, \"tenant_id\": \"eab8403e83e048719ab220353c10806f\", "+ "\"provider:network_type\": \"flat\", \"router:external\": true, \"shared\": false, \"id\": \"063f1075-77eb-45f9-be7a-205a591840ee\"," + "\"provider:segmentation_id\": null}]}"; System.out.print(CONTENT_NETWORKS); String region = "RegionOne5"; when(openOperationUtil.getAdminUser(any(PaasManagerUser.class))).thenReturn(paasManagerUser); when(openOperationUtil.executeNovaRequest(any(HttpUriRequest.class))).thenReturn(CONTENT_NETWORKS); String net = openStackUtil.getPublicAdminNetwork(paasManagerUser, region); assertNotNull(net); assertEquals(net, "04c9aedf-aeb6-4553-8ddb-845701da71bd"); }

Target:
public void testObtainPublicNetworkSeveralExternalNetworks () throws OpenStackException { String CONTENT_NETWORKS= "{\"networks\": [{\"status\": \"ACTIVE\", " + "\"subnets\": [\"eb602a2b-13cd-46c8-9055-99ad45180730\"],"+ "\"name\": \"net04_ext\", \"provider:physical_network\": null, " + "\"admin_state_up\": true, \"tenant_id\": "+ "\"eab8403e83e048719ab220353c10806f\", \"provider:network_type\": " + "\"gre\", \"router:external\": true, \"shared\": "+ "true, \"id\": \"04c9aedf-aeb6-4553-8ddb-845701da71bd\", " + "\"provider:segmentation_id\": 3}, "+ "{\"status\": \"ACTIVE\", \"subnets\": [\"6ba86d6b-b7ad-4d0b-b552-cb63b36c9ef2\"], " + "\"name\": \"sec_ext_net\", "+ "\"provider:physical_network\": \"physnet1\", \"admin_state_up\": true, \"tenant_id\":" + "\"eab8403e83e048719ab220353c10806f\", "+ "\"provider:network_type\": \"flat\", \"router:external\": true, \"shared\": false," + " \"id\": \"063f1075-77eb-45f9-be7a-205a591840ee\"," + "\"provider:segmentation_id\": null}]}"; System.out.print(CONTENT_NETWORKS); String region = "RegionOne5"; when(openOperationUtil.getAdminUser(any(PaasManagerUser.class))).thenReturn(paasManagerUser); when(openOperationUtil.executeNovaRequest(any(HttpUriRequest.class))).thenReturn(CONTENT_NETWORKS); String net = openStackUtil.getPublicAdminNetwork(paasManagerUser, region); assertNotNull(net); assertEquals(net, "04c9aedf-aeb6-4553-8ddb-845701da71bd"); }
Source:
public URL serve(FixedLengthAudioStream stream, int seconds) { String streamId = UUID.randomUUID().toString(); multiTimeStreams.put(streamId, stream); streamTimeouts.put(streamId, System.currentTimeMillis() + (seconds * 1000L)); return getURL(streamId); }

Target:
public URL serve(FixedLengthAudioStream stream, int seconds) { String streamId = UUID.randomUUID().toString(); multiTimeStreams.put(streamId, stream); streamTimeouts.put(streamId, System.nanoTime() + (seconds * TimeUnit.SECONDS.toNanos(1))); return getURL(streamId); }
Source:
public void update( @Observes final ProjectDetailEvent event ) { this.projectInfo = event.getProjectInfo(); final POM pom = projectInfo.getProject().getPom(); if ( pom != null && pom.getDescription() != null ) { view.updateDescription( pom.getDescription() ); } Displayer displayer = projectMetricsFactory.lookupCommitsOverTimeDisplayer_small(projectInfo); displayer.draw(); view.updateContributionsMetric(displayer); }

Target:
public void update( @Observes final ProjectDetailEvent event ) { this.projectInfo = event.getProjectInfo(); final POM pom = projectInfo.getProject().getPom(); if (pom != null && pom.getDescription() != null) { view.updateDescription(pom.getDescription()); } commitsDisplayer = projectMetricsFactory.lookupCommitsOverTimeDisplayer_small(projectInfo); commitsDisplayer.draw(); view.updateContributionsMetric(commitsDisplayer); }
Source:
public void updating_the_parent_of_a_deprecated_rule_key_should_work() { execute(context -> { NewRepository repo = context.createRepository("javascript", "javascript"); repo.createRule("linelength") .setName("s103") .setHtmlDescription("Description of One") .setSeverity(BLOCKER) .setType(RuleType.CODE_SMELL) .setStatus(RuleStatus.BETA); repo.createRule("s103") .setName("s103") .setHtmlDescription("Description of One") .setSeverity(BLOCKER) .setType(RuleType.CODE_SMELL) .setStatus(RuleStatus.BETA); repo.done(); }); execute(context -> { NewRepository repo = context.createRepository("javascript", "javascript"); repo.createRule("s103") .setName("s103") .setHtmlDescription("Description of One") .setSeverity(BLOCKER) .setType(RuleType.CODE_SMELL) .setStatus(RuleStatus.BETA) .addDeprecatedRuleKey("javascript", "linelength"); repo.done(); }); execute(context -> { NewRepository repo = context.createRepository("sonarjs", "javascript"); repo.createRule("s103") .setName("s103") .setHtmlDescription("Description of One") .setSeverity(BLOCKER) .setType(RuleType.CODE_SMELL) .setStatus(RuleStatus.BETA) .addDeprecatedRuleKey("javascript", "linelength"); repo.done(); }); }

Target:
public void updating_the_parent_of_a_deprecated_rule_key_should_work() { execute(context -> createRule(context, "javascript", "javascript", "s103")); execute(context -> createRule(context, "javascript", "javascript", "s103", r -> r.addDeprecatedRuleKey("javascript", "linelength"))); execute(context -> createRule(context, "javascript", "sonarjs", "s103", r -> r.addDeprecatedRuleKey("javascript", "linelength"))); }
Source:
public HealthCheckResponse call() { HealthCheckResponseBuilder responseBuilder = HealthCheckResponse.named(name); boolean state = true; checker.doCheck(); for (HealthCheckResultEntry healthCheckResultEntry : checker.getMostRecentResult().getEntries()) { responseBuilder.withData("Message", healthCheckResultEntry.getMessage()); } String healthStatus = checker.getMostRecentCumulativeStatus().name(); if (!healthStatus.trim().isEmpty()) { responseBuilder.withData("HealthCheckStatus", healthStatus); if (healthStatus.equals("CRITICAL") || healthStatus.equals("CHECK_ERROR")) { state = false; } } return responseBuilder.state(state).build(); }

Target:
public HealthCheckResponse call() { HealthCheckResponseBuilder responseBuilder = HealthCheckResponse.named(name); boolean state = true; checker.doCheck(); List<HealthCheckResultEntry> healthCheckResults = checker.getMostRecentResult().getEntries(); if (healthCheckResults.isEmpty()) { responseBuilder.withData("Message", "No result to display"); return responseBuilder.state(state).build(); } for (HealthCheckResultEntry healthCheckResultEntry : healthCheckResults) { responseBuilder.withData("Message", healthCheckResultEntry.getMessage()); } String healthStatus = checker.getMostRecentCumulativeStatus().name(); if (!healthStatus.trim().isEmpty()) { responseBuilder.withData("HealthCheckStatus", healthStatus); if (healthStatus.equals("CRITICAL") || healthStatus.equals("CHECK_ERROR")) { state = false; } } return responseBuilder.state(state).build(); }
Source:
public void doFilter(ServletRequest sr, ServletResponse sr1, FilterChain fc) throws IOException, ServletException { HttpServletRequest httpReq = (HttpServletRequest) sr; HttpServletResponse httpRes = (HttpServletResponse) sr1; PageConfig config = PageConfig.get(httpReq); long processTime = System.currentTimeMillis(); Project p = config.getProject(); if (p != null && !config.isAllowed(p)) { if (httpReq.getRemoteUser() != null) { LOGGER.log(Level.INFO, "Access denied for user {0} for URI: {1}", new Object[]{httpReq.getRemoteUser(), httpReq.getRequestURI()}); } else { LOGGER.log(Level.INFO, "Access denied for URI: {0}", httpReq.getRequestURI()); } config.getEnv().getStatistics().addRequest(httpReq); config.getEnv().getStatistics().addRequest(httpReq, "requests_forbidden"); config.getEnv().getStatistics().addRequestTime(httpReq, "requests_forbidden", System.currentTimeMillis() - processTime); httpRes.sendError(HttpServletResponse.SC_FORBIDDEN, "Access forbidden"); return; } fc.doFilter(sr, sr1); }

Target:
public void doFilter(ServletRequest sr, ServletResponse sr1, FilterChain fc) throws IOException, ServletException { HttpServletRequest httpReq = (HttpServletRequest) sr; HttpServletResponse httpRes = (HttpServletResponse) sr1; PageConfig config = PageConfig.get(httpReq); long processTime = System.currentTimeMillis(); Project p = config.getProject(); if (p != null && !config.isAllowed(p)) { if (httpReq.getRemoteUser() != null) { LOGGER.log(Level.INFO, "Access denied for user ''{0}'' for URI: {1}", new Object[]{httpReq.getRemoteUser(), httpReq.getRequestURI()}); } else { LOGGER.log(Level.INFO, "Access denied for URI: {0}", httpReq.getRequestURI()); } config.getEnv().getStatistics().addRequest(httpReq); config.getEnv().getStatistics().addRequest(httpReq, "requests_forbidden"); config.getEnv().getStatistics().addRequestTime(httpReq, "requests_forbidden", System.currentTimeMillis() - processTime); if (!config.getEnv().getConfiguration().getForbiddenIncludeFileContent().isEmpty()) { sr.getRequestDispatcher("/eforbidden").forward(sr, sr1); return; } httpRes.sendError(HttpServletResponse.SC_FORBIDDEN, "Access forbidden"); return; } fc.doFilter(sr, sr1); }
Source:
public FilePersistenceResult create(FileName fileName, FileSize fileSize) { if (fileSize.isTotalSizeUnknown()) { return FilePersistenceResult.newInstance(Status.ERROR_UNKNOWN_TOTAL_FILE_SIZE); } long usableSpace = context.getFilesDir().getUsableSpace(); if (usableSpace < fileSize.totalSize()) { return FilePersistenceResult.newInstance(Status.ERROR_INSUFFICIENT_SPACE); } File internalFileDir = context.getFilesDir(); String absolutePath = internalFileDir.getAbsolutePath() + File.separatorChar + fileName.name(); FilePath filePath = FilePathCreator.create(absolutePath); return create(filePath); }

Target:
public FilePersistenceResult create(FileName fileName, FileSize fileSize) { if (fileSize.isTotalSizeUnknown()) { return FilePersistenceResult.newInstance(Status.ERROR_UNKNOWN_TOTAL_FILE_SIZE); } long usableSpace = context.getFilesDir().getUsableSpace(); if (usableSpace < fileSize.totalSize()) { return FilePersistenceResult.newInstance(Status.ERROR_INSUFFICIENT_SPACE); } File internalFileDir = context.getFilesDir(); String absolutePath = new File(internalFileDir, fileName.name()).getAbsolutePath(); FilePath filePath = FilePathCreator.create(absolutePath); return create(filePath); }
Source:
private Validator<String> newSourceValidator() { return new Validator<String>() { @Override public List<EditorError> validate(Editor<String> editor, String value) { List<EditorError> result = new ArrayList<>(); if (!NatTabUi.this.source.getText().trim().isEmpty() && !NatTabUi.this.source.getText().trim().matches(FieldType.NETWORK.getRegex())) { result.add(new BasicEditorError(NatTabUi.this.source, value, MSGS.firewallNatFormSourceNetwork())); } return result; } @Override public int getPriority() { return 0; } }; }

Target:
private Validator<String> newSourceValidator() { return new Validator<String>() { @Override public List<EditorError> validate(Editor<String> editor, String value) { List<EditorError> result = new ArrayList<>(); if (!NatTabUi.this.source.getText().trim().isEmpty() && !NatTabUi.this.source.getText().trim().matches(FieldType.NETWORK.getRegex())) { result.add(new BasicEditorError(NatTabUi.this.source, value, MSGS.firewallNatFormSourceNetworkErrorMessage())); } return result; } @Override public int getPriority() { return 0; } }; }
Source:
public static ArrayByteSource from(ByteSource other) { if (other instanceof BeanByteSource) { return ((BeanByteSource) other).load(); } String fileName = null; String str = other.toString(); if (str.startsWith("Files.asByteSource(")) { int pos = str.indexOf(')', 19); fileName = Paths.get(str.substring(19, pos)).getFileName().toString(); } else if (str.startsWith("Resources.asByteSource(")) { int pos = str.indexOf(')', 23); String path = str.substring(23, pos); int lastSlash = path.lastIndexOf('/'); fileName = path.substring(lastSlash + 1); } return new ArrayByteSource(Unchecked.wrap(() -> other.read()), fileName); }

Target:
public static ArrayByteSource from(ByteSource other) { if (other instanceof ArrayByteSource) { return (ArrayByteSource) other; } String fileName = null; if (other instanceof BeanByteSource) { fileName = ((BeanByteSource) other).getFileName().orElse(null); } else { String str = other.toString(); if (str.startsWith("Files.asByteSource(")) { int pos = str.indexOf(')', 19); fileName = Paths.get(str.substring(19, pos)).getFileName().toString(); } else if (str.startsWith("Resources.asByteSource(")) { int pos = str.indexOf(')', 23); String path = str.substring(23, pos); int lastSlash = path.lastIndexOf('/'); fileName = path.substring(lastSlash + 1); } } return new ArrayByteSource(Unchecked.wrap(() -> other.read()), fileName); }
Source:
public void onInterstitialActivityDestroyed() { if (mInterstitalAdCallback != null) { mInterstitalAdCallback.onAdClosed(); } }

Target:
public void onInterstitialActivityDestroyed() { if (!didRewardedAdClose.getAndSet(true) && mInterstitalAdCallback != null) { mInterstitalAdCallback.onAdClosed(); } }
Source:
protected Object handleRequestMessage(Message<?> requestMessage) { Assert.isTrue(this.initialized, "This class is not yet initialized. Invoke its afterPropertiesSet() method"); Object result = this.mongoDbExecutor.execute(requestMessage); if (result == null) { return null; } return this.getMessageBuilderFactory().withPayload(result).copyHeaders(requestMessage.getHeaders()).build(); }

Target:
protected Object handleRequestMessage(Message<?> requestMessage) { String collectionName = this.collectionNameExpression.getValue(this.evaluationContext, requestMessage, String.class); Query query = buildQuery(requestMessage); Object result; if (this.expectSingleResult) { result = this.mongoTemplate.findOne(query, this.entityClass, collectionName); } else { result = this.mongoTemplate.find(query, this.entityClass, collectionName); } return result; }
Source:
private void getChildFiles(final File base, final List<File> childFiles) { for (File child : base.listFiles()) { childFiles.add(child); if (child.isFile()) { childFiles.add(child); } else if (isEmpty(child)) { childFiles.add(child); } else { getChildFiles(child, childFiles); } } }

Target:
private void getChildFiles(final File base, final List<File> childFiles) { for (File child : base.listFiles()) { childFiles.add(child); if (child.isFile() || isEmpty(child)) { childFiles.add(child); } else { getChildFiles(child, childFiles); } } }
Source:
private void importAnalysis() { FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.OPEN); dialog.setText(Messages.ManageXMLAnalysisDialog_SelectFileImport); dialog.setFilterNames(new String[] { Messages.ManageXMLAnalysisDialog_ImportXmlFile + " (*.xml)" }); dialog.setFilterExtensions(new String[] { XML_FILTER_EXTENSION }); String path = dialog.open(); if (path != null) { File file = new File(path); IStatus status = XmlUtils.xmlValidate(file); if (status.isOK()) { status = XmlUtils.addXmlFile(file); if (status.isOK()) { fillAnalysesList(); XmlAnalysisModuleSource.notifyModuleChange(); refreshProject(); } else { Activator.logError(Messages.ManageXMLAnalysisDialog_ImportFileFailed); } } else { Activator.logError(Messages.ManageXMLAnalysisDialog_ImportFileFailed); } } }

Target:
private void importAnalysis() { FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.OPEN); dialog.setText(Messages.ManageXMLAnalysisDialog_SelectFileImport); dialog.setFilterNames(new String[] { Messages.ManageXMLAnalysisDialog_ImportXmlFile + " (*.xml)" }); dialog.setFilterExtensions(new String[] { XML_FILTER_EXTENSION }); String path = dialog.open(); if (path != null) { File file = new File(path); IStatus status = XmlUtils.xmlValidate(file); if (status.isOK()) { status = XmlUtils.addXmlFile(file); if (status.isOK()) { fillAnalysesList(); XmlAnalysisModuleSource.notifyModuleChange(); refreshProject(); } else { Activator.logError(Messages.ManageXMLAnalysisDialog_ImportFileFailed); TraceUtils.displayErrorMsg(Messages.ManageXMLAnalysisDialog_ImportFileFailed, status.getMessage()); } } else { Activator.logError(Messages.ManageXMLAnalysisDialog_ImportFileFailed); TraceUtils.displayErrorMsg(Messages.ManageXMLAnalysisDialog_ImportFileFailed, status.getMessage()); } } }
Source:
private static Collection<CommandAssociatedEntity> buildCommandAssociatedEntities(Guid cmdId, Collection<SubjectEntity> subjectEntities) { if (subjectEntities.isEmpty()) { return Collections.emptyList(); } return subjectEntities.stream().map(subjectEntity -> new CommandAssociatedEntity(cmdId, subjectEntity.getEntityType(), subjectEntity.getEntityId())) .collect(Collectors.toSet()); }

Target:
private static Collection<CommandAssociatedEntity> buildCommandAssociatedEntities(Guid cmdId, Collection<SubjectEntity> subjectEntities) { if (subjectEntities.isEmpty()) { return Collections.emptySet(); } return subjectEntities.stream().map(subjectEntity -> new CommandAssociatedEntity(cmdId, subjectEntity.getEntityType(), subjectEntity.getEntityId())) .collect(Collectors.toSet()); }
Source:
public String[] getServerIDs(int CategoryID) { ArrayList<String> serverIDs = new ArrayList<String>(); String[] columns = new String[] { "serverID" }; SQLiteDatabase db = mContext.openOrCreateDatabase("base.sqlite3", Context.MODE_PRIVATE, null); Cursor cursor = db .query("words", columns, null, null, null, null, null); while (cursor.moveToNext()) { serverIDs.add(cursor.getString(0)); } return serverIDs.toArray(new String[serverIDs.size()]); }

Target:
public String[] getServerIDs(int CategoryID) { ArrayList<String> serverIDs = new ArrayList<String>(); SQLiteDatabase db = mContext.openOrCreateDatabase("base.sqlite3", Context.MODE_PRIVATE, null); Cursor cursor = db.rawQuery("select serverID from words", null); while (cursor.moveToNext()) { serverIDs.add(cursor.getString(0)); } return serverIDs.toArray(new String[serverIDs.size()]); }
Source:
public void testReplaceLabel() throws UnsupportedOperationException, Exception { PID pid = makePid(); String oldLabel = "old_work_label"; Model workModel = ModelFactory.createDefaultModel(); workModel.add(workModel.createResource(pid.getRepositoryPath()), DcElements.title, oldLabel); WorkObject work = repositoryObjectFactory.createWorkObject(pid, null); String newLabel = "new_work_label"; MvcResult result = mvc.perform(put("/edit/label/" + pid.getUUID()) .param("label", newLabel)) .andExpect(status().is2xxSuccessful()) .andReturn(); Map<String, Object> respMap = getMapFromResponse(result); assertEquals(pid.getUUID(), respMap.get("pid")); assertEquals("editLabel", respMap.get("action")); assertEquals("new_work_label", work.getModel().getRequiredProperty(work.getResource(), DcElements.title).getLiteral().toString()); }

Target:
public void testReplaceLabel() throws UnsupportedOperationException, Exception { PID pid = makePid(); String oldLabel = "old_work_label"; Model workModel = ModelFactory.createDefaultModel(); workModel.add(workModel.createResource(pid.getRepositoryPath()), DcElements.title, oldLabel); WorkObject work = repositoryObjectFactory.createWorkObject(pid, workModel); String newLabel = "new_work_label"; MvcResult result = mvc.perform(put("/edit/label/" + pid.getUUID()) .param("label", newLabel)) .andExpect(status().is2xxSuccessful()) .andReturn(); Map<String, Object> respMap = getMapFromResponse(result); assertEquals(pid.getUUID(), respMap.get("pid")); assertEquals("editLabel", respMap.get("action")); assertEquals("new_work_label", work.getModel().getRequiredProperty(work.getResource(), DcElements.title).getLiteral().toString()); }
Source:
private Response getSearchResponse(Account account, Map<String, String> queryParams) { queryParams.put("transactionType", "charge"); String url = connectorUriGenerator.chargesURIWithParams(account, queryParams); Response connectorResponse = client .target(url) .request() .header(HttpHeaders.ACCEPT, APPLICATION_JSON) .get(); LOGGER.info("response from connector for transaction search: {}", connectorResponse); if (connectorResponse.getStatus() == SC_OK) { return processResponse(connectorResponse); } throw new SearchPaymentsException(connectorResponse); }

Target:
private Response getSearchResponse(Account account, Map<String, String> queryParams) { queryParams.put("transactionType", "charge"); String url = connectorUriGenerator.chargesURIWithParams(account, queryParams); Response connectorResponse = client .target(url) .request() .header(HttpHeaders.ACCEPT, APPLICATION_JSON) .get(); if (connectorResponse.getStatus() == SC_OK) { return processResponse(connectorResponse); } throw new SearchPaymentsException(connectorResponse); }
Source:
public ResponseEntity rebuild(@ApiParam(value = "The storageId", required = true) @PathVariable String storageId) throws IOException { if (getStorage(storageId) == null) { return ResponseEntity.status(HttpStatus.NOT_FOUND) .body("The specified storageId does not exist!"); } try { artifactIndexesService.rebuildIndexes(storageId); return ResponseEntity.ok("The Indexes was successfully rebuilt!"); } catch (ArtifactStorageException e) { logger.error(e.getMessage(), e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(e.getMessage()); } }

Target:
public ResponseEntity rebuild(@ApiParam(value = "The storageId", required = true) @PathVariable String storageId) throws IOException { if (getStorage(storageId) == null) { return ResponseEntity.status(HttpStatus.NOT_FOUND) .body("The specified storageId does not exist!"); } try { artifactIndexesService.rebuildIndexes(storageId); return ResponseEntity.ok("The indexes were successfully re-built!"); } catch (ArtifactStorageException e) { logger.error(e.getMessage(), e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(e.getMessage()); } }
Source:
public void testIndexesOnKeyAttributes() { String name = randomMapName(); Config config = smallInstanceConfig(); config.getMapConfig(name) .addMapIndexConfig(new MapIndexConfig("__key.a", false)) .addMapIndexConfig(new MapIndexConfig("__key#b", true)); HazelcastInstance instance = createHazelcastInstance(config); IMap<CompositeKey, Integer> map = instance.getMap(name); map.addIndex("__key.c", true); map.addIndex("__key#d", false); for (int i = 0; i < 10; i++) { map.put(new CompositeKey(i), i); } map.values(Predicates.equal("__key.a", 5)); map.values(Predicates.equal("__key#b", 5)); map.values(Predicates.equal("__key#c", 5)); map.values(Predicates.equal("__key.d", 5)); Map<String, LocalIndexStats> stats = map.getLocalMapStats().getIndexStats(); assertEquals(1, stats.get("__key.a").getQueryCount()); assertEquals(1, stats.get("__key.b").getQueryCount()); assertEquals(1, stats.get("__key.c").getQueryCount()); assertEquals(1, stats.get("__key.d").getQueryCount()); }

Target:
public void testIndexesOnKeyAttributes() { String name = randomMapName(); Config config = smallInstanceConfig(); config.getMapConfig(name) .addMapIndexConfig(new MapIndexConfig("__key.a", false)) .addMapIndexConfig(new MapIndexConfig("__key#b", true)); HazelcastInstance instance = createHazelcastInstance(config); IMap<CompositeKey, Integer> map = instance.getMap(name); map.addIndex("__key.c", true); map.addIndex("__key#d", false); for (int i = 0; i < 10; i++) { map.put(new CompositeKey(i), i); } Map<String, LocalIndexStats> stats = map.getLocalMapStats().getIndexStats(); assertEquals(0, stats.get("__key.a").getQueryCount()); assertEquals(0, stats.get("__key.b").getQueryCount()); assertEquals(0, stats.get("__key.c").getQueryCount()); assertEquals(0, stats.get("__key.d").getQueryCount()); map.values(Predicates.equal("__key.a", 5)); map.values(Predicates.equal("__key#b", 5)); map.values(Predicates.equal("__key#c", 5)); map.values(Predicates.equal("__key.d", 5)); stats = map.getLocalMapStats().getIndexStats(); assertEquals(1, stats.get("__key.a").getQueryCount()); assertEquals(1, stats.get("__key.b").getQueryCount()); assertEquals(1, stats.get("__key.c").getQueryCount()); assertEquals(1, stats.get("__key.d").getQueryCount()); }
Source:
private void processWebhookPayload(JSONObject payload) { if (payload.has("repository")) { JSONObject repo = payload.getJSONObject("repository"); LOGGER.info("Received commit hook notification for "+repo); String user = payload.getJSONObject("actor").getString("username"); String url = repo.getJSONObject("links").getJSONObject("html").getString("href"); String scm = repo.has("scm") ? repo.getString("scm") : "git"; probe.triggerMatchingJobs(user, url, scm); } else if (payload.has("scm")) { LOGGER.info("Received commit hook notification for hg " + payload); String user = payload.getJSONObject("owner").getString("username"); String url = payload.getJSONObject("links").getJSONObject("html").getString("href"); String scm = payload.has("scm") ? payload.getString("scm") : "hg"; probe.triggerMatchingJobs(user, url, scm); } }

Target:
private void processWebhookPayload(JSONObject payload) { if (payload.has("repository")) { JSONObject repo = payload.getJSONObject("repository"); LOGGER.log(Level.INFO, "Received commit hook notification for {0}", repo); String user = payload.getJSONObject("actor").getString("username"); String url = repo.getJSONObject("links").getJSONObject("html").getString("href"); String scm = repo.has("scm") ? repo.getString("scm") : "git"; probe.triggerMatchingJobs(user, url, scm); } else if (payload.has("scm")) { LOGGER.log(Level.INFO, "Received commit hook notification for hg: {0}", payload); String user = payload.getJSONObject("owner").getString("username"); String url = payload.getJSONObject("links").getJSONObject("html").getString("href"); String scm = payload.has("scm") ? payload.getString("scm") : "hg"; probe.triggerMatchingJobs(user, url, scm); } }
Source:
public void test_negative() { check.maximum = 3; PythonCheckVerifier.verify("src/test/resources/checks/tooManyLinesInFile-2.py", check); }

Target:
public void test_negative() { check.maximum = 3; PythonCheckVerifier.verify("src/test/resources/checks/tooManyLinesInFile-3.py", check); }
Source:
public FileStatus[] listStatus(Path f) throws AccessControlException, FileNotFoundException, IOException { checkPathIsSlash(f); FileStatus[] result = new FileStatus[theInternalDir.getChildren().size()]; int i = 0; for (Entry<String, INode<FileSystem>> iEntry : theInternalDir.getChildren().entrySet()) { INode<FileSystem> inode = iEntry.getValue(); if (inode.isLink()) { INodeLink<FileSystem> link = (INodeLink<FileSystem>) inode; Path linkedPath = new Path(link.targetDirLinkList[0].toString()); ChRootedFileSystem linkedFs = (ChRootedFileSystem) link.getTargetFileSystem(); try { FileStatus status = linkedFs.getMyFs().getFileStatus(linkedPath); result[i++] = new FileStatus(status.getLen(), false, status.getReplication(), status.getBlockSize(), status.getModificationTime(), status.getAccessTime(), status.getPermission(), status.getOwner(), status.getGroup(), link.getTargetLink(), new Path(inode.fullPath).makeQualified( myUri, null)); } catch (FileNotFoundException ex) { result[i++] = new FileStatus(0, false, 0, 0, creationTime, creationTime, PERMISSION_555, ugi.getShortUserName(), ugi.getPrimaryGroupName(), link.getTargetLink(), new Path(inode.fullPath).makeQualified( myUri, null)); } } else { result[i++] = new FileStatus(0, true, 0, 0, creationTime, creationTime, PERMISSION_555, ugi.getShortUserName(), ugi.getGroupNames()[0], new Path(inode.fullPath).makeQualified( myUri, null)); } } return result; }

Target:
public FileStatus[] listStatus(Path f) throws AccessControlException, FileNotFoundException, IOException { checkPathIsSlash(f); FileStatus[] fallbackStatuses = listStatusForFallbackLink(); FileStatus[] result = new FileStatus[theInternalDir.getChildren().size()]; int i = 0; for (Entry<String, INode<FileSystem>> iEntry : theInternalDir.getChildren().entrySet()) { INode<FileSystem> inode = iEntry.getValue(); if (inode.isLink()) { INodeLink<FileSystem> link = (INodeLink<FileSystem>) inode; try { String linkedPath = link.getTargetFileSystem().getUri().getPath(); FileStatus status = ((ChRootedFileSystem)link.getTargetFileSystem()) .getMyFs().getFileStatus(new Path(linkedPath)); result[i++] = new FileStatus(status.getLen(), false, status.getReplication(), status.getBlockSize(), status.getModificationTime(), status.getAccessTime(), status.getPermission(), status.getOwner(), status.getGroup(), link.getTargetLink(), new Path(inode.fullPath).makeQualified( myUri, null)); } catch (FileNotFoundException ex) { result[i++] = new FileStatus(0, false, 0, 0, creationTime, creationTime, PERMISSION_555, ugi.getShortUserName(), ugi.getPrimaryGroupName(), link.getTargetLink(), new Path(inode.fullPath).makeQualified( myUri, null)); } } else { result[i++] = new FileStatus(0, true, 0, 0, creationTime, creationTime, PERMISSION_555, ugi.getShortUserName(), ugi.getGroupNames()[0], new Path(inode.fullPath).makeQualified( myUri, null)); } } if (fallbackStatuses.length > 0) { return consolidateFileStatuses(fallbackStatuses, result); } else { return result; } }
Source:
public void cleanUpDeletedVariables(Project project) { synchronized (LOCK) { if (!deviceVariablesFile.exists()) { return; } try { HashMap deviceVariableMap = readMapFromJson(); if (deviceVariableMap == null) { return; } Set<UUID> keysToRemove = new HashSet<UUID>(deviceVariableMap.keySet()); List<UserVariable> globalVars = new ArrayList<>(project.getUserVariables()); for (UserVariable variable: globalVars) { keysToRemove.remove(variable.getDeviceValueKey()); } List<UUID> localVariableKeys = new ArrayList<>(); for (Scene scene: project.getSceneList()) { for (Sprite sprite: scene.getSpriteList()) { for (UserVariable variable : sprite.getUserVariables()) { localVariableKeys.add(variable.getDeviceValueKey()); } } } for (UUID key: localVariableKeys) { keysToRemove.remove(key); } for (UUID key: keysToRemove) { deviceVariableMap.remove(key); } writeMapToJson(deviceVariableMap); } catch (Exception e) { Log.e(TAG, e.getMessage()); } } }

Target:
public void cleanUpDeletedVariables(Project project) { synchronized (LOCK) { if (!deviceVariablesFile.exists()) { return; } HashMap<UUID, Object> deviceVariableMap = readMapFromJson(); if (deviceVariableMap == null) { return; } List<UUID> globalVariableKeys = getKeyList(project.getUserVariables()); List<UUID> localVariableKeys = new ArrayList<>(); for (Scene scene: project.getSceneList()) { for (Sprite sprite: scene.getSpriteList()) { localVariableKeys.addAll(getKeyList(sprite.getUserVariables())); } } Set<UUID> keysToRemove = new HashSet<>(deviceVariableMap.keySet()); keysToRemove.removeAll(globalVariableKeys); keysToRemove.removeAll(localVariableKeys); for (UUID key: keysToRemove) { deviceVariableMap.remove(key); } try { writeMapToJson(deviceVariableMap); } catch (Exception e) { Log.e(TAG, e.getMessage()); } } }
Source:
public byte[] readValue() throws IOException { try { if (length < 0) { throw new EOFException("DicomInputStream length is less than zero"); } if (length > allocateLimit) { LOG.warn("Expected value length exceeds allocate limit {}", length, allocateLimit); } byte[] value = new byte[length]; readFully(value, 0, length); return value; } catch (IOException e) { throw new IOException(String.format("IOException during read of %s #%d @ %d", TagUtils.toString(tag), length, tagPos), e); } }

Target:
public byte[] readValue() throws IOException { try { if (length < 0) { throw new EOFException("DicomInputStream length is less than zero"); } if (allocateLimit > 0 && length > allocateLimit) { LOG.warn("Expected value length exceeds allocate limit {}", length, allocateLimit); } byte[] value = new byte[length]; readFully(value, 0, length); return value; } catch (IOException e) { if ((Objects.isNull(e.getMessage()) || e.getMessage().trim().equals("")) && Objects.nonNull(e.getCause())) { throw new IOException(String.format("IOException during read of %s #%d @ %d", TagUtils.toString(tag), length, tagPos), e.getCause()); } throw e; } }
Source:
private void setBestValue(TransactionBuilder txBuilder, ArtifactReadable source, ArtifactReadable dest, IAttributeType attributeType) throws Exception { String value = dest.getSoleAttributeValue(attributeType, ""); String sourceValue = source.getSoleAttributeValue(attributeType, "Unspecified"); if (sourceValue.equals("Unspecified")) { if (value.isEmpty() && attributeType.equals(CoreAttributeTypes.DataRightsClassification)) { txBuilder.setSoleAttributeValue(dest, attributeType, "Unspecified"); } } else { if (value.isEmpty()) { txBuilder.setSoleAttributeValue(dest, attributeType, sourceValue); } else { if (!value.equals(sourceValue)) { System.out.println(dest.getName() + " conflict with " + attributeType); } } } }

Target:
private void setBestValue(TransactionBuilder txBuilder, ArtifactReadable source, ArtifactReadable dest, IAttributeType attributeType) throws Exception { String value = dest.getSoleAttributeValue(attributeType, ""); String sourceValue = source.getSoleAttributeValue(attributeType, CoreAttributeTypes.UNSPECIFIED); if (sourceValue.equals(CoreAttributeTypes.UNSPECIFIED)) { if (value.isEmpty() && attributeType.equals(CoreAttributeTypes.DataRightsClassification)) { txBuilder.setSoleAttributeValue(dest, attributeType, CoreAttributeTypes.UNSPECIFIED); } } else { if (value.isEmpty()) { txBuilder.setSoleAttributeValue(dest, attributeType, sourceValue); } else { if (!value.equals(sourceValue)) { logger.warn("%s", dest.getName() + " conflict with " + attributeType); } } } }
Source:
public Object get() { return StringAggregatorUtils.chop(foundValue, maxStringBytes); }

Target:
public Object get() { return StringUtils.chop(foundValue, maxStringBytes); }
Source:
protected String getBeanClassName(Element element) { return IntegrationNamespaceUtils.BASE_PACKAGE + ".gateway.GatewayProxyFactoryBean"; }

Target:
protected String getBeanClassName(Element element) { return GatewayProxyFactoryBean.class.getName(); }
Source:
private boolean checkConnection(SonyAudioClientSocket socket) { if (!socket.isConnected()) { logger.debug("checkConnection: try to connect to {}", socket.getURI().toString()); try { socket.open(); return socket.isConnected(); } catch (Throwable t) { logger.error("exception during connect to {}", socket.getURI().toString(), t); try { socket.close(); } catch (Exception e) { } return false; } } return true; }

Target:
private boolean checkConnection(SonyAudioClientSocket socket) { if (!socket.isConnected()) { logger.debug("checkConnection: try to connect to {}", socket.getURI().toString()); socket.open(webSocketClient); return socket.isConnected(); } return true; }
Source:
protected static Set<Address> getOwners(Cache<?, ?> cache, Object key) { Collection<Address> owners = extractComponent(cache, ClusteringDependentLogic.class).getOwners(key); if (owners == null) { owners = cache.getAdvancedCache().getRpcManager().getMembers(); } return new HashSet<>(owners); }

Target:
protected static Collection<Address> getOwners(Cache<?, ?> cache, Object key) { return new ArrayList<>(cache.getAdvancedCache().getDistributionManager().locate(key)); }