auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void runUntilCanceled() throws InterruptedException { ExponentialBackOff backoffTracker = null; while (!isCanceled()) { if (Thread.interrupted()) { throw new InterruptedException(); } Collection<Metric> metrics = metricsQueue.poll(batchSize, maxIdleTime); if (metrics.isEmpty() && lastWorkTime > 0 && maxIdleTime > 0 && System.currentTimeMillis() > lastWorkTime + maxIdleTime) { log.info("Shutting down writer due to dearth of work"); break; } if (metrics.isEmpty()) { log.debug("No work to do, so checking again."); continue; } try { if (backoffTracker == null) { backoffTracker = createExponentialBackOff(); } processBatch(metrics); backoffTracker.reset(); } catch (NoSuchElementException e) { long backOff = this.minBackOff; try { backOff = backoffTracker.nextBackOffMillis(); } catch (IOException e1) { } if (ExponentialBackOff.STOP == backOff) { backOff = backoffTracker.getMaxIntervalMillis(); log.warn("Error getting OpenTsdbClient after ms: {}", backoffTracker.getElapsedTimeMillis(), e); } else { log.debug("Error getting OpenTsdbClient", e); } log.debug("Connection back off, sleeping:{}", backOff); Thread.sleep(backOff); } } }

Target:
void runUntilCanceled() throws InterruptedException { ExponentialBackOff backoffTracker = null; while (!isCanceled()) { if (Thread.interrupted()) { throw new InterruptedException(); } Collection<Metric> metrics = metricsQueue.poll(batchSize, maxIdleTime); if (metrics.isEmpty() && lastWorkTime > 0 && maxIdleTime > 0 && System.currentTimeMillis() > lastWorkTime + maxIdleTime) { log.info("Shutting down writer due to dearth of work"); break; } if (metrics.isEmpty()) { log.debug("No work to do, so checking again."); continue; } try { if (backoffTracker == null) { backoffTracker = createExponentialBackOff(); } processBatch(metrics); backoffTracker.reset(); } catch (NoSuchElementException e) { long backOff = this.minBackOff; try { backOff = backoffTracker.nextBackOffMillis(); } catch (IOException e1) { } if (ExponentialBackOff.STOP == backOff) { backOff = backoffTracker.getMaxIntervalMillis(); log.warn("Error getting OpenTsdbClient after ms: {}", backoffTracker.getElapsedTimeMillis(), e); } else { log.debug("Error getting OpenTsdbClient", e); } log.debug("Connection back off, sleeping ms", backOff); Thread.sleep(backOff); } } }
Source:
private Property getProperty(Class<?> clazz, String property, ElementType elementType) { Contracts.assertNotNull( clazz, MESSAGES.classCannotBeNull() ); if ( property == null || property.length() == 0 ) { throw LOG.getPropertyNameCannotBeNullOrEmptyException(); } if ( !( ElementType.FIELD.equals( elementType ) || ElementType.METHOD.equals( elementType ) ) ) { throw LOG.getElementTypeHasToBeFieldOrMethodException(); } if ( ElementType.FIELD.equals( elementType ) ) { Field field = run( GetDeclaredField.action( clazz, property ) ); return field == null ? null : new JavaBeanField( field ); } else { Method method = GetMethodFromPropertyName.action( clazz, propertyFilter, property ).run(); return method == null ? null : JavaBeanExecutable.of( propertyFilter, method ).as( Property.class ); } }

Target:
private Optional<Property> getProperty(Class<?> clazz, String property, ElementType elementType) { Contracts.assertNotNull( clazz, MESSAGES.classCannotBeNull() ); if ( property == null || property.length() == 0 ) { throw LOG.getPropertyNameCannotBeNullOrEmptyException(); } if ( !( ElementType.FIELD.equals( elementType ) || ElementType.METHOD.equals( elementType ) ) ) { throw LOG.getElementTypeHasToBeFieldOrMethodException(); } if ( ElementType.FIELD.equals( elementType ) ) { return javaBean.getFieldPropertyByName( property ); } else { return javaBean.getCallablePropertyByName( property ); } }
Source:
private static void recordTimer( Registry registry, URL requestUrl, Long durationNs, int statusCode, boolean wasSuccessful, boolean hasAuthHeaders) { registry.timer( registry.createId("okhttp.requests") .withTag("requestHost", requestUrl.getHost()) .withTag("statusCode", String.valueOf(statusCode)) .withTag("status", bucket(statusCode)) .withTag("success", wasSuccessful) .withTag("hasAuthHeaders", hasAuthHeaders) ) .record(durationNs, TimeUnit.NANOSECONDS); }

Target:
private static void recordTimer( Registry registry, URL requestUrl, Long durationNs, int statusCode, boolean wasSuccessful, boolean hasAuthHeaders) { registry .timer( registry .createId("okhttp.requests") .withTag("requestHost", requestUrl.getHost()) .withTag("statusCode", String.valueOf(statusCode)) .withTag("status", bucket(statusCode)) .withTag("success", wasSuccessful) .withTag("authenticated", hasAuthHeaders)) .record(durationNs, TimeUnit.NANOSECONDS); }
Source:
private void configureCompilerLog(CompilerConfiguration compilerConfiguration) { Map<String, String> map = compilerConfiguration.getCustomCompilerArgumentsAsMap(); if (!map.keySet().contains("-log") || ".".equals(outputJar.getName())) { return; } String logPath = map.get("-log"); if (logPath == null) { LinkedList<String> keys = new LinkedList<String>(map.keySet()); int logIndex = keys.indexOf("-log"); if (logIndex == keys.size() - 1) { getLog().error( "Compiler argument '-log' found, but no additional argument containing the path could be found"); return; } logPath = keys.get(logIndex + 1); map.remove(logPath); } File logFile = new File(logPath); String normalizedOutputJarName = outputJar.getName().replaceAll("/", "_").replaceAll("\\\\", "_"); String newLogFileName = normalizedOutputJarName + "_" + logFile.getName(); File newLogFile = new File(logFile.getParent(), newLogFileName); map.remove("-log"); map.put("-log", newLogFile.getAbsolutePath()); compilerConfiguration.setCustomCompilerArgumentsAsMap(map); }

Target:
private void configureCompilerLog(CompilerConfiguration compilerConfiguration) { if (!logEnabled) { return; } logDirectory.mkdirs(); String logFileName = null; if (".".equals(outputJar.getName())) { logFileName = "@dot"; } else { logFileName = outputJar.getName().replaceAll("/", "_"); } String logPath = logDirectory.getAbsolutePath(); if (!logPath.endsWith(File.separator)) { logPath = logPath + File.separator; } String fileExtension = logFormat; if ("plain".equals(logFormat)) { fileExtension = "log"; } logPath = logPath + logFileName + "." + fileExtension; compilerConfiguration.addCompilerCustomArgument("-log", logPath); }
Source:
private static SiriusContext fromDRepresentation(DRepresentation repr) { Session session = new EObjectQuery(repr).getSession(); DSemanticDecorator decorator = null; if (repr instanceof DSemanticDecorator) { decorator = (DSemanticDecorator) repr; } EObject mainSemanticElement = null; if (decorator != null) { mainSemanticElement = decorator.getTarget(); } return new SiriusContext(repr, session, repr, decorator, mainSemanticElement); }

Target:
private static SiriusContext fromDRepresentation(DRepresentation repr) { Session session = Session.of(repr).orElse(null); DSemanticDecorator decorator = null; if (repr instanceof DSemanticDecorator) { decorator = (DSemanticDecorator) repr; } EObject mainSemanticElement = null; if (decorator != null) { mainSemanticElement = decorator.getTarget(); } return new SiriusContext(repr, session, repr, decorator, mainSemanticElement); }
Source:
private List<TaskInfo> getTasks() { List<TaskInfo> taskInfos = workQueue.getTaskInfos(new TaskInfoFactory<TaskInfo>() { @Override public TaskInfo getTaskInfo(Task<?> task) { return new TaskInfo(task); } }); Collections.sort(taskInfos, new Comparator<TaskInfo>() { @Override public int compare(TaskInfo a, TaskInfo b) { if (a.state != b.state) { return a.state.ordinal() - b.state.ordinal(); } int cmp = Long.signum(a.delay - b.delay); if (cmp != 0) { return cmp; } return a.command.compareTo(b.command); } }); return taskInfos; }

Target:
private List<TaskInfo> getTasks() { List<TaskInfo> taskInfos = workQueue.getTaskInfos(new TaskInfoFactory<TaskInfo>() { @Override public TaskInfo getTaskInfo(Task<?> task) { return new TaskInfo(task); } }); Collections.sort(taskInfos, new Comparator<TaskInfo>() { @Override public int compare(TaskInfo a, TaskInfo b) { return ComparisonChain.start() .compare(a.state.ordinal(), b.state.ordinal()) .compare(a.delay, b.delay) .compare(a.command, b.command) .result(); } }); return taskInfos; }
Source:
public String getDescription() { try { WebApp webapp = WebApp.getCurrent(); MetaClass meta = webapp.getMetaClass(super.clazz); Script s = meta.loadTearOff(JellyClassTearOff.class).resolveScript("newInstanceDetail"); if (s == null) { meta.loadTearOff(JellyClassTearOff.class).resolveScript("newJobDetail"); } DefaultScriptInvoker dsi = new DefaultScriptInvoker(); StringWriter sw = new StringWriter(); XMLOutput xml = dsi.createXMLOutput(sw, true); dsi.invokeScript(Stapler.getCurrentRequest(), Stapler.getCurrentResponse(), s, meta, xml); return sw.toString(); } catch (Exception e) { return ""; } }

Target:
public String getDescription() { Stapler stapler = Stapler.getCurrent(); if (stapler != null) { try { WebApp webapp = WebApp.getCurrent(); MetaClass meta = webapp.getMetaClass(this); Script s = meta.loadTearOff(JellyClassTearOff.class).findScript("newInstanceDetail"); if (s == null) { return ""; } DefaultScriptInvoker dsi = new DefaultScriptInvoker(); StringWriter sw = new StringWriter(); XMLOutput xml = dsi.createXMLOutput(sw, true); dsi.invokeScript(Stapler.getCurrentRequest(), Stapler.getCurrentResponse(), s, this, xml); return sw.toString(); } catch (Exception e) { LOGGER.log(Level.WARNING, null, e); return ""; } } else { return ""; } }
Source:
private static Attribute createAttribute(String key, Serializable value) { if (value instanceof Collection) { Collection<?> valueCollection = (Collection<?>) value; return new AttributeImpl(key, new ArrayList<>(valueCollection)); } return new AttributeImpl(key, value); }

Target:
private static Attribute createAttribute(String key, Serializable value) { return new AttributeImpl( key, value instanceof Collection ? new ArrayList<>((Collection<?>) value) : value); }
Source:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); String scope = element.getAttribute(BeanDefinitionParserDelegate.SCOPE_ATTRIBUTE); if (StringUtils.hasText(scope)) { builder.setScope(scope); } String host = element.getAttribute("host"); if (StringUtils.hasText(host)) { builder.addPropertyValue("host", host); } String port = element.getAttribute("port"); if (StringUtils.hasText(port)) { builder.addPropertyValue("port", port); } String scheme = element.getAttribute("scheme"); if (StringUtils.hasText(scheme)) { builder.addPropertyValue("scheme", scheme); } String app = element.getAttribute("app"); if (StringUtils.hasText(app)) { builder.addPropertyValue("app", app); } String owner = element.getAttribute("owner"); if (StringUtils.hasText(owner)) { builder.addPropertyValue("owner", owner); } String userName = element.getAttribute("userName"); if (StringUtils.hasText(userName)) { builder.addPropertyValue("userName", userName); } String password = element.getAttribute("password"); if (StringUtils.hasText(password)) { builder.addPropertyValue("password", password); } }

Target:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, BeanDefinitionParserDelegate.SCOPE_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "host"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "port"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "scheme"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "app"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "owner"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "userName"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "password"); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { IEditorPart part = HandlerUtil.getActiveEditor(event); if (part instanceof AbstractTextEditor) { Collection<LSPDocumentInfo> infos = LanguageServiceAccessor.getLSPDocumentInfosFor( LSPEclipseUtils.getDocument((ITextEditor) part), capabilities -> Boolean.TRUE.equals(capabilities.getRenameProvider())); if (!infos.isEmpty()) { LSPDocumentInfo info = infos.iterator().next(); ISelection sel = ((AbstractTextEditor) part).getSelectionProvider().getSelection(); if (sel instanceof TextSelection) { int offset = ((TextSelection) sel).getOffset(); String oldName = ""; RefactoringProcessor processor = new LSPRenameProcessor(info, offset, oldName); ProcessorBasedRefactoring refactoring = new ProcessorBasedRefactoring(processor); LSPRenameRefactoringWizard wizard = new LSPRenameRefactoringWizard(refactoring); RefactoringWizardOpenOperation operation = new RefactoringWizardOpenOperation(wizard); try { operation.run(part.getSite().getShell(), Messages.rename_title); } catch (InterruptedException e1) { LanguageServerPlugin.logError(e1); } } } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IEditorPart part = HandlerUtil.getActiveEditor(event); if (part instanceof AbstractTextEditor) { Collection<LSPDocumentInfo> infos = LanguageServiceAccessor.getLSPDocumentInfosFor( LSPEclipseUtils.getDocument((ITextEditor) part), capabilities -> Boolean.TRUE.equals(capabilities.getRenameProvider())); if (!infos.isEmpty()) { LSPDocumentInfo info = infos.iterator().next(); ISelection sel = ((AbstractTextEditor) part).getSelectionProvider().getSelection(); if (sel instanceof TextSelection) { int offset = ((TextSelection) sel).getOffset(); RefactoringProcessor processor = new LSPRenameProcessor(info, offset); ProcessorBasedRefactoring refactoring = new ProcessorBasedRefactoring(processor); LSPRenameRefactoringWizard wizard = new LSPRenameRefactoringWizard(refactoring); RefactoringWizardOpenOperation operation = new RefactoringWizardOpenOperation(wizard); try { operation.run(part.getSite().getShell(), Messages.rename_title); } catch (InterruptedException e1) { LanguageServerPlugin.logError(e1); } } } } return null; }
Source:
public void testCall() throws Exception { ListBranchesCommand listBranchesCommand = fGerrit.listBranches(Common.TEST_PROJECT); BranchInfo[] listBranchesResult = null; try { listBranchesResult = listBranchesCommand.call(); } catch (EGerritException e) { fail(e.getMessage()); } System.out.println(listBranchesResult[0].getRef()); assertEquals(listBranchesResult[0].getRef(), "HEAD"); }

Target:
public void testCall() throws Exception { ListBranchesCommand listBranchesCommand = fGerrit.listBranches(Common.TEST_PROJECT); BranchInfo[] listBranchesResult = null; try { listBranchesResult = listBranchesCommand.call(); } catch (EGerritException e) { fail(e.getMessage()); } assertEquals(listBranchesResult[0].getRef(), "HEAD"); }
Source:
public boolean performFinish() { try { final int actionSelection = importWithDirectoriesPage .getActionSelection(); final IProject[] projectsToShare; if (actionSelection == GitSelectWizardPage.ACTION_DIALOG_SHARE) projectsToShare = mySharePage.getSelectedProjects(); else projectsToShare = null; final File repoDir = selectRepoPage.getRepository().getDirectory(); getContainer().run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (actionSelection != GitSelectWizardPage.ACTION_DIALOG_SHARE) { importProjects(); } if (actionSelection != GitSelectWizardPage.ACTION_NO_SHARE) { IProject[] projects; if (projectsToShare == null) projects = getAddedProjects(); else projects = projectsToShare; for (IProject prj : projects) { if (monitor.isCanceled()) throw new InterruptedException(); ConnectProviderOperation connectProviderOperation = new ConnectProviderOperation( prj, repoDir); try { connectProviderOperation.execute(monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } } } }); } catch (InvocationTargetException e) { Activator .handleError(e.getCause().getMessage(), e.getCause(), true); return false; } catch (InterruptedException e) { Activator.handleError( UIText.GitCreateProjectViaWizardWizard_AbortedMessage, e, true); return false; } return true; }

Target:
public boolean performFinish() { try { final int actionSelection = importWithDirectoriesPage .getActionSelection(); final IProject[] projectsToShare; if (actionSelection == GitSelectWizardPage.ACTION_DIALOG_SHARE) projectsToShare = shareProjectsPage.getSelectedProjects(); else projectsToShare = null; final File repoDir = selectRepoPage.getRepository().getDirectory(); getContainer().run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (actionSelection != GitSelectWizardPage.ACTION_DIALOG_SHARE) { importProjects(); } if (actionSelection != GitSelectWizardPage.ACTION_NO_SHARE) { IProject[] projects; if (projectsToShare == null) projects = getAddedProjects(); else projects = projectsToShare; for (IProject prj : projects) { if (monitor.isCanceled()) throw new InterruptedException(); ConnectProviderOperation connectProviderOperation = new ConnectProviderOperation( prj, repoDir); try { connectProviderOperation.execute(monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } } } }); } catch (InvocationTargetException e) { Activator .handleError(e.getCause().getMessage(), e.getCause(), true); return false; } catch (InterruptedException e) { Activator.handleError( UIText.GitCreateProjectViaWizardWizard_AbortedMessage, e, true); return false; } return true; }
Source:
public void testVerifyIllegalStateException() throws IOException { for (OrcWriteValidationMode validationMode : OrcWriteValidationMode.values()) { TempFile tempFile = new TempFile(); OrcWriter writer = new OrcWriter( new MockOrcDataSink(new FileOutputStream(tempFile.getFile())), ImmutableList.of("test1"), ImmutableList.of(VARCHAR), ORC, NONE, new OrcWriterOptions() .withStripeMinSize(new DataSize(0, MEGABYTE)) .withStripeMaxSize(new DataSize(32, MEGABYTE)) .withStripeMaxRowCount(10) .withRowGroupMaxRowCount(ORC_ROW_GROUP_SIZE) .withDictionaryMaxMemory(new DataSize(32, MEGABYTE)), ImmutableMap.of(), HIVE_STORAGE_TIME_ZONE, true, validationMode, new OrcWriterStats()); int entries = 65536; BlockBuilder blockBuilder = VARCHAR.createBlockBuilder(null, entries); byte[] bytes = "dummyString".getBytes(); for (int j = 0; j < entries; j++) { bytes[0] = (byte) ((bytes[0] + 1) % 128); blockBuilder.writeBytes(Slices.wrappedBuffer(bytes, 0, bytes.length), 0, bytes.length); blockBuilder.closeEntry(); } Block[] blocks = new Block[] {blockBuilder.build()}; try { writer.write(new Page(blocks)); } catch (IOException e) { writer.close(); } } }

Target:
public void testVerifyIllegalStateException() throws IOException { OrcWriter writer = new OrcWriter( new MockOrcDataSink(), ImmutableList.of("test1"), ImmutableList.of(VARCHAR), ORC, NONE, new OrcWriterOptions() .withStripeMinSize(new DataSize(0, MEGABYTE)) .withStripeMaxSize(new DataSize(32, MEGABYTE)) .withStripeMaxRowCount(10) .withRowGroupMaxRowCount(ORC_ROW_GROUP_SIZE) .withDictionaryMaxMemory(new DataSize(32, MEGABYTE)), ImmutableMap.of(), HIVE_STORAGE_TIME_ZONE, false, null, new OrcWriterStats()); int entries = 65536; BlockBuilder blockBuilder = VARCHAR.createBlockBuilder(null, entries); byte[] bytes = "dummyString".getBytes(); for (int j = 0; j < entries; j++) { bytes[0] = (byte) ((bytes[0] + 1) % 128); blockBuilder.writeBytes(Slices.wrappedBuffer(bytes, 0, bytes.length), 0, bytes.length); blockBuilder.closeEntry(); } Block[] blocks = new Block[] {blockBuilder.build()}; try { writer.write(new Page(blocks)); } catch (IOException e) { writer.close(); } }
Source:
private void processNextQueuedCommand() { if (!fCommandQueue.isEmpty()) { final CommandHandle handle = fCommandQueue.remove(0); if (handle != null) { processCommandSent(handle); MICommand<MIInfo> command = handle.getCommand(); if (command instanceof MIThreadSelect || command instanceof MIStackSelectFrame) { return; } if (!fUseThreadAndFrameOptions || !command.supportsThreadAndFrameOptions()) { final IDMContext targetContext = command.getContext(); final String targetThread = handle.getThreadId(); final int targetFrame = handle.getStackFrameId(); IRunControl runControl = getServicesTracker().getService(IRunControl.class); IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(targetContext, IMIExecutionDMContext.class); if (runControl != null && execDmc != null && runControl.isSuspended(execDmc)) { if (targetThread != null && !targetThread.equals("0") && !targetThread.equals(fCurrentThreadId)) { fCurrentThreadId = targetThread; resetCurrentStackLevel(); CommandHandle cmdHandle = new CommandHandle( (MICommand<MIInfo>)getCommandFactory().createMIThreadSelect(targetContext, targetThread), null); cmdHandle.generateTokenId(); fTxCommands.add(cmdHandle); } if (targetFrame >= 0 && targetFrame != fCurrentStackLevel) { fCurrentStackLevel = targetFrame; CommandHandle cmdHandle = new CommandHandle( (MICommand<MIInfo>)getCommandFactory().createMIStackSelectFrame(targetContext, targetFrame), null); cmdHandle.generateTokenId(); fTxCommands.add(cmdHandle); } } } if (!(command instanceof RawCommand)) { handle.generateTokenId(); } fTxCommands.add(handle); } } }

Target:
private void processNextQueuedCommand() { if (!fCommandQueue.isEmpty()) { final CommandHandle handle = fCommandQueue.remove(0); if (handle != null) { processCommandSent(handle); if (!fUseThreadAndFrameOptions || !handle.getCommand().supportsThreadAndFrameOptions()) { final IDMContext targetContext = handle.fCommand.getContext(); final String targetThread = handle.getThreadId(); final int targetFrame = handle.getStackFrameId(); IRunControl runControl = getServicesTracker().getService(IRunControl.class); IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(targetContext, IMIExecutionDMContext.class); if (runControl != null && execDmc != null && runControl.isSuspended(execDmc)) { if (targetThread != null && !targetThread.equals("0") && !targetThread.equals(fCurrentThreadId)) { fCurrentThreadId = targetThread; resetCurrentStackLevel(); CommandHandle cmdHandle = new CommandHandle( (MICommand<MIInfo>)getCommandFactory().createMIThreadSelect(targetContext, targetThread), null); cmdHandle.generateTokenId(); fTxCommands.add(cmdHandle); } if (targetFrame >= 0 && targetFrame != fCurrentStackLevel) { fCurrentStackLevel = targetFrame; CommandHandle cmdHandle = new CommandHandle( (MICommand<MIInfo>)getCommandFactory().createMIStackSelectFrame(targetContext, targetFrame), null); cmdHandle.generateTokenId(); fTxCommands.add(cmdHandle); } } } if (!(handle.getCommand() instanceof RawCommand)) { handle.generateTokenId(); } fTxCommands.add(handle); } } }
Source:
private static List<MediaDB> getAllNotInLocal() { return new Select(). from(MediaDB.class). where(MediaDB_Table.filename.isNull()). and(MediaDB_Table.resource_url.isNotNull()). orderBy(MediaDB_Table.id_media, true). queryList(); }

Target:
private List<MediaDB> getAllNotInLocal() { return new Select(). from(MediaDB.class). where(MediaDB_Table.filename.isNull()). and(MediaDB_Table.resource_url.isNotNull()). orderBy(MediaDB_Table.id_media, true). queryList(); }
Source:
protected void executeCommand() { setVds(null); if (getVds() != null && shouldVdsBeFenced()) { boolean sshVdsmRestartSuccess = false; if (getParameters().shouldExecuteSshSoftFencing()) { sshVdsmRestartSuccess = executeSshSoftFencingCommand(getVds().getHostName(), getVds().getVdsGroupCompatibilityVersion() .toString()); } if (sshVdsmRestartSuccess) { ResourceManager.getInstance().GetVdsManager(getVds().getId()).sshSoftFencingExecutionCallback(getVds()); } else { super.executeCommand(); } } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", getVdsName(), getVdsId()); } }

Target:
protected void executeCommand() { setVds(null); if (getVds() != null && shouldVdsBeFenced()) { boolean sshVdsmRestartSuccess = false; if (getParameters().shouldExecuteSshSoftFencing()) { sshVdsmRestartSuccess = executeSshSoftFencingCommand(getVds().getHostName(), getVds().getVdsGroupCompatibilityVersion() .toString()); } if (sshVdsmRestartSuccess) { ResourceManager.getInstance().GetVdsManager(getVds().getId()).finishSshSoftFencingExecution(getVds()); } else { super.executeCommand(); } } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", getVdsName(), getVdsId()); } }
Source:
ARN(String arn) { this.arn = arn; Matcher sqsMatcher = PATTERN.matcher(arn); if (!sqsMatcher.matches()) { throw new IllegalArgumentException(arn + " is not a valid SNS or SQS ARN"); } this.region = sqsMatcher.group(1); this.name = sqsMatcher.group(3); }

Target:
ARN(String arn) { this.arn = arn; Matcher arnMatcher = PATTERN.matcher(arn); if (!arnMatcher.matches()) { throw new IllegalArgumentException(arn + " is not a valid ARN"); } this.region = arnMatcher.group(1); this.account = arnMatcher.group(2); this.name = arnMatcher.group(3); }
Source:
public ListConverter(Message.Builder parentBuilder, Descriptors.FieldDescriptor fieldDescriptor, Type parquetType) { OriginalType originalType = parquetType.getOriginalType(); if (originalType != OriginalType.LIST) { throw new ParquetDecodingException("Expected LIST wrapper. Found: " + originalType + " instead."); } listOfMessage = fieldDescriptor.getJavaType() == JavaType.MESSAGE; Type parquetSchema; if (parquetType.asGroupType().containsField("list")) { parquetSchema = parquetType.asGroupType().getType("list"); if (parquetSchema.asGroupType().containsField("element")) { parquetSchema = parquetSchema.asGroupType().getType("element"); } } else { throw new ParquetDecodingException("Expected list but got: " + parquetType); } converter = newMessageConverter(parentBuilder, fieldDescriptor, parquetSchema); }

Target:
public ListConverter(Message.Builder parentBuilder, Descriptors.FieldDescriptor fieldDescriptor, Type parquetType) { OriginalType originalType = parquetType.getOriginalType(); if (originalType != OriginalType.LIST || parquetType.isPrimitive()) { throw new ParquetDecodingException("Expected LIST wrapper. Found: " + originalType + " instead."); } GroupType rootWrapperType = parquetType.asGroupType(); if (!rootWrapperType.containsField("list") || rootWrapperType.getType("list").isPrimitive()) { throw new ParquetDecodingException("Expected repeated 'list' group inside LIST wrapperr but got: " + rootWrapperType); } GroupType listType = rootWrapperType.getType("list").asGroupType(); if (!listType.containsField("element")) { throw new ParquetDecodingException("Expected 'element' inside repeated list group but got: " + listType); } Type elementType = listType.getType("element"); converter = newMessageConverter(parentBuilder, fieldDescriptor, elementType); }
Source:
public boolean onNavigationItemSelected(MenuItem menuItem) { int itemId = menuItem.getItemId(); if (itemId == R.id.navigation_home) { switchFragment(new HomePagerFragment(), org); getSupportActionBar().setTitle(getString(R.string.app_name)); return true; } else if (itemId == R.id.navigation_gists) { switchFragment(new GistsPagerFragment(), null); getSupportActionBar().setTitle(getString(R.string.gists)); return true; } else if (itemId == R.id.navigation_issue_dashboard) { switchFragment(new IssueDashboardPagerFragment(), null); getSupportActionBar().setTitle(getString(R.string.issue_dashboard)); return true; } else if (itemId == R.id.navigation_bookmarks) { switchFragment(new FilterListFragment(), null); getSupportActionBar().setTitle(getString(R.string.bookmarks)); return true; } else if (itemId == R.id.navigation_log_out) { AccountManager accountManager = getAccountManager(); Account[] allGitHubAccounts = accountManager.getAccountsByType(getString(R.string.account_type)); for (Account account : allGitHubAccounts) { accountManager.removeAccount(account, null, null); } Intent in = new Intent(this, LoginActivity.class); in.addFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(in); finish(); return false; } else if (menuItemOrganizationMap.containsKey(menuItem)) { switchFragment(new HomePagerFragment(), menuItemOrganizationMap.get(menuItem)); navigationView.getMenu().findItem(R.id.navigation_home).setChecked(true); return false; } else { throw new IllegalStateException("MenuItem " + menuItem + " not known"); } }

Target:
public boolean onNavigationItemSelected(MenuItem menuItem) { int itemId = menuItem.getItemId(); if (itemId == R.id.navigation_home) { switchFragment(new HomePagerFragment(), org); getSupportActionBar().setTitle(getString(R.string.app_name)); return true; } else if (itemId == R.id.navigation_gists) { switchFragment(new GistsPagerFragment(), null); getSupportActionBar().setTitle(menuItem.getTitle()); return true; } else if (itemId == R.id.navigation_issue_dashboard) { switchFragment(new IssueDashboardPagerFragment(), null); getSupportActionBar().setTitle(menuItem.getTitle()); return true; } else if (itemId == R.id.navigation_bookmarks) { switchFragment(new FilterListFragment(), null); getSupportActionBar().setTitle(menuItem.getTitle()); return true; } else if (itemId == R.id.navigation_log_out) { AccountManager accountManager = getAccountManager(); Account[] allGitHubAccounts = accountManager.getAccountsByType(getString(R.string.account_type)); for (Account account : allGitHubAccounts) { accountManager.removeAccount(account, null, null); } Intent in = new Intent(this, LoginActivity.class); in.addFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(in); finish(); return false; } else if (menuItemOrganizationMap.containsKey(menuItem)) { switchFragment(new HomePagerFragment(), menuItemOrganizationMap.get(menuItem)); navigationView.getMenu().findItem(R.id.navigation_home).setChecked(true); return false; } else { throw new IllegalStateException("MenuItem " + menuItem + " not known"); } }
Source:
public void testElasticSearchHealthCheck() { final ApiClient webClient = getWebClient(USER_2_USERNAME, testingPostgres); ExtendedGa4GhApi extendedGa4GhApi = new ExtendedGa4GhApi(webClient); MetadataApi metadataApi = new MetadataApi(webClient); try { metadataApi.checkElasticSearch(); } catch (ApiException ex) { assertTrue("Should fail", true); } extendedGa4GhApi.toolsIndexGet(); waitForIndexRefresh(0, extendedGa4GhApi, 0); try { metadataApi.checkElasticSearch(); fail("Should fail even with index because there's no hits"); } catch (ApiException ex) { Assert.assertTrue(ex.getMessage().contains("Internal Server Error")); } WorkflowsApi workflowApi = new WorkflowsApi(webClient); workflowApi.manualRegister("github", "DockstoreTestUser2/dockstore_workflow_cnv", "/workflow/cnv.cwl", "", "cwl", "/test.json"); final Workflow workflowByPathGithub = workflowApi .getWorkflowByPath(WorkflowIT.DOCKSTORE_TEST_USER2_RELATIVE_IMPORTS_WORKFLOW, null, false); final Workflow workflow = workflowApi.refresh(workflowByPathGithub.getId(), false); workflowApi.publish(workflow.getId(), SwaggerUtility.createPublishRequest(true)); waitForIndexRefresh(1, extendedGa4GhApi, 0); try { metadataApi.checkElasticSearch(); } catch (ApiException ex) { fail("Should not fail"); } }

Target:
public void testElasticSearchHealthCheck() { final ApiClient webClient = getWebClient(USER_2_USERNAME, testingPostgres); ExtendedGa4GhApi extendedGa4GhApi = new ExtendedGa4GhApi(webClient); MetadataApi metadataApi = new MetadataApi(webClient); try { metadataApi.checkElasticSearch(); } catch (ApiException ex) { assertTrue("Should fail", true); } extendedGa4GhApi.toolsIndexGet(); waitForIndexRefresh(0, extendedGa4GhApi, 0); try { metadataApi.checkElasticSearch(); fail("Should fail even with index because there's no hits"); } catch (ApiException ex) { assertTrue(ex.getMessage().contains("Internal Server Error")); } WorkflowsApi workflowApi = new WorkflowsApi(webClient); workflowApi.manualRegister("github", "DockstoreTestUser2/dockstore_workflow_cnv", "/workflow/cnv.cwl", "", "cwl", "/test.json"); final Workflow workflowByPathGithub = workflowApi .getWorkflowByPath(WorkflowIT.DOCKSTORE_TEST_USER2_RELATIVE_IMPORTS_WORKFLOW, null, false); final Workflow workflow = workflowApi.refresh(workflowByPathGithub.getId(), false); workflowApi.publish(workflow.getId(), SwaggerUtility.createPublishRequest(true)); waitForIndexRefresh(1, extendedGa4GhApi, 0); try { metadataApi.checkElasticSearch(); } catch (ApiException ex) { fail("Should not fail"); } }
Source:
public boolean isReadOnly() { boolean readonly = false; IProxyRepositoryFactory repFactory = ProxyRepositoryFactory.getInstance(); ERepositoryStatus status = repFactory.getStatus(getSelectedRepositoryNode().getObject()); if (status == ERepositoryStatus.LOCK_BY_OTHER || status == ERepositoryStatus.LOCK_BY_USER) { readonly = true; } return readonly; }

Target:
public boolean isReadOnly() { boolean readonly = false; IProxyRepositoryFactory repFactory = ProxyRepositoryFactory.getInstance(); RepositoryNode selectedRepositoryNode = getSelectedRepositoryNode(); ERepositoryStatus status = repFactory.getStatus(selectedRepositoryNode.getObject()); Item item = selectedRepositoryNode.getObject().getProperty().getItem(); ICoreService coreService = (ICoreService) GlobalServiceRegister.getDefault().getService(ICoreService.class); boolean isOpened = coreService.isOpenedItemInEditor(selectedRepositoryNode.getObject()); boolean mainProject = ProjectManager.getInstance().isInCurrentMainProject(selectedRepositoryNode); boolean isSysRoutine = false; if (item instanceof RoutineItem) { if (((RoutineItem) item).isBuiltIn()) { isSysRoutine = true; } } boolean userReadOnlyOnCurrentProject = repFactory.isUserReadOnlyOnCurrentProject(); boolean isOffline = getRepositoryContext().isOffline(); if (isOnTag() || userReadOnlyOnCurrentProject || (isOffline && isOpened) || isSysRoutine || !mainProject || (!isOffline && (status == ERepositoryStatus.LOCK_BY_OTHER || status == ERepositoryStatus.LOCK_BY_USER))) { readonly = true; } return readonly; }
Source:
public void testIsInEuropeanUnion() throws Exception { DatabaseReader reader = new DatabaseReader.Builder(this.geoipFile) .build(); CityResponse city = reader.city(InetAddress.getByName("89.160.20.128")); assertEquals(true, city.getCountry().isInEuropeanUnion()); assertEquals(true, city.getRegisteredCountry().isInEuropeanUnion()); }

Target:
public void testIsInEuropeanUnion() throws Exception { DatabaseReader reader = new DatabaseReader.Builder(this.geoipFile) .build(); CityResponse city = reader.city(InetAddress.getByName("89.160.20.128")); assertTrue(city.getCountry().isInEuropeanUnion()); assertTrue(city.getRegisteredCountry().isInEuropeanUnion()); }
Source:
public Boolean getRootCause() { return rootCause; }

Target:
public boolean getRootCause() { return rootCause; }
Source:
public static void main(String[] args) throws Exception { ArgP argp = new ArgP(); CliOptions.addCommon(argp); CliOptions.addAutoMetricFlag(argp); args = CliOptions.parse(argp, args); if (args == null) { usage(argp, 1); } else if (args.length < 1) { usage(argp, 2); } Config config = CliOptions.getConfig(argp); final TSDB tsdb = new TSDB(config); tsdb.getClient().ensureTableExists( config.getString("tsd.storage.hbase.data_table")).joinUninterruptibly(); tsdb.getClient().ensureTableExists( config.getString("tsd.storage.hbase.uid_table")).joinUninterruptibly(); argp = null; try { int points = 0; final long start_time = System.nanoTime(); for (final String path : args) { points += importFile(tsdb.getClient(), tsdb, path); } final double time_delta = (System.nanoTime() - start_time) / 1000000000.0; LOG.info(String.format("Total: imported %d data points in %.3fs" + " (%.1f points/s)", points, time_delta, (points / time_delta))); tsdb.collectStats(new StatsCollector("tsd") { @Override public final void emit(final String line) { System.err.print(line); } }); } finally { try { tsdb.shutdown().joinUninterruptibly(); } catch (Exception e) { LOG.error("Unexpected exception", e); System.exit(1); } } }

Target:
public static void main(String[] args) throws Exception { ArgP argp = new ArgP(); CliOptions.addCommon(argp); CliOptions.addAutoMetricFlag(argp); args = CliOptions.parse(argp, args); if (args == null) { usage(argp, 1); } else if (args.length < 1) { usage(argp, 2); } Config config = CliOptions.getConfig(argp); final TSDB tsdb = new TSDB(config); tsdb.checkNecessaryTablesExist().joinUninterruptibly(); argp = null; try { int points = 0; final long start_time = System.nanoTime(); for (final String path : args) { points += importFile(tsdb.getClient(), tsdb, path); } final double time_delta = (System.nanoTime() - start_time) / 1000000000.0; LOG.info(String.format("Total: imported %d data points in %.3fs" + " (%.1f points/s)", points, time_delta, (points / time_delta))); tsdb.collectStats(new StatsCollector("tsd") { @Override public final void emit(final String line) { System.err.print(line); } }); } finally { try { tsdb.shutdown().joinUninterruptibly(); } catch (Exception e) { LOG.error("Unexpected exception", e); System.exit(1); } } }
Source:
public void loadState(final Configuration configuration, final Graph... graphs) { if (graphs.length != 1) { throw new IllegalStateException("Must provide one graph to use, received " + graphs.length); } Graph graph = graphs[0]; if (configuration.containsKey(INITIAL_RANK_TRAVERSAL)) this.initialRankTraversal = PureTraversal.loadState(configuration, INITIAL_RANK_TRAVERSAL, graph); if (configuration.containsKey(EDGE_TRAVERSAL)) { this.edgeTraversal = PureTraversal.loadState(configuration, EDGE_TRAVERSAL, graph); this.incidentMessageScope = MessageScope.Local.of(() -> this.edgeTraversal.get().clone()); this.countMessageScope = MessageScope.Local.of(new MessageScope.Local.ReverseTraversalSupplier(this.incidentMessageScope)); } this.vertexCountAsDouble = configuration.getDouble(VERTEX_COUNT, 1.0d); this.alpha = configuration.getDouble(ALPHA, 0.85d); this.totalIterations = configuration.getInt(TOTAL_ITERATIONS, 30); this.property = configuration.getString(PROPERTY, PAGE_RANK); this.vertexComputeKeys = new HashSet<>(Arrays.asList(VertexComputeKey.of(this.property, false), VertexComputeKey.of(EDGE_COUNT, true))); }

Target:
public void loadState(final Configuration configuration, final Graph... graphs) { if (graphs.length != 1) { throw new IllegalArgumentException("Must provide one graph to use, received " + graphs.length); } final Graph graph = graphs[0]; if (configuration.containsKey(INITIAL_RANK_TRAVERSAL)) this.initialRankTraversal = PureTraversal.loadState(configuration, INITIAL_RANK_TRAVERSAL, graph); if (configuration.containsKey(EDGE_TRAVERSAL)) { this.edgeTraversal = PureTraversal.loadState(configuration, EDGE_TRAVERSAL, graph); this.incidentMessageScope = MessageScope.Local.of(() -> this.edgeTraversal.get().clone()); this.countMessageScope = MessageScope.Local.of(new MessageScope.Local.ReverseTraversalSupplier(this.incidentMessageScope)); } this.vertexCountAsDouble = configuration.getDouble(VERTEX_COUNT, 1.0d); this.alpha = configuration.getDouble(ALPHA, 0.85d); this.totalIterations = configuration.getInt(TOTAL_ITERATIONS, 30); this.property = configuration.getString(PROPERTY, PAGE_RANK); this.vertexComputeKeys = new HashSet<>(Arrays.asList(VertexComputeKey.of(this.property, false), VertexComputeKey.of(EDGE_COUNT, true))); }
Source:
private void setWindowTitle(boolean pushMode) { final String title; if (pushMode) { title = UIText.RefSpecWizard_pushTitle; } else { title = UIText.RefSpecWizard_fetchTitle; } setWindowTitle(title); }

Target:
private void setWindowTitle(boolean pushMode) { final String title; if (pushMode) title = UIText.RefSpecWizard_pushTitle; else title = UIText.RefSpecWizard_fetchTitle; setWindowTitle(title); }
Source:
public Map<Object, Object> value(Object value) { Map<Object, Object> map = (Map<Object, Object>) value; if (map == null) { return map; } return new HashMap<>(map); }

Target:
public Map<Object, Object> value(Object value) { return (Map<Object, Object>) value; }
Source:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); if (!feedbackSession.isOpened()) { return new JsonResult("Reminder email could not be sent out " + "as the feedback session is not open for submissions.", HttpStatus.SC_BAD_REQUEST); } String usersToRemind = getNonNullRequestParamValue(Const.ParamsNames.SUBMISSION_REMIND_USERLIST); taskQueuer.scheduleFeedbackSessionRemindersForParticularUsers(courseId, feedbackSessionName, usersToRemind.split(","), userInfo.getId()); return new JsonResult("Reminders sent"); }

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); if (!feedbackSession.isOpened()) { return new JsonResult("Reminder email could not be sent out " + "as the feedback session is not open for submissions.", HttpStatus.SC_BAD_REQUEST); } FeedbackSessionStudentRemindRequest remindRequest = getAndValidateRequestBody(FeedbackSessionStudentRemindRequest.class); String[] usersToRemind = remindRequest.getUsersToRemind(); taskQueuer.scheduleFeedbackSessionRemindersForParticularUsers(courseId, feedbackSessionName, usersToRemind, userInfo.getId()); return new JsonResult("Reminders sent"); }
Source:
private void configureAsyncJobs() { bind(JobMessageDispatcher.class).to(ArtemisJobMessageDispatcher.class); bind(SchedulerFactory.class).to(StdSchedulerFactory.class); JobManager.registerJob(TestJob1.JOB_KEY, TestJob1.class); JobManager.registerJob(CRLUpdateJob.JOB_KEY, CRLUpdateJob.class); JobManager.registerJob(ExpiredPoolsCleanupJob.JOB_KEY, ExpiredPoolsCleanupJob.class); JobManager.registerJob(ExportJob.JOB_KEY, ExportJob.class); JobManager.registerJob(HypervisorUpdateJob.JOB_KEY, HypervisorUpdateJob.class); JobManager.registerJob(HypervisorHeartbeatUpdateJob.JOB_KEY, HypervisorHeartbeatUpdateJob.class); JobManager.registerJob(ImportJob.JOB_KEY, ImportJob.class); JobManager.registerJob(ImportRecordCleanerJob.JOB_KEY, ImportRecordCleanerJob.class); JobManager.registerJob(ManifestCleanerJob.JOB_KEY, ManifestCleanerJob.class); JobManager.registerJob(OrphanCleanupJob.JOB_KEY, OrphanCleanupJob.class); JobManager.registerJob(RefreshPoolsForProductJob.JOB_KEY, RefreshPoolsForProductJob.class); JobManager.registerJob(RefreshPoolsJob.JOB_KEY, RefreshPoolsJob.class); JobManager.registerJob(RegenEnvEntitlementCertsJob.JOB_KEY, RegenEnvEntitlementCertsJob.class); JobManager.registerJob(UndoImportsJob.JOB_KEY, UndoImportsJob.class); JobManager.registerJob(UnmappedGuestEntitlementCleanerJob.JOB_KEY, UnmappedGuestEntitlementCleanerJob.class); JobManager.registerJob(ActiveEntitlementJob.JOB_KEY, ActiveEntitlementJob.class); JobManager.registerJob(AsyncJobCleaner.JOB_KEY, AsyncJobCleaner.class); }

Target:
private void configureAsyncJobs() { bind(JobMessageDispatcher.class).to(ArtemisJobMessageDispatcher.class); bind(SchedulerFactory.class).to(StdSchedulerFactory.class); JobManager.registerJob(TestJob1.JOB_KEY, TestJob1.class); JobManager.registerJob(ActiveEntitlementJob.JOB_KEY, ActiveEntitlementJob.class); JobManager.registerJob(CRLUpdateJob.JOB_KEY, CRLUpdateJob.class); JobManager.registerJob(ExpiredPoolsCleanupJob.JOB_KEY, ExpiredPoolsCleanupJob.class); JobManager.registerJob(ExportJob.JOB_KEY, ExportJob.class); JobManager.registerJob(HypervisorUpdateJob.JOB_KEY, HypervisorUpdateJob.class); JobManager.registerJob(HypervisorHeartbeatUpdateJob.JOB_KEY, HypervisorHeartbeatUpdateJob.class); JobManager.registerJob(ImportJob.JOB_KEY, ImportJob.class); JobManager.registerJob(ImportRecordCleanerJob.JOB_KEY, ImportRecordCleanerJob.class); JobManager.registerJob(JobCleaner.JOB_KEY, JobCleaner.class); JobManager.registerJob(ManifestCleanerJob.JOB_KEY, ManifestCleanerJob.class); JobManager.registerJob(OrphanCleanupJob.JOB_KEY, OrphanCleanupJob.class); JobManager.registerJob(RefreshPoolsForProductJob.JOB_KEY, RefreshPoolsForProductJob.class); JobManager.registerJob(RefreshPoolsJob.JOB_KEY, RefreshPoolsJob.class); JobManager.registerJob(RegenEnvEntitlementCertsJob.JOB_KEY, RegenEnvEntitlementCertsJob.class); JobManager.registerJob(UndoImportsJob.JOB_KEY, UndoImportsJob.class); JobManager.registerJob(UnmappedGuestEntitlementCleanerJob.JOB_KEY, UnmappedGuestEntitlementCleanerJob.class); }
Source:
private void printWarning(CommandContext ctx, final ModelControllerClient client, final String name, final String content, final String deployment) throws CommandLineException { if (ctx.isDomainMode()) { for (String sgName : Util.getServerGroups(client)) { if (content == null && deployment != null) { ctx.printLine("WARNING: redeployment is required on deployment " + Arrays.asList(deployment.split(",+")) + " in server group " + sgName); } else { ModelNode linkResources = loadLinkResources(client, name, sgName); if (linkResources != null && !linkResources.keys().isEmpty()) { ctx.printLine("WARNING: redeployment is required on deployment " + linkResources.keys() + " in server group " + sgName); } } } } else { if (content == null && deployment != null) { ctx.printLine("WARNING: redeployment is required on deployment " + Arrays.asList(deployment.split(",+"))); } else { final ModelNode linkResources = loadLinkResources(client, name, null); if (linkResources != null && !linkResources.keys().isEmpty()) ctx.printLine("WARNING: redeployment is required on deployment " + linkResources.keys()); } } }

Target:
private void printWarning(CommandContext ctx, final ModelControllerClient client, final String name, final String content, final String deployment) throws CommandLineException { if (ctx.isDomainMode()) { for (String sgName : Util.getServerGroups(client)) { printWarningMessage(ctx, client, name, content, deployment, sgName); } } else { printWarningMessage(ctx, client, name, content, deployment, null); } }
Source:
public Resource getMaxShare() { Resource maxResource = maxShare.getResource(scheduler.getClusterResource()); if(Resources.greaterThan(scheduler.getResourceCalculator(), scheduler.getClusterResource(), minShare, maxResource)) { maxResource = minShare; } return maxResource; }

Target:
public Resource getMaxShare() { Resource maxResource = maxShare.getResource(scheduler.getClusterResource()); Resource result = Resources.componentwiseMax(maxResource, minShare); if (!Resources.equals(maxResource, result)) { LOG.warn(String.format("Queue %s has max resources %s less than " + "min resources %s", getName(), maxResource, minShare)); } return result; }
Source:
public ForceCloseLogSerializer(final SqlStorage<ForceCloseLogEntry> logStorage) { this.logStorage = logStorage; this.setPurger(new Purger() { @Override public void purge(final SortedIntSet IDs) { logStorage.removeAll(new EntityFilter<LogEntry>() { public int preFilter(int id, Hashtable<String, Object> metaData) { return IDs.contains(id) ? PREFILTER_INCLUDE : PREFILTER_EXCLUDE; } public boolean matches(LogEntry e) { throw new RuntimeException("can't happen"); } }); } }); }

Target:
public ForceCloseLogSerializer(final SqlStorage<ForceCloseLogEntry> logStorage) { this.logStorage = logStorage; this.setPurger(new AndroidLogPurger<>(logStorage)); }