auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void apply(OnlineCommandContext ctx) throws Exception { Operations ops = new Operations(ctx.client); Address address = Address.subsystem("resource-adapters").and("resource-adapter", id); ops.add(address, Values.of("transaction-support", transactions).and("module", module)); }

Target:
public void apply(OnlineCommandContext ctx) throws Exception { Operations ops = new Operations(ctx.client); Address address = Address.subsystem("resource-adapters").and("resource-adapter", id); ops.add(address, Values.of("transaction-support", transactions).and("module", module).and("slot", "main")); }
Source:
public void replaceNodeName() throws Exception { final String replacement = "replacement"; Document document = DOMParserUtil.getDocument(XML); DOMParserUtil.replaceNodeName(document, MAIN_NODE, TEST_NODE, replacement); final Map<Node, List<Node>> retrieved = DOMParserUtil.getChildrenNodesMap(document, MAIN_NODE, replacement); assertNotNull(retrieved); assertEquals(1, retrieved.size()); List<Node> testNodes = retrieved.values().iterator().next(); assertNotNull(testNodes); assertEquals(1, testNodes.size()); }

Target:
public void replaceNodeName() throws Exception { final String replacement = "replacement"; Document document = DOMParserUtil.getDocument(XML); DOMParserUtil.replaceNodeName(document, MAIN_NODE, TEST_NODE, replacement); final Map<Node, List<Node>> retrieved = DOMParserUtil.getChildrenNodesMap(document, MAIN_NODE, replacement); assertNotNull(retrieved); assertEquals(1, retrieved.size()); List<Node> testNodes = retrieved.values().iterator().next(); assertNotNull(testNodes); assertEquals(1, testNodes.size()); assertEquals("replacement", testNodes.get(0).getNodeName()); }
Source:
public static ElasticsearchConnection getConnection() throws Exception { ElasticsearchContainerHolder.loadContainer = 1; ElasticsearchConnection elasticsearchConnection = new ElasticsearchConnection( ElasticsearchContainerHolder.getElasticsearchConfig()); elasticsearchConnection.start(); return elasticsearchConnection; }

Target:
public static synchronized ElasticsearchConnection getConnection() throws Exception { ElasticsearchContainerHolder.containerLoaded = true; ElasticsearchConnection elasticsearchConnection = new ElasticsearchConnection( ElasticsearchContainerHolder.getElasticsearchConfig()); elasticsearchConnection.start(); return elasticsearchConnection; }
Source:
public void testRollingRestartWithoutMembershipChange() throws Exception { int serverCount = 3; String config = generateNewQuorumConfig(serverCount); List<String> joiningServers = new ArrayList<>(); List<String> leavingServers = new ArrayList<>(); QuorumPeerTestBase.MainThread mt[] = new QuorumPeerTestBase.MainThread[serverCount]; for (int i = 0; i < serverCount; ++i) { mt[i] = new QuorumPeerTestBase.MainThread(i, clientPorts.get(i), config, false); mt[i].start(); joiningServers.add(serverAddress.get(i)); } for (int i = 0; i < serverCount; ++i) { Assert.assertTrue("waiting for server " + i + " being up", ClientBase.waitForServerUp("127.0.0.1:" + clientPorts.get(i), CONNECTION_TIMEOUT)); } for (int i = 0; i < serverCount; ++i) { mt[i].shutdown(); mt[i].start(); verifyQuorumConfig(i, joiningServers, leavingServers); verifyQuorumMembers(mt[i]); } for (int i = 0; i < serverCount; i++) { mt[i].shutdown(); } }

Target:
public void testRollingRestartWithoutMembershipChange() throws Exception { int serverCount = 3; String config = generateNewQuorumConfig(serverCount); List<String> joiningServers = new ArrayList<>(); QuorumPeerTestBase.MainThread mt[] = new QuorumPeerTestBase.MainThread[serverCount]; for (int i = 0; i < serverCount; ++i) { mt[i] = new QuorumPeerTestBase.MainThread(i, clientPorts.get(i), config, false); mt[i].start(); joiningServers.add(serverAddress.get(i)); } for (int i = 0; i < serverCount; ++i) { Assert.assertTrue("waiting for server " + i + " being up", ClientBase.waitForServerUp("127.0.0.1:" + clientPorts.get(i), CONNECTION_TIMEOUT)); } for (int i = 0; i < serverCount; ++i) { mt[i].shutdown(); mt[i].start(); verifyQuorumConfig(i, joiningServers, null); verifyQuorumMembers(mt[i]); } for (int i = 0; i < serverCount; i++) { mt[i].shutdown(); } }
Source:
private void initSqlTypes() { logger.debug("JDBC::initSqlTypes: Initialize the type array"); sqlTypes.put("CALLITEM", "VARCHAR(200)"); sqlTypes.put("COLORITEM", "VARCHAR(70)"); sqlTypes.put("CONTACTITEM", "VARCHAR(6)"); sqlTypes.put("DATETIMEITEM", "TIMESTAMP"); sqlTypes.put("DIMMERITEM", "TINYINT"); sqlTypes.put("LOCATIONITEM", "VARCHAR(30)"); sqlTypes.put("NUMBERITEM", "DOUBLE"); sqlTypes.put("ROLLERSHUTTERITEM", "TINYINT"); sqlTypes.put("STRINGITEM", "VARCHAR(65500)"); sqlTypes.put("SWITCHITEM", "VARCHAR(6)"); sqlTypes.put("TABLEPRIMARYKEY", "TIMESTAMP"); sqlTypes.put("TABLEPRIMARYVALUE", "NOW()"); }

Target:
private void initSqlTypes() { logger.debug("JDBC::initSqlTypes: Initialize the type array"); sqlTypes.put("CALLITEM", "VARCHAR(200)"); sqlTypes.put("COLORITEM", "VARCHAR(70)"); sqlTypes.put("CONTACTITEM", "VARCHAR(6)"); sqlTypes.put("DATETIMEITEM", "TIMESTAMP"); sqlTypes.put("DIMMERITEM", "TINYINT"); sqlTypes.put("LOCATIONITEM", "VARCHAR(30)"); sqlTypes.put("NUMBERITEM", "DOUBLE"); sqlTypes.put("ROLLERSHUTTERITEM", "TINYINT"); sqlTypes.put("STRINGITEM", "VARCHAR(65500)"); sqlTypes.put("SWITCHITEM", "VARCHAR(6)"); sqlTypes.put("tablePrimaryKey", "TIMESTAMP"); sqlTypes.put("tablePrimaryValue", "NOW()"); }
Source:
public void testGetExecutorPoolSize() { System.out.println("getExecutorPoolSize"); int expResult = 100; int result = instance.getExecutorPoolSize(); assertEquals(expResult, result); }

Target:
public void testGetExecutorPoolSize() { int expResult = 100; int result = instance.getExecutorPoolSize(); assertEquals(expResult, result); }
Source:
private void indexURLs(URL url) { try { if (!"file".equals(url.getProtocol())) { throw new RuntimeException("Classpath element is not a file: " + url); } File root = new File(url.getPath()); URL[] args = {url}; URLClassPath delegate = new URLClassPath(args); if (root.isDirectory()) { String rootPath = root.getPath(); if (!rootPath.endsWith(File.separator)) { rootPath = rootPath + File.separator; } addFilesToIndex(rootPath.length(), root, delegate); } else if (root.isFile() && root.getName().endsWith(".jar")) { JarFile jarFile = new JarFile(root); try { Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String name = entry.getName(); maybeIndexResource(name, delegate); } } finally { jarFile.close(); } } } catch (IOException e) { throw new RuntimeException(e); } }

Target:
private void indexURLs(URL url) { try { if (!"file".equals(url.getProtocol())) { throw new RuntimeException("Classpath element is not a file: " + url); } File root = new File(url.getPath()); if (root.isDirectory()) { String rootPath = root.getPath(); if (!rootPath.endsWith(File.separator)) { rootPath = rootPath + File.separator; } addFilesToIndex(rootPath.length(), root, url); } else if (root.isFile() && root.getName().endsWith(".jar")) { JarFile jarFile = new JarFile(root); try { Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String name = entry.getName(); maybeIndexResource(name, url); } } finally { jarFile.close(); } } } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public void setMergeState(MergeInfo info, MergeState state) throws KeeperException, InterruptedException { synchronized (mergeLock) { String path = getZooKeeperRoot() + Constants.ZTABLES + "/" + info.getExtent().getTableId() + "/merge"; info.setState(state); if (state.equals(MergeState.NONE)) { context.getZooReaderWriter().recursiveDelete(path, NodeMissingPolicy.SKIP); } else { DataOutputBuffer out = new DataOutputBuffer(); try { info.write(out); } catch (IOException ex) { throw new UncheckedIOException("Unlikely", ex); } context.getZooReaderWriter().putPersistentData(path, out.getData(), state.equals(MergeState.STARTED) ? ZooUtil.NodeExistsPolicy.FAIL : ZooUtil.NodeExistsPolicy.OVERWRITE); } mergeLock.notifyAll(); } nextEvent.event("Merge state of %s set to %s", info.getExtent(), state); }

Target:
public void setMergeState(MergeInfo info, MergeState state) throws KeeperException, InterruptedException { synchronized (mergeLock) { String path = getZooKeeperRoot() + Constants.ZTABLES + "/" + info.getExtent().getTableId() + "/merge"; info.setState(state); if (state.equals(MergeState.NONE)) { context.getZooReaderWriter().recursiveDelete(path, NodeMissingPolicy.SKIP); } else { DataOutputBuffer out = new DataOutputBuffer(); try { info.write(out); } catch (IOException ex) { throw new AssertionError("Unlikely", ex); } context.getZooReaderWriter().putPersistentData(path, out.getData(), state.equals(MergeState.STARTED) ? ZooUtil.NodeExistsPolicy.FAIL : ZooUtil.NodeExistsPolicy.OVERWRITE); } mergeLock.notifyAll(); } nextEvent.event("Merge state of %s set to %s", info.getExtent(), state); }
Source:
public synchronized void pingServerIfNecessary() { final int DELTA = 1000; final int TRIES = 3; final XMPPConnection connection = connection(); if (connection == null) { return; } if (pingInterval <= 0) { return; } if (connection.isAuthenticated()) { boolean res = false; for (int i = 0; i < TRIES; i++) { { long lastStanzaReceived = connection.getLastStanzaReceived(); if (lastStanzaReceived > 0) { long now = System.currentTimeMillis(); int deltaInSeconds = (int) ((now - lastStanzaReceived) / 1000); if (deltaInSeconds < pingInterval) { maybeSchedulePingServerTask(deltaInSeconds); return; } } } if (i != 0) { try { Thread.sleep(DELTA); } catch (InterruptedException e) { return; } } try { res = pingMyServer(false); } catch (InterruptedException | SmackException e) { LOGGER.log(Level.WARNING, "Exception while pinging server of " + connection, e); res = false; } if (res) { break; } } if (!res) { for (PingFailedListener l : pingFailedListeners) { l.pingFailed(); } } else { maybeSchedulePingServerTask(); } } else { LOGGER.warning("XMPPConnection was not authenticated"); } }

Target:
public void pingServerIfNecessary() { final XMPPConnection connection = connection(); if (connection == null) { return; } if (pingInterval <= 0) { return; } long lastStanzaReceived = connection.getLastStanzaReceived(); if (lastStanzaReceived > 0) { long now = System.currentTimeMillis(); int deltaInSeconds = (int) ((now - lastStanzaReceived) / 1000); if (deltaInSeconds < pingInterval) { maybeSchedulePingServerTask(deltaInSeconds); return; } } if (!connection.isAuthenticated()) { LOGGER.warning(connection + " was not authenticated"); return; } final long minimumTimeout = TimeUnit.MINUTES.toMillis(2); final long connectionReplyTimeout = connection.getReplyTimeout(); final long timeout = connectionReplyTimeout > minimumTimeout ? connectionReplyTimeout : minimumTimeout; SmackFuture<Boolean, Exception> pingFuture = pingAsync(connection.getXMPPServiceDomain(), timeout); pingFuture.onSuccess(new SuccessCallback<Boolean>() { @Override public void onSuccess(Boolean result) { maybeSchedulePingServerTask(); } }); pingFuture.onError(new ExceptionCallback<Exception>() { @Override public void processException(Exception exception) { long lastStanzaReceived = connection.getLastStanzaReceived(); if (lastStanzaReceived > 0) { long now = System.currentTimeMillis(); int deltaInSeconds = (int) ((now - lastStanzaReceived) / 1000); if (deltaInSeconds < pingInterval) { maybeSchedulePingServerTask(deltaInSeconds); return; } } for (PingFailedListener l : pingFailedListeners) { l.pingFailed(); } } }); }
Source:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 2) { throw new IllegalArgumentException("function '" + name() + "' needs 2 argument"); } Expr expr1 = args.get(0); Expr expr2 = args.get(1); return eval(expr1.eval(bindings), expr2.eval(bindings)); }

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 2) { throw new IAE("function '%s' needs 2 arguments", name()); } Expr expr1 = args.get(0); Expr expr2 = args.get(1); return eval(expr1.eval(bindings), expr2.eval(bindings)); }
Source:
public void doSave(IProgressMonitor monitor) { commitPages(true); genericEditor.doSave(monitor); try { fInputHandler.saveTargetDefinition(); } catch (CoreException e) { PDEPlugin.log(e); showError(PDEUIMessages.TargetEditor_3, e); } }

Target:
public void doSave(IProgressMonitor monitor) { fInputHandler.setSaving(true); if (getActivePage() != getPageCount() - 1) { updateTargetDocumentEditor(); } fEditor.doSave(monitor); fDirty = false; editorDirtyStateChanged(); fInputHandler.setSaving(false); }
Source:
public void checkCategories(Set<ProductItemCategory> categories) { for (ProductItemCategory category : categories) { assert category.getId() > 0 : category; assert category.getName() != null : category; assert category.getCategoryCode() != null : category; } }

Target:
public void checkCategories(Set<ProductItemCategory> categories) { for (ProductItemCategory category : categories) { assertTrue(category.getId() > 0, "category id must be more than 0"); assertNotNull(category.getName(), "category name must be not null"); assertNotNull(category.getCategoryCode(), "category code must be not null"); } }
Source:
public void waitUntilAllTasksFinish() { drainExecutor.shutdown(); try { if (!drainExecutor.awaitTermination(TERMINATION_WAIT_TIME.getSeconds(), TimeUnit.SECONDS)) { drainExecutor.shutdownNow(); } } catch (InterruptedException ex) { drainExecutor.shutdownNow(); log.error("Encounter interruption exception when is await termination", drainExecutor, ex); throw new UnrecoverableCorfuInterruptedError(ex); } }

Target:
public void waitUntilAllTasksFinish() { while (getGarbageReceivingQueue().size() > 0) { gcUnsafe(); } drainExecutor.shutdown(); try { drainExecutor.awaitTermination(TERMINATION_WAIT_TIME.getSeconds(), TimeUnit.SECONDS); } catch (InterruptedException ex) { log.error("Encounter interruption exception when is await termination", drainExecutor, ex); throw new UnrecoverableCorfuInterruptedError(ex); } finally { drainExecutor.shutdownNow(); } }
Source:
private static void addModuleTasks(@NotNull DataNode<ModuleData> moduleInfo, @NotNull IdeaModule module, @NotNull DataNode<ProjectData> projectInfo) { String rootProjectPath = projectInfo.getData().getLinkedExternalProjectPath(); String moduleConfigPath = GradleUtil.getConfigPath(module.getGradleProject(), rootProjectPath); DataNode<?> target = moduleConfigPath.equals(rootProjectPath) ? projectInfo : moduleInfo; for (GradleTask task : module.getGradleProject().getTasks()) { String taskName = task.getName(); if (taskName == null || taskName.trim().isEmpty() || taskName.toLowerCase().contains("idea")) { continue; } TaskData taskData = new TaskData(GradleConstants.SYSTEM_ID, taskName, moduleConfigPath, task.getDescription()); target.createChild(ProjectKeys.TASK, taskData); } }

Target:
private static void addModuleTasks(@NotNull DataNode<ModuleData> moduleInfo, @NotNull IdeaModule module, @NotNull DataNode<ProjectData> projectInfo) { String rootProjectPath = projectInfo.getData().getLinkedExternalProjectPath(); String moduleConfigPath = GradleUtil.getConfigPath(module.getGradleProject(), rootProjectPath); DataNode<?> target = moduleConfigPath.equals(rootProjectPath) ? projectInfo : moduleInfo; for (GradleTask task : module.getGradleProject().getTasks()) { String taskName = task.getName(); if (taskName == null || taskName.trim().isEmpty() || taskName.startsWith("idea") || taskName.endsWith("Idea")) { continue; } TaskData taskData = new TaskData(GradleConstants.SYSTEM_ID, taskName, moduleConfigPath, task.getDescription()); target.createChild(ProjectKeys.TASK, taskData); } }
Source:
public synchronized void setContainerAccess(String container, ContainerAccess access) { Path path = new File(buildPathStartingFromBaseDir(container)).toPath(); if ( System.getProperty("os.name", "").toLowerCase().contains("windows") ) { UserPrincipal everyone = null; UserPrincipal me = null; try { everyone = getDefault().getUserPrincipalLookupService() .lookupPrincipalByName("Everyone"); } catch (IOException e) { e.printStackTrace(); return; } AclFileAttributeView aclFileAttributes = java.nio.file.Files.getFileAttributeView( path, AclFileAttributeView.class); try { if (access == ContainerAccess.PRIVATE) { CopyOnWriteArrayList<AclEntry> aclList = new CopyOnWriteArrayList(aclFileAttributes.getAcl()); for (AclEntry aclEntry : aclList) { if (aclEntry.principal().equals(everyone) && aclEntry.type().equals(AclEntryType.ALLOW)) { aclList.remove(aclEntry); } } aclFileAttributes.setAcl(aclList); } else { List<AclEntry> list = aclFileAttributes.getAcl(); list.add(AclEntry.newBuilder().setPrincipal(everyone).setPermissions( AclEntryPermission.READ_DATA, AclEntryPermission.READ_ACL, AclEntryPermission.READ_ATTRIBUTES, AclEntryPermission.READ_NAMED_ATTRS) .setType(AclEntryType.ALLOW) .build()); aclFileAttributes.setAcl(list); } } catch (IOException e) { e.printStackTrace(); return; } } else { Set<PosixFilePermission> permissions; try { permissions = getPosixFilePermissions(path); if (access == ContainerAccess.PRIVATE) { permissions.remove(PosixFilePermission.OTHERS_READ); } else if (access == ContainerAccess.PUBLIC_READ) { permissions.add(PosixFilePermission.OTHERS_READ); } setPosixFilePermissions(path, permissions); } catch (IOException ioe) { throw Throwables.propagate(ioe); } } }

Target:
public void setContainerAccess(String container, ContainerAccess access) { Path path = new File(buildPathStartingFromBaseDir(container)).toPath(); if ( isWindows() ) { try { if (access == ContainerAccess.PRIVATE) { setPrivate(path); } else { setPublic(path); } } catch (IOException e) { throw new RuntimeException(e); } } else { Set<PosixFilePermission> permissions; try { permissions = getPosixFilePermissions(path); if (access == ContainerAccess.PRIVATE) { permissions.remove(PosixFilePermission.OTHERS_READ); } else if (access == ContainerAccess.PUBLIC_READ) { permissions.add(PosixFilePermission.OTHERS_READ); } setPosixFilePermissions(path, permissions); } catch (IOException ioe) { throw Throwables.propagate(ioe); } } }
Source:
public List<HarmonizationDataset> findAllDatasetsByHarmonizationStudy(@NotNull String studyId) { Assert.isTrue(!Strings.isNullOrEmpty("Harmonization Study ID cannot be null or empty")); return harmonizationDatasetRepository.findByHarmonizationTableStudyId(studyId); }

Target:
public List<HarmonizationDataset> findAllDatasetsByHarmonizationStudy(@NotNull String studyId) { Assert.isTrue(!Strings.isNullOrEmpty(studyId), "Harmonization Study ID cannot be null or empty"); return harmonizationDatasetRepository.findByHarmonizationTableStudyId(studyId); }
Source:
protected void beforeExecute(Thread t, Runnable r) { try { executingListener.beforeExecute(r); } finally { } super.beforeExecute(t, r); inProgress.put(r, Boolean.TRUE); startTime.set(new Long(System.currentTimeMillis())); }

Target:
protected void beforeExecute(Thread t, Runnable r) { try { executingListener.beforeExecute(r); } catch (Throwable e) { logger.warn("Listener threw exception", e); } super.beforeExecute(t, r); inProgress.put(r, Boolean.TRUE); startTime.set(new Long(System.currentTimeMillis())); }
Source:
public CRBuildTask buildTaskToCRBuildTask(BuildTask buildTask) { CRBuildTask crBuildTask; if (buildTask instanceof RakeTask) { RakeTask rake = (RakeTask) buildTask; crBuildTask = CRBuildTask.rake(); } else if (buildTask instanceof AntTask) { crBuildTask = CRBuildTask.ant(); } else if (buildTask instanceof NantTask) { crBuildTask = CRBuildTask.nant(((NantTask) buildTask).getNantPath()); } else { throw new RuntimeException( String.format("unknown type of build task '%s'", buildTask)); } crBuildTask.setBuild_file(buildTask.getBuildFile()); crBuildTask.setTarget(buildTask.getTarget()); crBuildTask.setWorking_directory(buildTask.workingDirectory()); commonCRTaskMembers(crBuildTask, buildTask); return crBuildTask; }

Target:
private CRBuildTask buildTaskToCRBuildTask(BuildTask buildTask) { CRBuildTask crBuildTask; if (buildTask instanceof RakeTask) { crBuildTask = CRBuildTask.rake(); } else if (buildTask instanceof AntTask) { crBuildTask = CRBuildTask.ant(); } else if (buildTask instanceof NantTask) { crBuildTask = CRBuildTask.nant(((NantTask) buildTask).getNantPath()); } else { throw new RuntimeException( String.format("unknown type of build task '%s'", buildTask)); } crBuildTask.setBuild_file(buildTask.getBuildFile()); crBuildTask.setTarget(buildTask.getTarget()); crBuildTask.setWorking_directory(buildTask.workingDirectory()); commonCRTaskMembers(crBuildTask, buildTask); return crBuildTask; }
Source:
private Version readProductVersionRecord(DataInput dis, File f) throws IOException { short ver = VersioningIO.readOrdinal(dis); final Version recoveredGFVersion = Versioning.getKnownVersion( Versioning.getVersionOrdinal(ver), null); if (recoveredGFVersion == null) { throw new DiskAccessException( String.format("Unknown version ordinal %s found when recovering Oplogs", ver), getParent()); } if (logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY_VERBOSE)) { logger.trace(LogMarker.PERSIST_RECOVERY_VERBOSE, "version={}", recoveredGFVersion); } readEndOfRecord(dis); return recoveredGFVersion; }

Target:
private Version readProductVersionRecord(DataInput dis, File f) throws IOException { short ver = VersioningIO.readOrdinal(dis); final Version recoveredGFVersion = Versioning.getKnownVersionOrDefault( Versioning.getVersionOrdinal(ver), null); if (recoveredGFVersion == null) { throw new DiskAccessException( String.format("Unknown version ordinal %s found when recovering Oplogs", ver), getParent()); } if (logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY_VERBOSE)) { logger.trace(LogMarker.PERSIST_RECOVERY_VERBOSE, "version={}", recoveredGFVersion); } readEndOfRecord(dis); return recoveredGFVersion; }
Source:
public CrateHttpService(CrateState crateState, ApiConfiguration config) { ResourceConfig httpConf = new ResourceConfig() .register(new CrateRestResource(crateState)) .packages("io.crate.frameworks.mesos.api"); int http_port = config.apiPort(); URI http_uri = URI.create(String.format("<LINK_0>", http_port)); server = GrizzlyHttpServerFactory.createHttpServer(http_uri, httpConf); }

Target:
public CrateHttpService(CrateState crateState, ApiConfiguration config) { ResourceConfig httpConf = new ResourceConfig() .register(new CrateRestResource(crateState)) .packages("io.crate.frameworks.mesos.api"); int http_port = config.apiPort(); URI httpUri = URI.create(String.format("<LINK_0>", http_port)); server = GrizzlyHttpServerFactory.createHttpServer(httpUri, httpConf); }
Source:
public void getPropertiesUpdatePlace(final TrendsPlace place){ CommonDataService.Async.getInstance().getWebClientProperties(new AsyncCallback<WebClientProperties>() { @Override public void onFailure(Throwable caught) { new ExceptionPanel("Default properties will be used. Exception while properties retrieving: " + caught.getMessage()); updatePlace(place); } @Override public void onSuccess(WebClientProperties result) { webClientProperties = result; updateTagFilter(); updatePlace(place); } }); }

Target:
public void getPropertiesUpdatePlace(final TrendsPlace place){ CommonDataService.Async.getInstance().getWebClientProperties(new AsyncCallback<WebClientProperties>() { @Override public void onFailure(Throwable caught) { new ExceptionPanel("Default properties will be used. Exception while properties retrieving: " + caught.getMessage()); updatePlace(place); } @Override public void onSuccess(WebClientProperties result) { webClientProperties = result; updatePlace(place); } }); }
Source:
private void createReviewedPanel(){ reviewedPanel = new FlowPanel(); reviewedCheckBox = new CheckBox(PatchUtil.C.reviewed() + " & "); reviewedCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { setReviewedByCurrentUser(event.getValue()); } }); reviewedPanel.add(reviewedCheckBox); reviewedPanel.add(getReviewedAnchor()); }

Target:
private void createReviewedPanel(){ reviewedPanel = new FlowPanel(); reviewedCheckBox = new CheckBox(PatchUtil.C.reviewedAnd() + " "); reviewedCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { setReviewedByCurrentUser(event.getValue()); } }); reviewedPanel.add(reviewedCheckBox); reviewedPanel.add(getReviewedAnchor()); }
Source:
public void shouldCreateMappingWithMappingAnnotationAtFieldLevel() { Map mapping = elasticsearchTemplate.getMapping(FieldDynamicMappingEntity.class); Map properties = (Map) mapping.get("properties"); assertThat(mapping, is(notNullValue())); assertThat(properties, is(notNullValue())); assertThat(properties.containsKey("file"), is(true)); Map file = (Map) properties.get("file"); assertThat(file, is(notNullValue())); assertThat(((String) file.get("type")), is("string")); assertThat(file.containsKey("fields"), is(true)); Map fields = (Map) file.get("fields"); assertThat(fields, is(notNullValue())); assertThat(fields.containsKey("content"), is(true)); Map content = (Map) fields.get("content"); assertThat(content, is(notNullValue())); assertThat((String)content.get("type"), is("string")); assertThat((String)content.get("term_vector"), is("with_positions_offsets")); assertThat((Boolean)content.get("store"), is(Boolean.TRUE)); }

Target:
public void shouldCreateMappingWithMappingAnnotationAtFieldLevel() { Map mapping = elasticsearchTemplate.getMapping(FieldDynamicMappingEntity.class); assertThat(mapping, is(notNullValue())); Map properties = (Map) mapping.get("properties"); assertThat(properties, is(notNullValue())); assertThat(properties.containsKey("file"), is(true)); Map file = (Map) properties.get("file"); assertThat(file, is(notNullValue())); assertThat(((String) file.get("type")), is("string")); assertThat(file.containsKey("fields"), is(true)); Map fields = (Map) file.get("fields"); assertThat(fields, is(notNullValue())); assertThat(fields.containsKey("content"), is(true)); Map content = (Map) fields.get("content"); assertThat(content, is(notNullValue())); assertThat((String)content.get("type"), is("string")); assertThat((String)content.get("term_vector"), is("with_positions_offsets")); assertThat((Boolean)content.get("store"), is(Boolean.TRUE)); }
Source:
public void typeBorderSize(int border) { tablePropertiesInputs.get(2).clear(); tablePropertiesInputs.get(2).sendKeys(Integer.toString(border)); PageObjectLogging.log("typeBorderSize", "border size was typed", true, driver); }

Target:
public void typeBorderSize(int border) { tablePropertiesInputs.get(2).clear(); tablePropertiesInputs.get(2).sendKeys(Integer.toString(border)); PageObjectLogging.log("typeBorderSize", "border size was typed: " + border, true); }
Source:
private void run() { VM entity = (VM) getItem().getEntity(); boolean reinitialize = !entity.isInitialized() && AsyncDataProvider.isWindowsOsType(entity.getVmOsId()); RunVmParams tempVar = new RunVmParams(entity.getId()); tempVar.setInitializationType(InitializationType.Sysprep); Frontend.RunAction(VdcActionType.RunVm, tempVar); }

Target:
private void run() { VM entity = (VM) getItem().getEntity(); RunVmParams tempVar = new RunVmParams(entity.getId()); if (!entity.isInitialized() && AsyncDataProvider.isWindowsOsType(entity.getVmOsId())) { tempVar.setInitializationType(InitializationType.Sysprep); } else if (!entity.isInitialized() && AsyncDataProvider.isLinuxOsType(entity.getVmOsId())) { tempVar.setInitializationType(InitializationType.CloudInit); } else { tempVar.setInitializationType(InitializationType.None); } Frontend.RunAction(VdcActionType.RunVm, tempVar); }
Source:
public void testCreateAccountMissingLocationURL() throws Exception { server = setupTestCreateAccount(true); AcmeAccount account = populateBasicAccount(ACCOUNT_1_V2); assertNull(account.getAccountUrl()); try { acmeClient.createAccount(account, false); fail("Expected AcmeException not thrown"); } catch(AcmeException e) { assertTrue(e.getMessage().contains("account location URL")); } }

Target:
public void testCreateAccountMissingLocationURL() throws Exception { server = setupTestCreateAccount(true); AcmeAccount account = populateBasicAccount(ACCOUNT_1_V2); assertNull(account.getAccountUrl()); try { acmeClient.createAccount(account, false); fail("Expected AcmeException not thrown"); } catch(AcmeException e) { assertTrue(e.getMessage().contains(ACCOUNT)); } }
Source:
void onLastOpComplete( Consumer<Integer> cb, Consumer<Consumer<Integer>> newOnLastOp) { assert (onLastOp == null); onLastOp = newOnLastOp; checkOpComplete(cb); }

Target:
void onLastOpComplete( Consumer<Integer> cb, Consumer<Consumer<Integer>> newOnLastOp) { checkState(onLastOp == null); onLastOp = newOnLastOp; checkOpComplete(cb); }
Source:
private Map<String, T> parseOvfs(String stdout) { if (stdout.startsWith("{")) { stdout = stdout.substring(1, stdout.length()-1); return Arrays.stream(stdout.split("::")) .map(str -> { return splitToFileNameAndOvf(str); }) .map(arr -> new Object[] { parseOvf(arr[1]), arr[0]}) .filter(arr -> arr[0] != null) .collect(Collectors.toMap(arr -> (String) arr[1], arr -> (T) arr[0])); } else { String[] splitted = splitToFileNameAndOvf(stdout); T vm = parseOvf(splitted[1]); return new HashMap<>(Collections.singletonMap(splitted[0], vm)); } }

Target:
private Map<String, T> parseOvfs(String stdout) { if (stdout.startsWith("{")) { stdout = stdout.substring(1, stdout.length()-1); return Arrays.stream(stdout.split("::")) .map(this::splitToFileNameAndOvf) .map(arr -> new Object[] { parseOvf(arr[1]), arr[0] }) .filter(arr -> arr[0] != null) .collect(Collectors.toMap(arr -> (String) arr[1], arr -> (T) arr[0])); } else { String[] splitted = splitToFileNameAndOvf(stdout); T vm = parseOvf(splitted[1]); return new HashMap<>(Collections.singletonMap(splitted[0], vm)); } }
Source:
public List<String> getParentIds() { List<DocumentModel> parents = getCoreSession().getParentDocuments(doc.getRef()); Collections.reverse(parents); List<String> res = new ArrayList<>(); for (DocumentModel doc : parents) { BundleGroup bgroup = doc.getAdapter(BundleGroup.class); if (bgroup != null) { res.add(bgroup.getId()); } } return res; }

Target:
public List<String> getParentIds() { List<DocumentModel> parents = getCoreSession().getParentDocuments(doc.getRef()); return parents.stream() .sorted(Collections.reverseOrder()) .map(doc -> doc.getAdapter(BundleGroup.class)) .filter(Objects::nonNull) .map(BundleGroup::getId) .collect(Collectors.toList()); }
Source:
public String getConfigurationValue(String servicePid, String propertyName) { String methodName = "getConfigurationValue"; logger.debug( "ENTERING: " + methodName + " servicePid = " + servicePid + ", propertyName = " + propertyName); String value = ""; try { if (this.configurationAdmin != null) { Configuration currentConfiguration = this.configurationAdmin .getConfiguration(servicePid); if (currentConfiguration != null) { Dictionary<String, Object> properties = currentConfiguration.getProperties(); if (properties != null && properties.get(propertyName) != null) { value = (String) properties.get(propertyName); } else { logger.debug("properties for servicePid = " + servicePid + " were NULL or empty"); } } else { logger.debug("configuration for servicePid = " + servicePid + " was NULL"); } } else { logger.debug("configurationAdmin is NULL"); } } catch (IOException e) { logger.warn("Exception while getting configuration value.", e); } logger.debug("EXITING: " + methodName + " value = [" + value + "]"); return value; }

Target:
public String getConfigurationValue(String servicePid, String propertyName) { String methodName = "getConfigurationValue"; LOGGER.debug("ENTERING: {}, servicePid = {}, propertyName = {}", methodName, servicePid, propertyName); String value = ""; try { if (this.configurationAdmin != null) { Configuration currentConfiguration = this.configurationAdmin .getConfiguration(servicePid); if (currentConfiguration != null) { Dictionary<String, Object> properties = currentConfiguration.getProperties(); if (properties != null && properties.get(propertyName) != null) { value = (String) properties.get(propertyName); } else { LOGGER.debug("properties for servicePid = were NULL or empty", servicePid); } } else { LOGGER.debug("configuration for servicePid = was NULL", servicePid); } } else { LOGGER.debug("configurationAdmin is NULL"); } } catch (IOException e) { LOGGER.warn("Exception while getting configuration value.", e); } LOGGER.debug("EXITING: value = [{}]", methodName, value); return value; }
Source:
public void applyPaddingStrategy(TimelineMetric metric, TemporalInfo temporalInfo) { if (strategy.equals(PADDING_STRATEGY.NONE) || temporalInfo == null) { return; } TreeMap<Long, Double> values = metric.getMetricValues(); if (values==null || values.isEmpty()) { return; } long intervalStartTime = longToMillis(temporalInfo.getStartTime()); long intervalEndTime = longToMillis(temporalInfo.getEndTime()); long dataStartTime = longToMillis(values.firstKey()); long dataEndTime = longToMillis(values.lastKey()); if (intervalEndTime < 0) { intervalEndTime = values.lastKey(); } long dataInterval = getTimelineMetricInterval(values, intervalStartTime, intervalEndTime); if (dataInterval == -1 || dataInterval < MINIMUM_STEP_INTERVAL) { dataInterval = temporalInfo.getStep() != null ? temporalInfo.getStep() : -1; } if (dataInterval == -1) { return; } Double paddingValue = 0.0d; if (strategy.equals(PADDING_STRATEGY.NULLS)) { paddingValue = null; } for (long counter = intervalStartTime; counter < dataStartTime; counter += dataInterval) { values.put(counter, paddingValue); } for (long counter = dataEndTime + dataInterval; counter <= intervalEndTime; counter += dataInterval) { values.put(counter, paddingValue); } metric.setMetricValues(values); }

Target:
public void applyPaddingStrategy(TimelineMetric metric, TemporalInfo temporalInfo) { if (strategy.equals(PADDING_STRATEGY.NONE) || temporalInfo == null) { return; } TreeMap<Long, Double> values = metric.getMetricValues(); if (values==null || values.isEmpty()) { return; } long intervalStartTime = longToMillis(temporalInfo.getStartTime()); long intervalEndTime = longToMillis(temporalInfo.getEndTime()); long dataStartTime = longToMillis(values.firstKey()); long dataEndTime = longToMillis(values.lastKey()); if (intervalEndTime < 0) { intervalEndTime = dataEndTime; } if (intervalStartTime > intervalEndTime) { return; } long dataInterval = getTimelineMetricInterval(values, intervalStartTime, intervalEndTime); if (dataInterval == -1 || dataInterval < MINIMUM_STEP_INTERVAL) { dataInterval = temporalInfo.getStep() != null ? temporalInfo.getStep() : -1; } if (dataInterval == -1) { return; } Double paddingValue = 0.0d; if (strategy.equals(PADDING_STRATEGY.NULLS)) { paddingValue = null; } for (long counter = intervalStartTime; counter < dataStartTime; counter += dataInterval) { values.put(counter, paddingValue); } for (long counter = dataEndTime + dataInterval; counter <= intervalEndTime; counter += dataInterval) { values.put(counter, paddingValue); } metric.setMetricValues(values); }
Source:
protected void onEditTextChanged() { Dialog dlg = getDialog(); if(dlg instanceof AlertDialog) { AlertDialog alertDlg = (AlertDialog)dlg; Button btn = alertDlg.getButton(AlertDialog.BUTTON_POSITIVE); boolean enable = Patterns.WEB_URL.matcher(getEditText().getText().toString()).matches(); btn.setEnabled(enable); if(!enable) { this.getEditText().setError("Invalid URL"); } } }

Target:
protected void onEditTextChanged() { Dialog dlg = getDialog(); if(dlg instanceof AlertDialog) { AlertDialog alertDlg = (AlertDialog)dlg; Button btn = alertDlg.getButton(AlertDialog.BUTTON_POSITIVE); boolean enable = Patterns.WEB_URL.matcher(getEditText().getText().toString()).matches(); btn.setEnabled(enable); } }
Source:
public void nonEmptyListOfObjectsToNullableArrayOfStrings() { List<Object> list = new ArrayList<Object>(3); list.add(1); list.add(null); list.add(3); String[] array = InternalQueries.nullableArrayOfStrings(list); assertThat(array).isNotNull(); assertThat(array.length).isEqualTo(list.size()); assertThat(array[0]).isEqualTo("1"); assertThat(array[1]).isEqualTo("null"); assertThat(array[2]).isEqualTo("3"); }

Target:
public void nonEmptyListOfObjectsToNullableArrayOfStrings() { List<Object> list = new ArrayList<Object>(3); list.add(1); list.add(null); list.add(3); String[] array = InternalQueries.nullableArrayOfStrings(list); assertThat(array).containsExactly("1", "null", "3"); }
Source:
public AnnotationMetadata(String vepVersion, String cacheVersion) { this.vepVersion = vepVersion; this.cacheVersion = cacheVersion; }

Target:
public AnnotationMetadata(String vepVersion, String cacheVersion) { this.id = vepVersion + "_" + cacheVersion; this.vepVersion = vepVersion; this.cacheVersion = cacheVersion; }
Source:
public static EmbeddedForeignKeyDescriptor buildEmbeddedForeignKeyDescriptor( EmbeddableValuedModelPart fkTarget, AbstractAttributeMapping attributeMapping, Value bootValueMapping, Dialect dialect, MappingModelCreationProcess creationProcess) { final List<String> keyColumnExpressions = new ArrayList<>(); bootValueMapping.getColumnIterator().forEachRemaining( column -> keyColumnExpressions.add( column.getText( dialect ) ) ); final List<String> targetColumnExpressions = new ArrayList<>(); fkTarget.getMappedColumnExpressions().forEach( column -> targetColumnExpressions.add( column ) ); return new EmbeddedForeignKeyDescriptor( (EmbeddedIdentifierMappingImpl) fkTarget, getTableIdentifierExpression( bootValueMapping.getTable(), creationProcess ), keyColumnExpressions, fkTarget.getContainingTableExpression(), targetColumnExpressions, creationProcess ); }

Target:
public static EmbeddedForeignKeyDescriptor buildEmbeddedForeignKeyDescriptor( EmbeddableValuedModelPart fkTarget, AbstractAttributeMapping attributeMapping, Value bootValueMapping, Dialect dialect, MappingModelCreationProcess creationProcess) { final List<String> keyColumnExpressions = new ArrayList<>(bootValueMapping.getColumnSpan()); bootValueMapping.getColumnIterator().forEachRemaining( column -> keyColumnExpressions.add( column.getText( dialect ) ) ); final List<String> mappedColumnExpressions = fkTarget.getMappedColumnExpressions(); final List<String> targetColumnExpressions = new ArrayList<>( mappedColumnExpressions.size() ); mappedColumnExpressions.forEach( column -> targetColumnExpressions.add( column ) ); return new EmbeddedForeignKeyDescriptor( (EmbeddedIdentifierMappingImpl) fkTarget, getTableIdentifierExpression( bootValueMapping.getTable(), creationProcess ), keyColumnExpressions, fkTarget.getContainingTableExpression(), targetColumnExpressions, creationProcess ); }
Source:
public void sendEmailsForWorkspace(WorkspaceMetacardImpl workspaceMetacard, Long hitCount) { subscriptionsPersistentStore .getEmails(workspaceMetacard.getId()) .forEach(email -> sendEmailForWorkspace(workspaceMetacard, hitCount, email)); }

Target:
void sendEmailsForWorkspace(WorkspaceMetacardImpl workspaceMetacard, Long hitCount) { subscriptionsPersistentStore .getEmails(workspaceMetacard.getId()) .forEach(email -> sendEmailForWorkspace(workspaceMetacard, hitCount, email)); }
Source:
public static String getCssIdentifier(String string) { Pattern pattern = Pattern.create("(^[a-zA-Z][a-zA-Z0-9\\-\\_]+$)|(^-[a-zA-Z][a-zA-Z0-9\\-\\_]+$)"); if (pattern.test(string)) return string; else { StringBuilder builder = new StringBuilder(); for (int i = 0; i < string.length(); i++) { char c = string.charAt(i); if (c == '_' || c > 0x00A0 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (i > 0 && (c == '-' || (c >= '0' && c <= '9')))) builder.append(c); else builder.append("x"); } return builder.toString(); } }

Target:
public static String getCssIdentifier(String string) { Pattern pattern = Pattern.create("(^-?[a-zA-Z_][a-zA-Z0-9\\-_]+$)"); if (pattern.test(string)) return string; else { StringBuilder builder = new StringBuilder(); for (int i = 0; i < string.length(); i++) { char c = string.charAt(i); if (c == '_' || c > 0x00A0 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (i > 0 && (c == '-' || (c >= '0' && c <= '9')))) builder.append(c); else builder.append("_"); } return builder.toString(); } }
Source:
private RuntimeEnvironment() { configuration = new Configuration(); configLock = new ReentrantReadWriteLock(); authFrameworkLock = new ReentrantLock(); watchDog = new WatchDogService(); lzIndexerParallelizer = LazilyInstantiate.using(() -> new IndexerParallelizer(this)); lzSearchExecutor = LazilyInstantiate.using(() -> newSearchExecutor()); }

Target:
private RuntimeEnvironment() { configuration = new Configuration(); configLock = new ReentrantReadWriteLock(); watchDog = new WatchDogService(); lzIndexerParallelizer = LazilyInstantiate.using(() -> new IndexerParallelizer(this)); lzSearchExecutor = LazilyInstantiate.using(() -> newSearchExecutor()); }
Source:
public final void retrievesKeys() throws Exception { final PublicKeys keys = this.keys(); MatcherAssert.assertThat( keys.iterate(), Matchers.<PublicKey>iterableWithSize(2) ); }

Target:
public final void retrievesKeys() throws Exception { final PublicKeys keys = this.keys(); final PublicKey key = keys.create("key", "ssh 1AA"); MatcherAssert.assertThat( keys.iterate(), Matchers.hasItem(key) ); keys.remove(key.number()); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); if (gfRepo == null) { return null; } InputDialog inputDialog = new StartDialog( HandlerUtil.getActiveShell(event), UIText.FeatureStartHandler_provideFeatureName, UIText.FeatureStartHandler_pleaseProvideANameForTheNewFeature, "", new FeatureNameValidator(gfRepo)); if (inputDialog.open() != Window.OK) { return null; } final String featureName = inputDialog.getValue(); int timeout = Activator.getDefault().getPreferenceStore() .getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT); FeatureStartOperation featureStartOperation = new FeatureStartOperation( gfRepo, featureName, timeout); JobUtil.scheduleUserWorkspaceJob(featureStartOperation, UIText.FeatureStartHandler_startingNewFeature, JobFamilies.GITFLOW_FAMILY); IJobManager jobMan = Job.getJobManager(); try { jobMan.join(GITFLOW_FAMILY, null); } catch (OperationCanceledException | InterruptedException e) { return error(e.getMessage(), e); } BranchOperationUI.handleSingleRepositoryCheckoutOperationResult( gfRepo.getRepository(), featureStartOperation.getCheckoutResult(), gfRepo.getConfig().getFullFeatureBranchName(featureName)); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); if (gfRepo == null) { return null; } InputDialog inputDialog = new StartDialog( HandlerUtil.getActiveShell(event), UIText.FeatureStartHandler_provideFeatureName, UIText.FeatureStartHandler_pleaseProvideANameForTheNewFeature, "", new FeatureNameValidator(gfRepo)); if (inputDialog.open() != Window.OK) { return null; } final String featureName = inputDialog.getValue(); int timeout = Activator.getDefault().getPreferenceStore() .getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT); GitFlowOperation operation = new FeatureStartOperation( gfRepo, featureName, timeout); String fullBranchName = gfRepo.getConfig() .getFullFeatureBranchName(featureName); JobUtil.scheduleUserWorkspaceJob(operation, UIText.FeatureStartHandler_startingNewFeature, JobFamilies.GITFLOW_FAMILY, new PostBranchCheckoutUiTask(gfRepo, fullBranchName, operation)); return null; }
Source:
private RetryRegistry createRetryRegistry( RetryConfigurationProperties retryConfigurationProperties, RegistryEventConsumer<Retry> retryRegistryEventConsumer, CompositeCustomizer<RetryConfigCustomizer> compositeRetryCustomizer) { Map<String, RetryConfig> configs = retryConfigurationProperties.getConfigs() .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> retryConfigurationProperties .createRetryConfig(entry.getValue(), compositeRetryCustomizer, entry.getKey()))); return RetryRegistry.of(configs, retryRegistryEventConsumer, retryConfigurationProperties.getTags()); }

Target:
private RetryRegistry createRetryRegistry( RetryConfigurationProperties retryConfigurationProperties, RegistryEventConsumer<Retry> retryRegistryEventConsumer, CompositeCustomizer<RetryConfigCustomizer> compositeRetryCustomizer) { Map<String, RetryConfig> configs = retryConfigurationProperties.getConfigs() .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> retryConfigurationProperties .createRetryConfig(entry.getValue(), compositeRetryCustomizer, entry.getKey()))); return RetryRegistry.of(configs, retryRegistryEventConsumer, Map.copyOf(retryConfigurationProperties.getTags())); }
Source:
public void testUpgradeNotAllowed() throws Exception { setOldTimestampToInduceUpgrade = true; SystemCatalogCreationOnConnectionIT.PhoenixSysCatCreationTestingDriver driver = firstConnectionNSMappingServerEnabledClientEnabled(); driver.resetCQS(); Properties clientProps = getClientProperties(true, true); UpgradeUtil.doNotUpgradeOnFirstConnection(clientProps); setOldTimestampToInduceUpgrade = false; try { driver.getConnectionQueryServices(getJdbcUrl(), clientProps); } catch (Exception e) { assertTrue(e instanceof UpgradeRequiredException); } assertEquals(hbaseTables, getHBaseTables()); assertEquals(1, countUpgradeAttempts); assertEquals(0, actualSysCatUpgrades); Connection conn = driver.getConnectionQueryServices(getJdbcUrl(), new Properties()).connect(getJdbcUrl(), new Properties()); try { conn.createStatement().execute(EXECUTE_UPGRADE_COMMAND); assertEquals(1, actualSysCatUpgrades); } catch (Exception e) { fail("EXECUTE UPGRADE should not fail"); } finally { conn.close(); } }

Target:
public void testUpgradeNotAllowed() throws Exception { setOldTimestampToInduceUpgrade = true; SystemCatalogCreationOnConnectionIT.PhoenixSysCatCreationTestingDriver driver = firstConnectionNSMappingServerEnabledClientEnabled(); driver.resetCQS(); Properties clientProps = getClientProperties(true, true); UpgradeUtil.doNotUpgradeOnFirstConnection(clientProps); setOldTimestampToInduceUpgrade = false; try { driver.getConnectionQueryServices(getJdbcUrl(), clientProps); } catch (Exception e) { assertTrue(e instanceof UpgradeRequiredException); } assertEquals(hbaseTables, getHBaseTables()); assertEquals(1, countUpgradeAttempts); assertEquals(0, actualSysCatUpgrades); Connection conn = driver.getConnectionQueryServices(getJdbcUrl(), new Properties()).connect(getJdbcUrl(), new Properties()); try { conn.createStatement().execute(EXECUTE_UPGRADE_COMMAND); assertEquals(1, actualSysCatUpgrades); } finally { conn.close(); } }
Source:
public SSLConfig build() { final String sniProxyProperty = System.getProperty(GEMFIRE_PREFIX + "security.sni-proxy"); final InetSocketAddress sniProxyAddress; if (sniProxyProperty == null) { sniProxyAddress = null; } else { try { final URL parser = new URL("http://" + sniProxyProperty); final String host = parser.getHost(); final int port = parser.getPort(); sniProxyAddress = new InetSocketAddress(host, port); } catch (MalformedURLException e) { throw new RuntimeException(e); } } return new SSLConfig(endpointIdentification, useDefaultSSLContext, enabled, protocols, ciphers, requireAuth, keystore, keystoreType, keystorePassword, truststore, truststorePassword, truststoreType, alias, securableCommunicationChannel, properties, sslParameterExtension, sniProxyAddress); }

Target:
public SSLConfig build() { return new SSLConfig(endpointIdentification, useDefaultSSLContext, enabled, protocols, ciphers, requireAuth, keystore, keystoreType, keystorePassword, truststore, truststorePassword, truststoreType, alias, securableCommunicationChannel, properties, sslParameterExtension, getSniProxyAddress()); }
Source:
public void onDestroy() { if (mBannerSpot != null) { mBannerSpot.destroy(); mBannerSpot = null; } }

Target:
public void onDestroy() { if (mBannerSpot != null) { mBannerSpot.destroy(); mBannerSpot = null; } if (mInterstitialSpot != null) { mInterstitialSpot.destroy();; mInterstitialSpot = null; } if (mInterstitialContext != null) { mInterstitialContext.clear(); mInterstitialContext = null; } }