auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSimplePush(GitConnectionFactory connectionFactory) throws IOException, ServerException, URISyntaxException, UnauthorizedException { GitConnection connection = connectToInitializedGitRepository(connectionFactory, repository); GitConnection remoteConnection = connectionFactory.getConnection(remoteRepo.getAbsolutePath()); remoteConnection.clone(newDto(CloneRequest.class).withRemoteUri(connection.getWorkingDir().getAbsolutePath()) .withWorkingDir(remoteConnection.getWorkingDir().getAbsolutePath())); addFile(remoteConnection, "newfile", "content"); remoteConnection.add(newDto(AddRequest.class).withFilepattern(Arrays.asList("."))); remoteConnection.commit(newDto(CommitRequest.class).withMessage("Fake commit")); PushResponse pushResponse = remoteConnection.push(newDto(PushRequest.class) .withRefSpec(Arrays.asList("refs/heads/master:refs/heads/test")) .withRemote("origin") .withTimeout(-1)); assertEquals(connection.branchList(newDto(BranchListRequest.class)).size(), 1); connection.checkout(newDto(CheckoutRequest.class).withName("test")); assertTrue(new File(connection.getWorkingDir(), "newfile").exists()); assertTrue(pushResponse.getCommandOutput().contains(connection.getWorkingDir().getAbsolutePath())); }

Target:
public void testSimplePush(GitConnectionFactory connectionFactory) throws IOException, ServerException, URISyntaxException, UnauthorizedException { GitConnection connection = connectToInitializedGitRepository(connectionFactory, repository); GitConnection remoteConnection = connectionFactory.getConnection(remoteRepo.getAbsolutePath()); remoteConnection.clone(newDto(CloneRequest.class).withRemoteUri(connection.getWorkingDir().getAbsolutePath()) .withWorkingDir(remoteConnection.getWorkingDir().getAbsolutePath())); addFile(remoteConnection, "newfile", "content"); remoteConnection.add(newDto(AddRequest.class).withFilepattern(Collections.singletonList("."))); remoteConnection.commit(newDto(CommitRequest.class).withMessage("Fake commit")); remoteConnection.push(newDto(PushRequest.class) .withRefSpec(Collections.singletonList("refs/heads/master:refs/heads/test")) .withRemote("origin") .withTimeout(-1)); assertEquals(connection.branchList(newDto(BranchListRequest.class)).size(), 1); connection.checkout(newDto(CheckoutRequest.class).withName("test")); assertTrue(new File(connection.getWorkingDir(), "newfile").exists()); }
Source:
public Span buildAndStartSpan(String name, SpanContext spanContext) { if(getTracer() == null) { m_tracer = GlobalTracer.get(); } if (spanContext == null) { return getTracer().buildSpan("Provisiond-" + name).start(); } else { return getTracer().buildSpan("Provisiond-" + name).asChildOf(spanContext).start(); } }

Target:
public Span buildAndStartSpan(String name, SpanContext spanContext) { if(m_tracer == null) { m_tracer = GlobalTracer.get(); } if (spanContext == null) { return m_tracer.buildSpan("Provisiond-" + name).start(); } else { return m_tracer.buildSpan("Provisiond-" + name).asChildOf(spanContext).start(); } }
Source:
protected boolean validateExtensionElement(IConfigurationElement element) { final boolean ret; if (TAG_ENGINE_FACTORY.equals(element.getName())) { if (element.getAttribute(ATT_CLASS) == null) { logMissingAttribute(element, ATT_CLASS); ret = false; } else if (element.getAttribute(ATT_RANKING) == null) { String rankingStr = element.getAttribute(ATT_RANKING); try { Integer.parseInt(rankingStr); } catch (NumberFormatException nfe) { log(IStatus.ERROR, element, EMFCompareRCPMessages.getString( "malformed.extension.attribute", ATT_RANKING)); } logMissingAttribute(element, ATT_RANKING); ret = false; } else { ret = true; } } else { ret = false; } return ret; }

Target:
protected boolean validateExtensionElement(IConfigurationElement element) { final boolean ret; if (TAG_ENGINE_FACTORY.equals(element.getName())) { if (element.getAttribute(ATT_CLASS) == null) { logMissingAttribute(element, ATT_CLASS); ret = false; } else if (element.getAttribute(ATT_RANKING) == null) { logMissingAttribute(element, ATT_RANKING); ret = false; } else if (element.getAttribute(ATT_RANKING) != null) { String rankingStr = element.getAttribute(ATT_RANKING); try { Integer.parseInt(rankingStr); } catch (NumberFormatException nfe) { log(IStatus.ERROR, element, EMFCompareRCPMessages.getString( "malformed.extension.attribute", ATT_RANKING)); return false; } ret = true; } else { ret = true; } } else { ret = false; } return ret; }
Source:
short getCurrentTimeMillis() { return (short) System.currentTimeMillis(); }

Target:
long getCurrentTimeMillis() { return System.currentTimeMillis(); }
Source:
static PermissionManager getInstance(SyncUser syncUser) { synchronized (cacheLock) { String userId = syncUser.getIdentity(); ThreadLocal<Cache> threadLocalCache = cache.get(userId); if (threadLocalCache == null) { threadLocalCache = new ThreadLocal<>(); threadLocalCache.set(new Cache()); cache.put(userId, threadLocalCache); } Cache c = threadLocalCache.get(); if (c.instanceCounter == 0) { c.pm = new PermissionManager(syncUser); } c.instanceCounter++; return c.pm; } }

Target:
static PermissionManager getInstance(SyncUser syncUser) { synchronized (cacheLock) { String userId = syncUser.getIdentity(); ThreadLocal<Cache> threadLocalCache = cache.get(userId); if (threadLocalCache == null) { threadLocalCache = new ThreadLocal<Cache>() { @Override protected Cache initialValue() { return new Cache(); } }; cache.put(userId, threadLocalCache); } Cache c = threadLocalCache.get(); if (c.instanceCounter == 0) { c.pm = new PermissionManager(syncUser); } c.instanceCounter++; return c.pm; } }
Source:
private void processReferenceInstances(Object entity, Consumer<BaseEntity<?>> handler) { BaseEntity<?> referenceInstance = (BaseEntity<?>) getDescriptor().getReferenceInstance(); if (entity instanceof MongoBlob) { referenceInstance.getMapper() .select(referenceInstance.getClass()) .eq(nameAsMapping, ((MongoBlob) entity).getBlobKey()) .iterateAll(handler); } if (entity instanceof SQLBlob) { referenceInstance.getMapper() .select(referenceInstance.getClass()) .eq(nameAsMapping, ((SQLBlob) entity).getBlobKey()) .iterateAll(handler); } }

Target:
private void processReferenceInstances(Object entity, Consumer<BaseEntity<?>> handler) { BaseEntity<?> referenceInstance = (BaseEntity<?>) getDescriptor().getReferenceInstance(); referenceInstance.getMapper() .select(referenceInstance.getClass()) .eq(nameAsMapping, ((Blob) entity).getBlobKey()) .iterateAll(handler); }
Source:
public void testFillNodes() { try { long startTime = 1; File historyTreeFile = NonNullUtils.checkNotNull(File.createTempFile("HistoryTreeBackendTest", ".ht")); HistoryTreeBackendStub backend = new HistoryTreeBackendStub(SSID, historyTreeFile, PROVIDER_VERSION, startTime, BLOCK_SIZE, MAX_CHILDREN); final int nbAttr = 5; int duration = nbAttr; int quarkTest = nbAttr; long time = startTime + duration; HTInterval interval = new HTInterval(startTime, time, quarkTest, TmfStateValue.newValueLong(time)); backend.insertPastState(interval.getStartTime(), interval.getEndTime(), interval.getAttribute(), interval.getStateValue()); while (backend.getHistoryTree().getDepth() < 3) { backend.insertPastState( Math.max(startTime, time - duration), time - 1, (int) time % nbAttr, TmfStateValue.newValueLong(time)); time++; } HTNode latestLeaf = backend.getHistoryTree().getLatestLeaf(); while (interval.getSizeOnDisk() <= latestLeaf.getNodeFreeSpace() || latestLeaf.isOnDisk()) { backend.insertPastState( Math.max(startTime, time - duration), time - 1, (int) time % nbAttr, TmfStateValue.newValueLong(time)); time++; } backend.insertPastState(interval.getEndTime() + 1, time, quarkTest, TmfStateValue.newValueLong(time)); backend.getHistoryTree().assertIntegrity(); } catch (IOException e) { fail(e.getMessage()); } }

Target:
public void testFillNodes() { try { final int nbAttr = 5; final int depthToRead = 3; long startTime = 1; File historyTreeFile = NonNullUtils.checkNotNull(File.createTempFile("HistoryTreeBackendTest", ".ht")); HistoryTreeBackendStub backend = new HistoryTreeBackendStub(SSID, historyTreeFile, PROVIDER_VERSION, startTime, BLOCK_SIZE, MAX_CHILDREN); int duration = nbAttr; int quarkTest = nbAttr; long time = startTime + duration; HTInterval interval = new HTInterval(startTime, time, quarkTest, TmfStateValue.newValueLong(time)); backend.insertPastState(interval.getStartTime(), interval.getEndTime(), interval.getAttribute(), interval.getStateValue()); while (backend.getHistoryTree().getDepth() < depthToRead) { backend.insertPastState( Math.max(startTime, time - duration), time - 1, (int) time % nbAttr, TmfStateValue.newValueLong(time)); time++; } HTNode latestLeaf = backend.getHistoryTree().getLatestLeaf(); while (interval.getSizeOnDisk() <= latestLeaf.getNodeFreeSpace() || latestLeaf.isOnDisk()) { backend.insertPastState( Math.max(startTime, time - duration), time - 1, (int) time % nbAttr, TmfStateValue.newValueLong(time)); time++; } backend.insertPastState(interval.getEndTime() + 1, time, quarkTest, TmfStateValue.newValueLong(time)); backend.getHistoryTree().assertIntegrity(); } catch (IOException e) { fail(e.getMessage()); } }
Source:
public void scaleDownDelay() throws Exception { createSessionFactory(); ClientSession session = createSession(sf, true, true); session.createQueue(new QueueConfiguration(ADDRESS)); ClientProducer producer = session.createProducer(ADDRESS); sendMessages(session, producer, 1000); crash(session); Thread.sleep(100); ClientConsumer consumer = session.createConsumer(ADDRESS); session.start(); receiveDurableMessages(consumer); session.close(); sf.close(); Assert.assertEquals(0, sf.numSessions()); Assert.assertEquals(0, sf.numConnections()); }

Target:
public void scaleDownDelay() throws Exception { createSessionFactory(); ClientSession session = createSession(sf, true, true); session.createQueue(new QueueConfiguration(ADDRESS)); ClientProducer producer = session.createProducer(ADDRESS); sendMessages(session, producer, 1000); crash(session); Queue serverQueue = backupServer.getServer().locateQueue(ADDRESS); Wait.assertEquals(1000, serverQueue::getMessageCount); ClientConsumer consumer = session.createConsumer(ADDRESS); session.start(); receiveDurableMessages(consumer); session.close(); sf.close(); Assert.assertEquals(0, sf.numSessions()); Assert.assertEquals(0, sf.numConnections()); }
Source:
private TechnologyTreePanel getTechTree() { if (techPanel == null) { techPanel = new TechnologyTreePanel( Constant.messages.getString("context.technology.tree.root")); } else { techPanel.refresh(); } return techPanel; }

Target:
private TechnologyTreePanel getTechTree() { if (techPanel == null) { techPanel = new TechnologyTreePanel( Constant.messages.getString("context.technology.tree.root")); } return techPanel; }
Source:
private ClassLoader getClassLoaderForShell(Long definitionId) throws SClassLoaderException { ClassLoader classLoader; if (definitionId == null) { throw new SClassLoaderException("Unable to execute groovy outside of a process classloader, no definitionId is given"); } else { classLoader = classLoaderService.getLocalClassLoader(DEFINITION_TYPE, definitionId); classLoaderService.addListener(DEFINITION_TYPE, definitionId, this); } return classLoader; }

Target:
private ClassLoader getClassLoaderForShell(Long definitionId) throws SClassLoaderException { ClassLoader classLoader; if (definitionId == null) { classLoader = Thread.currentThread().getContextClassLoader(); if (debugEnabled) { IllegalStateException illegalStateException = new IllegalStateException(); logger.log(this.getClass(), TechnicalLogSeverity.DEBUG, "Creating a shell without definition id, might cause issue when reloading classes", illegalStateException); } } else { classLoader = classLoaderService.getLocalClassLoader(DEFINITION_TYPE, definitionId); classLoaderService.addListener(DEFINITION_TYPE, definitionId, this); } return classLoader; }
Source:
private void handleDispatchExceptionCase(ExecutionReference reference, ExecutableFlow exflow, Executor lastSelectedExecutor, Set<Executor> remainingExecutors) throws ExecutorManagerException { reference.setNumErrors(reference.getNumErrors() + 1); reference.setExecutor(null); if (reference.getNumErrors() >= MAX_DISPATCHING_ERRORS_PERMITTED || remainingExecutors.size() <= 1) { logger.error("Failed to process queued flow"); finalizeFlows(exflow); } else { remainingExecutors.remove(lastSelectedExecutor); processFlow(reference, exflow, remainingExecutors); } }

Target:
private void handleDispatchExceptionCase(ExecutionReference reference, ExecutableFlow exflow, Executor lastSelectedExecutor, Set<Executor> remainingExecutors) throws ExecutorManagerException { logger .info(String .format( "Reached handleDispatchExceptionCase stage for exec %d with error count %d", exflow.getExecutionId(), reference.getNumErrors())); reference.setNumErrors(reference.getNumErrors() + 1); reference.setExecutor(null); if (reference.getNumErrors() >= MAX_DISPATCHING_ERRORS_PERMITTED || remainingExecutors.size() <= 1) { logger.error("Failed to process queued flow"); finalizeFlows(exflow); } else { remainingExecutors.remove(lastSelectedExecutor); processFlow(reference, exflow, remainingExecutors); } }
Source:
private long getComplexStateRetainedSize(TestComplexState state) { long retainedSize = ClassLayout.parseClass(state.getClass()).instanceSize(); Field[] fields = state.getClass().getDeclaredFields(); try { for (Field field : fields) { Class type = field.getType(); field.setAccessible(true); if (type.equals(BlockBigArray.class) || type.equals(BooleanBigArray.class) || type.equals(SliceBigArray.class) || type.equals(ByteBigArray.class) || type.equals(DoubleBigArray.class) || type.equals(LongBigArray.class)) { MethodHandle sizeOf = MethodHandles.lookup().findVirtual(type, "sizeOf", MethodType.methodType(long.class)); retainedSize += (long) sizeOf.invokeWithArguments(field.get(state)); } } } catch (Throwable t) { throw new RuntimeException(t); } return retainedSize; }

Target:
private long getComplexStateRetainedSize(TestComplexState state) { long retainedSize = ClassLayout.parseClass(state.getClass()).instanceSize(); Field[] fields = state.getClass().getDeclaredFields(); try { for (Field field : fields) { Class type = field.getType(); field.setAccessible(true); if (type == BlockBigArray.class || type == BooleanBigArray.class || type == SliceBigArray.class || type == ByteBigArray.class || type == DoubleBigArray.class || type == LongBigArray.class) { MethodHandle sizeOf = Reflection.methodHandle(type, "sizeOf", null); retainedSize += (long) sizeOf.invokeWithArguments(field.get(state)); } } } catch (Throwable t) { throw new RuntimeException(t); } return retainedSize; }
Source:
private void handleOpenPageIntent(Intent intent) { String pagePosition = intent.getStringExtra(ARG_OPEN_PAGE); if (!TextUtils.isEmpty(pagePosition)) { switch (pagePosition) { case ARG_MY_SITE: mBottomNav.setCurrentSelectedPage(PageType.MY_SITE); break; case ARG_NOTIFICATIONS: mBottomNav.setCurrentSelectedPage(PageType.NOTIFS); break; case ARG_READER: mBottomNav.setCurrentSelectedPage(PageType.READER); break; case ARG_EDITOR: if (mSelectedSite == null) { initSelectedSite(); } onNewPostButtonClicked(); break; case ARG_STATS: if (mSelectedSite == null) { initSelectedSite(); } ActivityLauncher.viewBlogStats(this, mSelectedSite); break; case ARG_PAGES: if (mSelectedSite == null) { initSelectedSite(); } Log.d(WPMainActivity.class.getSimpleName(), "***=> ARGS PAGES"); ActivityLauncher.viewCurrentBlogPages(this, mSelectedSite); break; } } else { AppLog.e(T.MAIN, "WPMainActivity.handleOpenIntent called with an invalid argument."); } }

Target:
private void handleOpenPageIntent(Intent intent) { String pagePosition = intent.getStringExtra(ARG_OPEN_PAGE); if (!TextUtils.isEmpty(pagePosition)) { switch (pagePosition) { case ARG_MY_SITE: mBottomNav.setCurrentSelectedPage(PageType.MY_SITE); break; case ARG_NOTIFICATIONS: mBottomNav.setCurrentSelectedPage(PageType.NOTIFS); break; case ARG_READER: mBottomNav.setCurrentSelectedPage(PageType.READER); break; case ARG_EDITOR: if (mSelectedSite == null) { initSelectedSite(); } onNewPostButtonClicked(); break; case ARG_STATS: if (mSelectedSite == null) { initSelectedSite(); } ActivityLauncher.viewBlogStats(this, mSelectedSite); break; case ARG_PAGES: if (mSelectedSite == null) { initSelectedSite(); } ActivityLauncher.viewCurrentBlogPages(this, mSelectedSite); break; } } else { AppLog.e(T.MAIN, "WPMainActivity.handleOpenIntent called with an invalid argument."); } }
Source:
protected void dig(Block b, BlockMenu menu, Block block) { Collection<ItemStack> drops = block.getDrops(effectivePickaxe); if (!SlimefunTag.UNBREAKABLE_MATERIALS.isTagged(block.getType()) && !drops.isEmpty()) { OfflinePlayer owner = Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"))); if (SlimefunPlugin.getProtectionManager().hasPermission(owner, block.getLocation(), ProtectableAction.BREAK_BLOCK)) { AndroidMineEvent event = new AndroidMineEvent(block, new AndroidInstance(this, b)); String blockId = BlockStorage.checkID(block); if (blockId != null) { event.setCancelled(true); } Bukkit.getPluginManager().callEvent(event); if (!event.isCancelled()) { for (ItemStack drop : drops) { if (menu.fits(drop, getOutputSlots())) { menu.pushItem(drop, getOutputSlots()); } } block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType()); block.setType(Material.AIR); } } } }

Target:
protected void dig(Block b, BlockMenu menu, Block block) { Collection<ItemStack> drops = block.getDrops(effectivePickaxe); if (!SlimefunTag.UNBREAKABLE_MATERIALS.isTagged(block.getType()) && !drops.isEmpty()) { OfflinePlayer owner = Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"))); if (SlimefunPlugin.getProtectionManager().hasPermission(owner, block.getLocation(), ProtectableAction.BREAK_BLOCK)) { AndroidMineEvent event = new AndroidMineEvent(block, new AndroidInstance(this, b)); if (BlockStorage.hasBlockInfo(block)) { event.setCancelled(true); } Bukkit.getPluginManager().callEvent(event); if (!event.isCancelled()) { for (ItemStack drop : drops) { if (menu.fits(drop, getOutputSlots())) { menu.pushItem(drop, getOutputSlots()); } } block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType()); block.setType(Material.AIR); } } } }
Source:
public void storeCommand() throws PersistenceException { if (FilenameUtils.getExtension(dirPath).equals("") && !dirPath.endsWith(File.separator)) { dirPath += File.separator; } final File dumpDir = new File(dirPath); if (!dumpDir.exists()) { console.println( "Directory does not exist. If the directory does indeed exist, try putting the path in quotes."); return; } if (!dumpDir.isDirectory()) { console.println("Specified path is not a directory."); return; } cql = createCql(user, cql); List<Map<String, Object>> storeResults = getResults(); console.println("Results found: " + storeResults.size() + "\n"); int count = storeResults .stream() .map(PersistentItem.class::cast) .map( persistentItem -> { persistentItem.encodeBinaryProperties(); return persistentItem; }) .map(gson::toJson) .map(json -> writeRecordToFile(json, dumpDir)) .reduce(0, (sub, item) -> sub + item); console.println("Exported " + count + " records\n"); }

Target:
public void storeCommand() throws PersistenceException { if (dirPath == null) { console.println("Export directory is not specified"); return; } if (FilenameUtils.getExtension(dirPath).equals("") && !dirPath.endsWith(File.separator)) { dirPath += File.separator; } final File dumpDir = new File(dirPath); if (!dumpDir.exists()) { console.println( "Directory does not exist. If the directory does indeed exist, try putting the path in quotes."); return; } if (!dumpDir.isDirectory()) { console.println("Specified path is not a directory."); return; } cql = addUserConstraintToCql(user, cql); Function<List<Map<String, Object>>, Integer> exportFunction = results -> { return results .stream() .map(gson::toJson) .map(json -> writeRecordToFile(json, dumpDir)) .reduce(0, (a, b) -> a + b); }; long count = getResults(exportFunction); console.println("Exported: " + count + " records\n"); }
Source:
public NameContextGenerator createContextGenerator() { AdaptiveFeatureGenerator featureGenerator = createFeatureGenerators(); if (featureGenerator == null) { featureGenerator = createFeatureGenerators(); } return new DefaultNameContextGenerator(featureGenerator); }

Target:
public NameContextGenerator createContextGenerator() { AdaptiveFeatureGenerator featureGenerator = createFeatureGenerators(); if (featureGenerator == null) { featureGenerator = new CachedFeatureGenerator( new WindowFeatureGenerator(new TokenFeatureGenerator(), 2, 2), new WindowFeatureGenerator(new TokenClassFeatureGenerator(true), 2, 2), new OutcomePriorFeatureGenerator(), new PreviousMapFeatureGenerator(), new BigramNameFeatureGenerator(), new SentenceFeatureGenerator(true, false)); } return new DefaultNameContextGenerator(featureGenerator); }
Source:
public void shouldNotEnableAgentsWhenInvalidAgentUUIDIsprovided() throws Exception { AgentConfig agentConfig1 = new AgentConfig(UUID.randomUUID().toString(), "remote-host1", "50.40.30.21"); AgentConfig agentConfig2 = new AgentConfig(UUID.randomUUID().toString(), "remote-host2", "50.40.30.22"); agentConfigService.addAgent(agentConfig1, Username.ANONYMOUS); agentConfigService.addAgent(agentConfig2, Username.ANONYMOUS); CruiseConfig cruiseConfig = goConfigDao.load(); assertFalse(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled()); assertFalse(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled()); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); ArrayList<String> uuids = new ArrayList<>(); uuids.add(agentConfig1.getUuid()); uuids.add(agentConfig2.getUuid()); uuids.add("invalid-uuid"); agentConfigService.bulkUpdateAgentAttributes(Username.ANONYMOUS, result, uuids, new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), TriState.TRUE); cruiseConfig = goConfigDao.load(); assertThat(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled(), is(false)); assertThat(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled(), is(false)); assertFalse(result.isSuccessful()); assertThat(result.toString(), result.httpCode(), is(400)); assertTrue(result.toString(), result.toString().contains("AGENTS_WITH_UUIDS_NOT_FOUND")); assertTrue(result.toString(), result.toString().contains("invalid-uuid")); }

Target:
public void shouldNotEnableAgentsWhenInvalidAgentUUIDIsprovided() throws Exception { AgentConfig agentConfig1 = new AgentConfig(UUID.randomUUID().toString(), "remote-host1", "50.40.30.21"); AgentConfig agentConfig2 = new AgentConfig(UUID.randomUUID().toString(), "remote-host2", "50.40.30.22"); agentConfigService.addAgent(agentConfig1, Username.ANONYMOUS); agentConfigService.addAgent(agentConfig2, Username.ANONYMOUS); CruiseConfig cruiseConfig = goConfigDao.load(); assertFalse(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled()); assertFalse(cruiseConfig.agents().getAgentByUuid(agentConfig2.getUuid()).isDisabled()); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); ArrayList<String> uuids = new ArrayList<>(); uuids.add(agentConfig1.getUuid()); uuids.add(agentConfig2.getUuid()); uuids.add("invalid-uuid"); agentConfigService.bulkUpdateAgentAttributes(Username.ANONYMOUS, result, uuids, new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), TriState.TRUE); cruiseConfig = goConfigDao.load(); assertThat(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled(), is(false)); assertThat(cruiseConfig.agents().getAgentByUuid(agentConfig2.getUuid()).isDisabled(), is(false)); assertFalse(result.isSuccessful()); assertThat(result.toString(), result.httpCode(), is(400)); assertTrue(result.toString(), result.toString().contains("AGENTS_WITH_UUIDS_NOT_FOUND")); assertTrue(result.toString(), result.toString().contains("invalid-uuid")); }
Source:
protected void sendJsonMessage(ChatRoom chatRoom, T jsonMessage) { if (chatRoom == null || !(chatRoom instanceof ChatRoomJabberImpl)) { logger.error("Cannot sent message as chatRoom is null " + "or is not an instance of ChatRoomJabberImpl"); return; } String messageString = jsonMessage.toString(); try { ((ChatRoomJabberImpl)chatRoom).sendJsonMessage(messageString); if (logger.isTraceEnabled()) logger.trace("Sending json message: \"" + messageString + "\""); } catch (OperationFailedException e) { logger.warn("Failed to send json message " + messageString, e); } }

Target:
protected void sendJsonMessage(ChatRoom chatRoom, T jsonMessage) { if (chatRoom == null) { logger.error("Cannot sent message as chatRoom is null"); return; } if (!(chatRoom instanceof ChatRoomJabberImpl)) { logger.error("Cannot sent message as chatRoom is not an" + "instance of ChatRoomJabberImpl"); return; } String messageString = jsonMessage.toString(); try { ((ChatRoomJabberImpl)chatRoom).sendJsonMessage(messageString); if (logger.isTraceEnabled()) logger.trace("Sending json message: \"" + messageString + "\""); } catch (OperationFailedException e) { logger.warn("Failed to send json message " + messageString, e); } }
Source:
public void testConfirmPattern() { DispatchCallback callback = new DispatchCallback(); SqlLine line = new SqlLine(); assertEquals(Boolean.FALSE, line.getOpts().getConfirm()); line.runCommands( Collections.singletonList("!set confirmPattern " + "\"^(?i:(TRUNCATE|ALTER))\""), callback); assertEquals("^(?i:(TRUNCATE|ALTER))", line.getOpts() .getConfirmPattern()); line.runCommands( Collections.singletonList("!set confirmPattern default"), callback); assertEquals("default", line.getOpts().getConfirmPattern()); }

Target:
public void testConfirmPattern() { SqlLine line = new SqlLine(); assertEquals(Boolean.FALSE, line.getOpts().getConfirm()); ByteArrayOutputStream os = new ByteArrayOutputStream(); begin(line, os, false, "-e", "!set confirmPattern \"^(?i:(TRUNCATE|ALTER))\""); assertEquals("^(?i:(TRUNCATE|ALTER))", line.getOpts() .getConfirmPattern()); begin(line, os, false, "-e", "!set confirmPattern default"); assertEquals(line.loc("default-confirm-pattern"), line.getOpts().getConfirmPattern()); }
Source:
public Worker create(WorkerKey key) throws Exception { int workerId = pidCounter.getAndIncrement(); Path logFile = workerBaseDir.getRelative(WorkerKey.makeWorkerTypeName(key.getProxied()) + "-" + workerId + "-" + key.getMnemonic() + ".log"); Worker worker; boolean sandboxed = workerOptions.workerSandboxing || key.mustBeSandboxed(); if (sandboxed) { Path workDir = getSandboxedWorkerPath(key, workerId); worker = new SandboxedWorker(key, workerId, workDir, logFile); } else if (key.getProxied()) { worker = new WorkerProxy( key, workerId, key.getExecRoot(), logFile, WorkerMultiplexerManager.getInstance(key.hashCode())); } else { worker = new Worker(key, workerId, key.getExecRoot(), logFile); } if (workerOptions.workerVerbose) { reporter.handle( Event.info( String.format( "Created new %s %s %s (id %d), logging to %s", sandboxed ? "sandboxed" : "non-sandboxed", key.getMnemonic(), WorkerKey.makeWorkerTypeName(key.getProxied()), workerId, logFile))); } return worker; }

Target:
public Worker create(WorkerKey key) throws Exception { int workerId = pidCounter.getAndIncrement(); String workTypeName = WorkerKey.makeWorkerTypeName(key.getProxied()); Path logFile = workerBaseDir.getRelative(workTypeName + "-" + workerId + "-" + key.getMnemonic() + ".log"); Worker worker; boolean sandboxed = workerOptions.workerSandboxing || key.mustBeSandboxed(); if (sandboxed) { Path workDir = getSandboxedWorkerPath(key, workerId); worker = new SandboxedWorker(key, workerId, workDir, logFile); } else if (key.getProxied()) { worker = new WorkerProxy( key, workerId, key.getExecRoot(), logFile, WorkerMultiplexerManager.getInstance(key.hashCode())); } else { worker = new Worker(key, workerId, key.getExecRoot(), logFile); } if (workerOptions.workerVerbose) { reporter.handle( Event.info( String.format( "Created new %s %s %s (id %d), logging to %s", sandboxed ? "sandboxed" : "non-sandboxed", key.getMnemonic(), workTypeName, workerId, logFile))); } return worker; }
Source:
public Response execute() throws IOException { SettableFuture<Response> future = SettableFuture.create(); enqueue(new Callback() { @Override public void onFailure(Call call, IOException exception) { future.setException(exception); } @Override public void onResponse(Call call, Response response) throws IOException { future.set(response); } }); try { return future.get(timeout.toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.interrupted(); throw new IOException("Call was interrupted during execution"); } catch (ExecutionException e) { if (e.getCause() instanceof IoRemoteException) { throw ((IoRemoteException) e.getCause()).getWrappedException(); } else if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } else { throw new IOException("Failed to execute call", e); } } catch (TimeoutException e) { throw new IOException("Call timed out after: " + timeout.toString(), e); } }

Target:
public Response execute() throws IOException { SettableFuture<Response> future = SettableFuture.create(); enqueue(new Callback() { @Override public void onFailure(Call call, IOException exception) { future.setException(exception); } @Override public void onResponse(Call call, Response response) throws IOException { future.set(response); } }); try { return future.get(syncCallTimeout.toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { getDelegate().cancel(); Thread.currentThread().interrupt(); throw new InterruptedIOException("Call was interrupted during execution"); } catch (ExecutionException e) { getDelegate().cancel(); if (e.getCause() instanceof IoRemoteException) { throw ((IoRemoteException) e.getCause()).getWrappedException(); } else if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } else { throw new IOException("Failed to execute call", e); } } catch (TimeoutException e) { getDelegate().cancel(); throw new IOException("Call timed out after: " + syncCallTimeout.toString(), e); } }
Source:
public static SearchRequest toSearchRequest(Object queryObject, Exchange exchange) { SearchRequest searchRequest = new SearchRequest(exchange.getIn() .getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) .types(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); String queryText = null; if (queryObject instanceof Map<?, ?>) { Map<String, Object> mapQuery = (Map<String, Object>)queryObject; if (mapQuery.containsKey(ElasticsearchConstants.ES_QUERY_DSL_PREFIX)) { mapQuery = (Map<String, Object>)mapQuery.get(ElasticsearchConstants.ES_QUERY_DSL_PREFIX); } try { XContentBuilder contentBuilder = XContentFactory.contentBuilder(XContentType.JSON); queryText = contentBuilder.map(mapQuery).string(); } catch (IOException e) { LOG.error(e.getMessage()); } } else if (queryObject instanceof String) { queryText = (String)queryObject; ObjectMapper mapper = new ObjectMapper(); try { JsonNode jsonTextObject = mapper.readValue(queryText, JsonNode.class); JsonNode parentJsonNode = jsonTextObject.get(ElasticsearchConstants.ES_QUERY_DSL_PREFIX); if (parentJsonNode != null) { queryText = parentJsonNode.toString(); } } catch (IOException e) { LOG.error(e.getMessage()); } } else { return null; } searchSourceBuilder.query(QueryBuilders.wrapperQuery(queryText)); searchRequest.source(searchSourceBuilder); return searchRequest; }

Target:
public static SearchRequest toSearchRequest(Object queryObject, Exchange exchange) throws IOException { SearchRequest searchRequest = new SearchRequest(exchange.getIn() .getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) .types(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); String queryText = null; if (queryObject instanceof Map<?, ?>) { Map<String, Object> mapQuery = (Map<String, Object>) queryObject; if (mapQuery.containsKey(ES_QUERY_DSL_PREFIX)) { mapQuery = (Map<String, Object>) mapQuery.get(ES_QUERY_DSL_PREFIX); } try { XContentBuilder contentBuilder = XContentFactory.contentBuilder(XContentType.JSON); queryText = contentBuilder.map(mapQuery).string(); } catch (IOException e) { LOG.error(e.getMessage()); } } else if (queryObject instanceof String) { queryText = (String) queryObject; ObjectMapper mapper = new ObjectMapper(); JsonNode jsonTextObject = mapper.readValue(queryText, JsonNode.class); JsonNode parentJsonNode = jsonTextObject.get(ES_QUERY_DSL_PREFIX); if (parentJsonNode != null) { queryText = parentJsonNode.toString(); } } else { return null; } searchSourceBuilder.query(QueryBuilders.wrapperQuery(queryText)); searchRequest.source(searchSourceBuilder); return searchRequest; }
Source:
public static ScoreBoardClock getInstance() { if (instance == null) { instance = new ScoreBoardClock(); } return instance; }

Target:
public static ScoreBoardClock getInstance() { return instance; }
Source:
public EclDirectServiceSoapProxy getSoapProxy() { return wsEclDirectServiceSoapProxy; }

Target:
public EclDirectServiceSoapProxy getSoapProxy() throws Exception { if (wsEclDirectServiceSoapProxy != null) return wsEclDirectServiceSoapProxy; else throw new Exception("wsECLDirectServiceSoapProxy not available"); }
Source:
protected List<Issue> makeIssues(final Severity severity, final CheckType checkType) { final Issue issue = new Issue(severity, checkType, new HashSet<>(Arrays.asList(ruleInspector.getRowIndex() + 1, other.getRowIndex() + 1)) ); issue.setDebugMessage(new RuleInspectorDumper(ruleInspector).dump() + " ## " + new RuleInspectorDumper(other).dump()); return Arrays.asList(issue); }

Target:
protected List<Issue> makeIssues(final Severity severity, final CheckType checkType) { final Issue issue = new Issue(severity, checkType, new HashSet<>(Arrays.asList(ruleInspector.getRowIndex() + 1, other.getRowIndex() + 1)) ); issue.setDebugMessage(new RuleInspectorDumper(ruleInspector).dump() + " ## " + new RuleInspectorDumper(other).dump()); return Collections.singletonList(issue); }
Source:
public void shutdown() throws InterruptedException { if (statsAggregator != null) { statsAggregator.cancel(true); } scheduler.shutdown(); if (!scheduler.awaitTermination(30, TimeUnit.SECONDS)) { logger.error("Could not terminate aggregator tasks after StatsManager shutdown"); } }

Target:
public void shutdown() throws InterruptedException { if (statsAggregator != null) { statsAggregator.cancel(); } if (scheduler != null) { scheduler.shutdown(); if (!scheduler.awaitTermination(30, TimeUnit.SECONDS)) { logger.error("Could not terminate aggregator tasks after StatsManager shutdown"); } } }
Source:
public void intializeView() { userId = CurrentUserManager.get(this).getId(); purchaseRequestHistoryAdapter = new PurchaseRequestHistoryAdapter(purchaseList); recyclerView = (RecyclerView) findViewById(R.id.purchase_history_list); recyclerView.setAdapter(purchaseRequestHistoryAdapter); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.addItemDecoration(new PurchaseRequestItemDivider(this)); Toolbar toolbar = (Toolbar) findViewById(R.id.purchase_history_toolbar); setSupportActionBar(toolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } fetchPurchaseRequest(); }

Target:
public void intializeView() { userId = CurrentUserManager.get(this).getId(); purchaseRequestHistoryAdapter = new PurchaseRequestHistoryAdapter(purchaseList); recyclerView = (RecyclerView) findViewById(R.id.purchase_history_list); recyclerView.setAdapter(purchaseRequestHistoryAdapter); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.addItemDecoration(new PurchaseRequestItemDivider(this)); Toolbar toolbar = (Toolbar) findViewById(R.id.purchase_history_toolbar); setSupportActionBar(toolbar); ActionBar.enableHomeButton(this); fetchPurchaseRequest(); }
Source:
public Handle plus(@NotNull GrammarAST plusAST, @NotNull Handle blk) { PlusBlockStartState blkStart = (PlusBlockStartState)blk.left; BlockEndState blkEnd = (BlockEndState)blk.right; preventEpsilonClosureBlocks.add(new Triple<Rule, ATNState, ATNState>(currentRule, blkStart, blkEnd)); PlusLoopbackState loop = newState(PlusLoopbackState.class, plusAST); loop.loopStartState = blkStart; loop.nonGreedy = !((QuantifierAST)plusAST).isGreedy(); atn.defineDecisionState(loop); LoopEndState end = newState(LoopEndState.class, plusAST); blkStart.loopBackState = loop; end.loopBackState = loop; plusAST.atnState = loop; epsilon(blkEnd, loop); BlockAST blkAST = (BlockAST)plusAST.getChild(0); if ( ((QuantifierAST)plusAST).isGreedy() ) { if (expectNonGreedy(blkAST)) { g.tool.errMgr.grammarError(ErrorType.EXPECTED_NON_GREEDY_WILDCARD_BLOCK, g.fileName, plusAST.getToken(), plusAST.getToken().getText()); } epsilon(loop, blkStart); epsilon(loop, end); } else { epsilon(loop, end); epsilon(loop, blkStart); } return new Handle(blkStart, end); }

Target:
public Handle plus(@NotNull GrammarAST plusAST, @NotNull Handle blk) { PlusBlockStartState blkStart = (PlusBlockStartState)blk.left; BlockEndState blkEnd = (BlockEndState)blk.right; preventEpsilonClosureBlocks.add(new Triple<Rule, ATNState, ATNState>(currentRule, blkStart, blkEnd)); PlusLoopbackState loop = newState(PlusLoopbackState.class, plusAST); loop.nonGreedy = !((QuantifierAST)plusAST).isGreedy(); atn.defineDecisionState(loop); LoopEndState end = newState(LoopEndState.class, plusAST); blkStart.loopBackState = loop; end.loopBackState = loop; plusAST.atnState = blkStart; epsilon(blkEnd, loop); BlockAST blkAST = (BlockAST)plusAST.getChild(0); if ( ((QuantifierAST)plusAST).isGreedy() ) { if (expectNonGreedy(blkAST)) { g.tool.errMgr.grammarError(ErrorType.EXPECTED_NON_GREEDY_WILDCARD_BLOCK, g.fileName, plusAST.getToken(), plusAST.getToken().getText()); } epsilon(loop, blkStart); epsilon(loop, end); } else { epsilon(loop, end); epsilon(loop, blkStart); } return new Handle(blkStart, end); }
Source:
public static void startAdminBlobStorageService() throws InstantiationException, IOException { clusterMap = new MockClusterMap(false); adminBlobStorageService = getAdminBlobStorageService(clusterMap); adminBlobStorageService.start(); }

Target:
public static void startAdminBlobStorageService() throws InstantiationException, IOException { clusterMap = new MockClusterMap(); adminBlobStorageService = getAdminBlobStorageService(clusterMap); adminBlobStorageService.start(); }
Source:
private URL getPipeUrl(String pipePath) { try { return new URL(new URL(serverUrl), pipePath); } catch (MalformedURLException e) { throw new RuntimeException(e); } }

Target:
private URL getPipeUrl(String pipePath) { try { return UrlUtils.appendQueryToBaseURL(new URL(serverUrl), pipePath); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
Source:
public static void portSetup() { backupPort = allocatePort(); }

Target:
public void portSetup() { backupPort = allocatePort(); db = (GraphDatabaseAPI) new GraphDatabaseFactory().newEmbeddedDatabaseBuilder( testDirectory.graphDbDir() ) .setConfig( online_backup_enabled,"true" ) .setConfig( online_backup_server, "127.0.0.1:" + backupPort ) .setConfig( bloom_enabled, "true" ) .newGraphDatabase(); }
Source:
public Configuration parseMainConfig(final InputStream input) throws Exception { Reader reader = new InputStreamReader(input); String xml = XMLUtil.readerToString(reader); xml = XMLUtil.replaceSystemProps(xml); Element e = XMLUtil.stringToElement(xml); NodeList children = e.getElementsByTagName("core"); if (children.getLength() > 0) { Node item = children.item(0); XMLUtil.validate(item, "schema/artemis-configuration.xsd"); } Configuration config = new ConfigurationImpl(); parseMainConfig(e, config); return config; }

Target:
public Configuration parseMainConfig(final InputStream input) throws Exception { Reader reader = new InputStreamReader(input); String xml = XMLUtil.readerToString(reader); xml = XMLUtil.replaceSystemProps(xml); Element e = XMLUtil.stringToElement(xml); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(XMLUtil.findResource("schema/artemis-server.xsd")); Validator validator = schema.newValidator(); try { validator.validate(new DOMSource(e)); } catch (Exception ex) { ActiveMQServerLogger.LOGGER.error(ex.getMessage()); } Configuration config = new ConfigurationImpl(); parseMainConfig(e, config); return config; }
Source:
public void uploadFromFile(String filePath, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions, Duration timeout) { }

Target:
public void uploadFromFile(String filePath, ParallelTransferOptions parallelTransferOptions, BlobHttpHeaders headers, Map<String, String> metadata, AccessTier tier, BlobRequestConditions requestConditions, Duration timeout) { this.uploadFromFile(filePath, new BlobUploadFromFileOptions() .setParallelTransferOptions(parallelTransferOptions).setHeaders(headers).setMetadata(metadata) .setTier(tier).setRequestConditions(requestConditions), null); }
Source:
public void online(String tableName, boolean wait) throws AccumuloSecurityException, AccumuloException, TableNotFoundException { checkArgument(tableName != null, "tableName is null"); String tableId = Tables.getTableId(context.getInstance(), tableName); TableState expectedState = Tables.getTableState(context.getInstance(), tableId); if (expectedState == TableState.ONLINE) { return; } List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableId.getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); try { doTableFateOperation(tableName, TableNotFoundException.class, FateOperation.TABLE_ONLINE, args, opts); } catch (TableExistsException e) { throw new AssertionError(e); } if (wait) waitForTableStateTransition(tableId, TableState.ONLINE); }

Target:
public void online(String tableName, boolean wait) throws AccumuloSecurityException, AccumuloException, TableNotFoundException { checkArgument(tableName != null, "tableName is null"); String tableId = Tables.getTableId(context.getInstance(), tableName); TableState expectedState = Tables.getTableState(context.getInstance(), tableId, true); if (expectedState == TableState.ONLINE) { return; } List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableId.getBytes(UTF_8))); Map<String,String> opts = new HashMap<>(); try { doTableFateOperation(tableName, TableNotFoundException.class, FateOperation.TABLE_ONLINE, args, opts); } catch (TableExistsException e) { throw new AssertionError(e); } if (wait) waitForTableStateTransition(tableId, TableState.ONLINE); }
Source:
public int hashCode() { int result = address != null ? address.hashCode() : 0; result = 31 * result + (href != null ? href.hashCode() : 0); result = 31 * result + (adjustments != null ? adjustments.hashCode() : 0); result = 31 * result + (invoices != null ? invoices.hashCode() : 0); result = 31 * result + (subscriptions != null ? subscriptions.hashCode() : 0); result = 31 * result + (transactions != null ? transactions.hashCode() : 0); result = 31 * result + (accountCode != null ? accountCode.hashCode() : 0); result = 31 * result + (state != null ? state.hashCode() : 0); result = 31 * result + (username != null ? username.hashCode() : 0); result = 31 * result + (email != null ? email.hashCode() : 0); result = 31 * result + (firstName != null ? firstName.hashCode() : 0); result = 31 * result + (lastName != null ? lastName.hashCode() : 0); result = 31 * result + (companyName != null ? companyName.hashCode() : 0); result = 31 * result + (acceptLanguage != null ? acceptLanguage.hashCode() : 0); result = 31 * result + (hostedLoginToken != null ? hostedLoginToken.hashCode() : 0); result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0); result = 31 * result + (billingInfo != null ? billingInfo.hashCode() : 0); return result; }

Target:
public int hashCode() { return Objects.hashCode( address, href, adjustments, invoices, subscriptions, transactions, accountCode, state, username, email, firstName, lastName, companyName, acceptLanguage, hostedLoginToken, createdAt, billingInfo ); }
Source:
private ResponseEntity<String> executeQuery(String query) throws QStoreStorageException { List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = buildRestHeader(messageConverters, restTemplate); HttpEntity<String> request = new HttpEntity<String>(query, headers); try { String url = getQStoreQueryURL(); UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url).queryParam("class", RELATION_EVENT); return restTemplate.postForEntity(builder.build().encode().toUri(), request, String.class); } catch (RestClientException e) { throw new QStoreStorageException(e); } }

Target:
private ResponseEntity<String> executeQuery(String query) throws AsyncExecutionException { List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = buildRestHeader(messageConverters, restTemplate); headers.setAccept(Arrays.asList(MediaType.APPLICATION_XML)); HttpEntity<String> request = new HttpEntity<String>(query, headers); try { String url = getQStoreQueryURL(); UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url).queryParam("class", RELATION_EVENT); return restTemplate.postForEntity(builder.build().encode().toUri(), request, String.class); } catch (RestClientException e) { throw new AsyncExecutionException(e); } }
Source:
public void testGetTableDescriptor_nullTable() throws Exception { if (SharedTestEnvRule.getInstance().isBigtable()) { AsyncAdmin asyncAdmin = getAsyncConnection().getAdmin(); assertEquals(null, asyncAdmin.getDescriptor(null).get()); } }

Target:
public void testGetTableDescriptor_nullTable() throws Exception { Assume.assumeTrue("HBase asyncAdmin.getDescriptor(null) seems to break the mini-cluster", SharedTestEnvRule.getInstance().isBigtable()); AsyncAdmin asyncAdmin = getAsyncConnection().getAdmin(); assertEquals(null, asyncAdmin.getDescriptor(null).get()); }
Source:
private List<HasMetadata> unmarshalToolObjects(Tool k8sTool, String toolLocalContent) throws DevfileRecipeFormatException { try { return unmarshal(toolLocalContent); } catch (DevfileRecipeFormatException e) { throw new DevfileRecipeFormatException( format( "Error occurred during parsing list from file %s for tool '%s': %s", k8sTool.getLocal(), k8sTool.getName(), e.getMessage())); } }

Target:
private List<HasMetadata> unmarshalToolObjects(Tool k8sTool, String toolLocalContent) throws DevfileRecipeFormatException { try { return unmarshal(toolLocalContent); } catch (DevfileRecipeFormatException e) { throw new DevfileRecipeFormatException( format( "Error occurred during parsing list from file %s for tool '%s': %s", k8sTool.getLocal(), k8sTool.getName(), e.getMessage()), e); } }
Source:
public Long getUuid() { return new Long(getLocalId()); }

Target:
public Long getUuid() { return Long.valueOf(getLocalId()); }
Source:
public Subject authenticate() { KerberosConfiguration configuration = new KerberosConfiguration(); Set<Principal> principals = ImmutableSet.of(new KerberosPrincipal(principal)); Subject subject = new Subject(false, principals, ImmutableSet.of(), ImmutableSet.of()); try { LoginContext loginContext = new LoginContext("", subject, null, configuration); loginContext.login(); return loginContext.getSubject(); } catch (LoginException e) { throw Throwables.propagate(e); } }

Target:
public Subject authenticate() { Subject subject = new Subject(false, principalsSet, emptySet(), emptySet()); try { LoginContext loginContext = new LoginContext("", subject, null, kerberosConfiguration); loginContext.login(); return loginContext.getSubject(); } catch (LoginException e) { throw Throwables.propagate(e); } }
Source:
HandshakeConfig(HttpMessage httpMessage, boolean followRedirects, boolean useSessionState){ this.httpMessage = httpMessage; this.followRedirects = followRedirects; this.useSessionState = useSessionState; }

Target:
public HandshakeConfig(HttpMessage httpMessage, boolean followRedirects, boolean useSessionState){ this.httpMessage = httpMessage; this.followRedirects = followRedirects; this.useSessionState = useSessionState; }