auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void toggleNature(IProject project) throws CoreException { IProjectDescription description = project.getDescription(); String[] natures = description.getNatureIds(); for (int i = 0; i < natures.length; ++i) { if (SampleNature.NATURE_ID.equals(natures[i])) { String[] newNatures = new String[natures.length - 1]; System.arraycopy(natures, 0, newNatures, 0, i); System.arraycopy(natures, i + 1, newNatures, i, natures.length - i - 1); description.setNatureIds(newNatures); project.setDescription(description, null); return; } } String[] newNatures = new String[natures.length + 1]; System.arraycopy(natures, 0, newNatures, 0, natures.length); newNatures[natures.length] = SampleNature.NATURE_ID; description.setNatureIds(newNatures); project.setDescription(description, null); }

Target:
private void toggleNature(IProject project) throws CoreException { IProjectDescription description = project.getDescription(); String[] natures = description.getNatureIds(); for (int i = 0; i < natures.length; ++i) { if ($natureClassName$.NATURE_ID.equals(natures[i])) { String[] newNatures = new String[natures.length - 1]; System.arraycopy(natures, 0, newNatures, 0, i); System.arraycopy(natures, i + 1, newNatures, i, natures.length - i - 1); description.setNatureIds(newNatures); project.setDescription(description, null); return; } } String[] newNatures = new String[natures.length + 1]; System.arraycopy(natures, 0, newNatures, 0, natures.length); newNatures[natures.length] = $natureClassName$.NATURE_ID; description.setNatureIds(newNatures); project.setDescription(description, null); }
Source:
public void should_support_jcasc_from_yaml() throws Exception { URL configFileUrl = ConfigAsCodeTest.class.getResource(getClass().getSimpleName() + "/configuration-as-code.yml"); ConfigurationAsCode.get().configure(configFileUrl.toString()); StashNotifier.DescriptorImpl stashNotifierConfig = rule.jenkins.getDescriptorByType(StashNotifier.DescriptorImpl.class); assertThat(stashNotifierConfig.getCredentialsId(), equalTo("bitbucket-credentials")); assertThat(stashNotifierConfig.isIgnoreUnverifiedSsl(), equalTo(true)); assertThat(stashNotifierConfig.isIncludeBuildNumberInKey(), equalTo(true)); assertThat(stashNotifierConfig.getProjectKey(), equalTo("JEN")); assertThat(stashNotifierConfig.isPrependParentProjectKey(), equalTo(true)); assertThat(stashNotifierConfig.isDisableInprogressNotification(), equalTo(true)); assertThat(stashNotifierConfig.isConsiderUnstableAsSuccess(), equalTo(true)); }

Target:
public void should_support_jcasc_from_yaml() throws Exception { URL configFileUrl = ConfigAsCodeTest.class.getResource(getClass().getSimpleName() + "/configuration-as-code.yml"); ConfigurationAsCode.get().configure(configFileUrl.toString()); StashNotifier.DescriptorImpl stashNotifierConfig = rule.jenkins.getDescriptorByType(StashNotifier.DescriptorImpl.class); assertThat(stashNotifierConfig.isConsiderUnstableAsSuccess(), equalTo(true)); assertThat(stashNotifierConfig.getCredentialsId(), equalTo("bitbucket-credentials")); assertThat(stashNotifierConfig.isDisableInprogressNotification(), equalTo(true)); assertThat(stashNotifierConfig.isIgnoreUnverifiedSsl(), equalTo(true)); assertThat(stashNotifierConfig.isIncludeBuildNumberInKey(), equalTo(true)); assertThat(stashNotifierConfig.isPrependParentProjectKey(), equalTo(true)); assertThat(stashNotifierConfig.getProjectKey(), equalTo("JEN")); assertThat(stashNotifierConfig.getStashRootUrl(), equalTo("https://my.company.intranet/bitbucket")); }
Source:
protected void closeAllPreparedStatements() throws SQLException { for (Map.Entry<PreparedStatement, Integer> preparedStatementIntegerEntry : pStatements.entrySet()) { if (preparedStatementIntegerEntry.getValue() > 0) { preparedStatementIntegerEntry.getKey().executeBatch(); } preparedStatementIntegerEntry.getKey().close(); } }

Target:
protected void closeAllPreparedStatements() throws SQLException { for (PreparedStatement p : pStatements.keySet()) { if (pStatements.get(p) > 0) { p.executeBatch(); } p.close(); } }
Source:
public boolean matches(AllocationAttempt attempt, AllocationCandidate candidate) { Set<Long> hostIds = candidate.getHosts(); for (Long hostId : hostIds) { boolean oneGood = false; CacheManager cm = CacheManager.getCacheManagerInstance(this.objectManager); HostInfo hostInfo = cm.getHostInfo(hostId); oneGood = checkDiskSize(cm, hostInfo, attempt.getInstanceId()); if (!oneGood) { log.debug("Scheduling instance to host rejected", attempt.getInstanceId(), hostId); return false; } } return true; }

Target:
public boolean matches(AllocationAttempt attempt, AllocationCandidate candidate) { Instance instance = attempt.getInstance(); if (instance == null) { return false; } Set<Long> hostIds = candidate.getHosts(); for (Long hostId : hostIds) { Map<Pair<String, Long>, DiskInfo> volumeToDiskMapping = AllocatorUtils.allocateDiskForVolumes(hostId, instance, this.objectManager); if (volumeToDiskMapping == null) { log.debug("Scheduling instance to host rejected", attempt.getInstanceId(), hostId); return false; } } return true; }
Source:
private String writeFBParameterRequest(final String Dst, final String value) { return MessageFormat.format(DeploymentExecutor.WRITE_PARAMTER, this.reqID++, value, Dst); }

Target:
private String writeFBParameterRequest(final String Dst, final String value) { return MessageFormat.format(DeploymentExecutor.WRITE_PARAMETER, this.reqID++, value, Dst); }
Source:
public int callJavaUserDefinedAggregateCombine() { UserDefinedAggregateFunctionRunner udafRunner = getUdafRunner(); int udafIndex = m_udfBuffer.getInt(); Object workerObject = null; try { assert(udafRunner != null); byte[] workerByteArray = UserDefinedAggregateFunctionRunner.readVarbinary(m_udfBuffer); ByteArrayInputStream bis = new ByteArrayInputStream(workerByteArray); ObjectInput in = new UDAFObjectInputStream(bis); try { workerObject = in.readObject(); } finally { try { in.close(); } catch (IOException ex) } udafRunner.combine(workerObject, udafIndex); m_udfBuffer.clear(); return 0; } catch (InvocationTargetException ex1) { handleUDAFError(ex1.getCause()); } catch (Throwable ex2) { handleUDAFError(ex2); } return -1; }

Target:
public int callJavaUserDefinedAggregateCombine() { UserDefinedAggregateFunctionRunner udafRunner = getUdafRunner(); int udafIndex = m_udfBuffer.getInt(); Object workerObject = null; try { assert(udafRunner != null); byte[] workerByteArray = UserDefinedAggregateFunctionRunner.readVarbinary(m_udfBuffer); ByteArrayInputStream bis = new ByteArrayInputStream(workerByteArray); ObjectInput in = new UDAFObjectInputStream(bis); try { workerObject = in.readObject(); } finally { try { in.close(); } catch (IOException exIgnored) } udafRunner.combine(workerObject, udafIndex); m_udfBuffer.clear(); return 0; } catch (InvocationTargetException ex1) { handleUDAFError(ex1.getCause()); } catch (Throwable ex2) { handleUDAFError(ex2); } return -1; }
Source:
public RowExpression rewriteCall(CallExpression node, Boolean isRoot, RowExpressionTreeRewriter<Boolean> treeRewriter) { if (BooleanType.BOOLEAN.equals(node.getType()) && functionResolution.isNotFunction(node.getFunctionHandle())) { return rewriteBooleanExpression(node, isRoot); } if (isRoot) { return treeRewriter.rewrite(node, false); } return null; }

Target:
public RowExpression rewriteCall(CallExpression node, Boolean isRoot, RowExpressionTreeRewriter<Boolean> treeRewriter) { if (functionResolution.isNotFunction(node.getFunctionHandle())) { checkState(BooleanType.BOOLEAN.equals(node.getType()), "NOT must be boolean function"); return rewriteBooleanExpression(node, isRoot); } if (isRoot) { return treeRewriter.rewrite(node, false); } return null; }
Source:
default String getTypeName() { return this.getClass().getSimpleName(); }

Target:
default String getTypeName() { throw new UnsupportedOperationException(); }
Source:
public UpdateMetrics parse(ContentResponse entity) { String content = entity.getContentAsString(); UpdateMetrics.Builder builder = UpdateMetrics.builder(); String[] split = content.split("\\r?\\n"); for (String line : split) { passMetrics(line, builder); } UpdateMetrics updateMetrics = builder.build(); log.debug(updateMetrics.toString()); return updateMetrics; }

Target:
public UpdateMetrics parse(ContentResponse entity) { String content = entity.getContentAsString(); String[] lines = content.split("\\r?\\n"); UpdateMetrics updateMetrics = extractMetrics(lines); log.debug("{}", updateMetrics); return updateMetrics; }
Source:
public void AutoCompleteTest() throws Exception { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new AutoComplete(), conf); LocalMode.Controller lc = lma.getController(); long start = System.currentTimeMillis(); lc.run(200000); long end = System.currentTimeMillis(); long time = end - start; logger.info("Test used " + time + " ms"); }

Target:
public void AutoCompleteTest() throws Exception { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new AutoComplete(), conf); LocalMode.Controller lc = lma.getController(); ((StramLocalCluster)lc).setExitCondition(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return AutoComplete.TweetsInput.isDone(); } }); lc.run(200000); Assert.assertTrue(AutoComplete.Collector.getResult().containsKey("chi")); Assert.assertTrue(AutoComplete.Collector.getResult().containsKey("china")); Assert.assertEquals(2, AutoComplete.Collector.getResult().get("china").get(0).getCount()); Assert.assertEquals("China", AutoComplete.Collector.getResult().get("china").get(0).getValue()); Assert.assertEquals(2, AutoComplete.Collector.getResult().get("d").size()); Assert.assertEquals(3, AutoComplete.Collector.getResult().get("f").size()); Assert.assertTrue(AutoComplete.Collector.getResult().get("f").get(0).getCount() >= AutoComplete.Collector.getResult().get("f").get(1).getCount()); Assert.assertTrue(AutoComplete.Collector.getResult().get("f").get(1).getCount() >= AutoComplete.Collector.getResult().get("f").get(2).getCount()); }
Source:
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException { assert state instanceof GoTestRunningState; GoTestRunningState runningState = (GoTestRunningState)state; GoTestRunConfiguration runConfiguration = ObjectUtils.tryCast(environment.getRunProfile(), GoTestRunConfiguration.class); if (runConfiguration == null) { return null; } FileDocumentManager.getInstance().saveAllDocuments(); CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(runConfiguration); CoveragePatcher runningStatePatcher = new CoveragePatcher(coverageEnabledConfiguration, runConfiguration); runningState.setPatcher(runningStatePatcher); if (runConfiguration.getKind() == GoTestRunConfiguration.Kind.DIRECTORY && !runningStatePatcher.hasPackageCoverageExecutable()) { promptForPackageCoverageTool(runConfiguration); } ExecutionResult executionResult = state.execute(environment.getExecutor(), this); if (executionResult == null) { return null; } executionResult.getProcessHandler().addProcessListener(new GoCoverageProcessListener( runConfiguration.getDirectoryPath(), coverageEnabledConfiguration.getCoverageFilePath())); CoverageHelper.attachToProcess(runConfiguration, executionResult.getProcessHandler(), environment.getRunnerSettings()); return new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse()); }

Target:
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException { assert state instanceof GoTestRunningState; GoTestRunningState runningState = (GoTestRunningState)state; GoTestRunConfiguration runConfiguration = ObjectUtils.tryCast(environment.getRunProfile(), GoTestRunConfiguration.class); if (runConfiguration == null) { return null; } FileDocumentManager.getInstance().saveAllDocuments(); CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(runConfiguration); CoveragePatcher runningStatePatcher = new CoveragePatcher(coverageEnabledConfiguration, runConfiguration); runningState.setPatcher(runningStatePatcher); if (runConfiguration.getKind() == GoTestRunConfiguration.Kind.DIRECTORY && !runningStatePatcher.hasPackageCoverageExecutable()) { promptForPackageCoverageTool(runConfiguration); } ExecutionResult executionResult = state.execute(environment.getExecutor(), this); if (executionResult == null) { return null; } CoverageHelper.attachToProcess(runConfiguration, executionResult.getProcessHandler(), environment.getRunnerSettings()); return new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse()); }
Source:
public void init() { getParameters().setUseCinderCommandCallback(isCinderDisksExist()); getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VM, getVmId())); setSnapshotName(getParameters().getDescription()); setStoragePoolId(getVm() != null ? getVm().getStoragePoolId() : null); }

Target:
public void init() { getParameters().setUseCinderCommandCallback(diskOfTypeExists(DiskStorageType.CINDER)); getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VM, getVmId())); setSnapshotName(getParameters().getDescription()); setStoragePoolId(getVm() != null ? getVm().getStoragePoolId() : null); }
Source:
private static long[][] serializeEmcData() { long[][] ret = new long[EMCMapper.emc.size()][]; int i = 0; for (Map.Entry<SimpleStack, Long> entry : EMCMapper.emc.entrySet()) { SimpleStack stack = entry.getKey(); int id = Item.REGISTRY.getIDForObject(Item.REGISTRY.getObject(stack.id)); ret[i] = new long[] { id, stack.damage, entry.getValue() }; i++; } PECore.debugLog("EMC data size: bytes", ret.length * 3 * 4); return ret; }

Target:
private static EmcPKTInfo[] serializeEmcData() { EmcPKTInfo[] ret = new EmcPKTInfo[EMCMapper.emc.size()]; int i = 0; for (Map.Entry<SimpleStack, Long> entry : EMCMapper.emc.entrySet()) { SimpleStack stack = entry.getKey(); int id = Item.REGISTRY.getIDForObject(Item.REGISTRY.getObject(stack.id)); ret[i] = new EmcPKTInfo(id, stack.damage, entry.getValue()); i++; } PECore.debugLog("EMC data size: bytes", ret.length * (2 * 4 + 8)); return ret; }
Source:
private TypeSystemImpl readDKProHeader(BufferedInputStream bis, byte[] header, TypeSystemImpl ts) { if (Arrays.equals(header, DKPRO_HEADER)) { getLogger().debug("Found DKPro-Core-style embedded type system"); ObjectInputStream ois; try { ois = new ObjectInputStream(bis); CASMgrSerializer casMgr = (CASMgrSerializer) ois.readObject(); if (ts == null) { ts = casMgr.getTypeSystem(); ts.commit(); } } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } else { try { bis.reset(); } catch (IOException e) { e.printStackTrace(); } } return ts; }

Target:
private TypeSystemImpl readDKProHeader(BufferedInputStream bis, byte[] header, TypeSystemImpl ts) throws CollectionException { getLogger().debug("Found DKPro-Core-style embedded type system"); ObjectInputStream ois; try { ois = new ObjectInputStream(bis); CASMgrSerializer casMgr = (CASMgrSerializer) ois.readObject(); if (ts == null) { ts = casMgr.getTypeSystem(); ts.commit(); } } catch (IOException | ClassNotFoundException e) { throw new CollectionException(e); } return ts; }
Source:
public void search_shouldReturnEmptySearchResultIfTitleDoesNotExist() throws Exception { request.setParameter(MrrtReportTemplateSearchHandler.REQUEST_PARAM_TITLE, NON_EXISTING_TITLE); requestContext.setRequest(request); PageableResult pageableResult = mrrtReportTemplateSearchHandler.search(requestContext); assertThat(pageableResult, is(instanceOf(EmptySearchResult.class))); }

Target:
public void search_shouldReturnEmptySearchResultIfTitleDoesNotExist() throws Exception { request.setParameter(MrrtReportTemplateSearchHandler.REQUEST_PARAM_TITLE, NON_EXISTING_TITLE); PageableResult pageableResult = mrrtReportTemplateSearchHandler.search(requestContext); assertThat(pageableResult, is(instanceOf(EmptySearchResult.class))); }
Source:
protected void executeSave() { boolean addOnProvider = getExport().getEntity(); IFrontendActionAsyncCallback addNetworkCallback = addNetworkCallback(addOnProvider); final AddNetworkStoragePoolParameters parameters = new AddNetworkStoragePoolParameters(getSelectedDc().getId(), getNetwork()); parameters.setVnicProfileRequired(false); if (addOnProvider) { Provider externalProvider = getExternalProviders().getSelectedItem(); ProviderNetwork providerNetwork = new ProviderNetwork(); providerNetwork.setProviderId(externalProvider.getId()); getNetwork().setProvidedBy(providerNetwork); Frontend.getInstance().runAction(VdcActionType.AddNetworkOnProvider, parameters, addNetworkCallback, null); } else { Frontend.getInstance().runAction(VdcActionType.AddNetwork, parameters, addNetworkCallback, null); } }

Target:
protected void executeSave() { final AddNetworkStoragePoolParameters parameters = new AddNetworkStoragePoolParameters(getSelectedDc().getId(), getNetwork()); parameters.setVnicProfileRequired(false); if (getExport().getEntity()) { Provider externalProvider = getExternalProviders().getSelectedItem(); ProviderNetwork providerNetwork = new ProviderNetwork(); providerNetwork.setProviderId(externalProvider.getId()); getNetwork().setProvidedBy(providerNetwork); Frontend.getInstance().runAction(VdcActionType.AddNetworkOnProvider, parameters, addNetworkOnProviderCallback(), null); } else { Frontend.getInstance().runAction(VdcActionType.AddNetwork, parameters, addNetworkCallback(), null); } }
Source:
public void onEvent(NetworkConnectivityChangeEvent event) { if (!NetworkUtil.isConnected(getContext())) { if (getActivity() instanceof SnackbarStatusListener && getUserVisibleHint()) { ((SnackbarStatusListener) getActivity()).resetSnackbarVisibility(authWebView.isShowingError()); } } }

Target:
public void onEvent(NetworkConnectivityChangeEvent event) { CourseTabsUtils.onNetworkConnectivityChangeEvent(getActivity(), getUserVisibleHint(), authWebView.isShowingError()); }
Source:
protected void after() throws Exception { }

Target:
protected void after() throws Throwable { }
Source:
public Memo explore(PlanNode plan, Session session, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { Memo memo = new Memo(idAllocator, plan); Lookup lookup = Lookup.from(planNode -> ImmutableList.of(memo.resolve(planNode))); Matcher matcher = new PlanNodeMatcher(lookup); Duration timeout = SystemSessionProperties.getOptimizerTimeout(session); Context context = new Context(memo, lookup, idAllocator, symbolAllocator, System.nanoTime(), timeout.toMillis(), session); exploreGroup(memo.getRootGroup(), context, matcher); return memo; }

Target:
public Memo explore(PlanNode plan, Session session, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { Memo memo = new Memo(idAllocator, plan); Lookup lookup = memo.getLookup(); Matcher matcher = new PlanNodeMatcher(lookup); Duration timeout = SystemSessionProperties.getOptimizerTimeout(session); Context context = new Context(memo, lookup, idAllocator, symbolAllocator, System.nanoTime(), timeout.toMillis(), session); exploreGroup(memo.getRootGroup(), context, matcher); return memo; }
Source:
private void filterListForCurrentText() { String text = mTagsEditText.getText().toString(); int endIndex = text.lastIndexOf(","); if (endIndex == -1) { mAdapter.filter(text); } else { String textToFilter = text.substring(endIndex + 1); mAdapter.filter(textToFilter); } }

Target:
private void filterListForCurrentText() { String text = mTagsEditText.getText().toString(); int endIndex = text.lastIndexOf(","); if (endIndex == -1) { mAdapter.filter(text); } else { String textToFilter = text.substring(endIndex + 1).trim(); mAdapter.filter(textToFilter); } }
Source:
public void testFlow() { final OaiPmhOpener opener = new OaiPmhOpener(); opener.setDateFrom("2013-08-11"); opener.setDateUntil("2013-08-12"); opener.setMetadataPrefix("PicaPlus-xml"); opener.setSetSpec("bib"); final XmlDecoder xmldecoder = new XmlDecoder(); final PicaXmlHandler handler = new PicaXmlHandler(); final Metamorph metamorph = new Metamorph("morph_zdb-isil-file-pica2ld.xml"); final PipeLobidOrganisationEnrichment enrich = new PipeLobidOrganisationEnrichment(); enrich.setGeonameFilename("geonames_DE_sample.csv"); enrich.doApiLookup = false; enrich.setSerialization("TURTLE"); final ObjectWriter<String> writer = new ObjectWriter<String>( "update_zdb-isil-file2lobid-organisations1.ttl"); opener.setReceiver(xmldecoder); xmldecoder.setReceiver(handler); handler.setReceiver(metamorph); metamorph.setReceiver(enrich); enrich.setReceiver(writer); opener.process("<LINK_0>"); opener.closeStream(); }

Target:
public void testFlow() { final OaiPmhOpener opener = new OaiPmhOpener(); opener.setDateFrom("2013-08-11"); opener.setDateUntil("2013-08-12"); opener.setMetadataPrefix("PicaPlus-xml"); opener.setSetSpec("bib"); final XmlDecoder xmlDecoder = new XmlDecoder(); final PicaXmlHandler handler = new PicaXmlHandler(); final Metamorph metamorph = new Metamorph("morph_zdb-isil-file-pica2ld.xml"); final PipeLobidOrganisationEnrichment enrich = new PipeLobidOrganisationEnrichment(); enrich.setGeonameFilename("geonames_DE_sample.csv"); enrich.doApiLookup = false; enrich.setSerialization("TURTLE"); final ObjectWriter<String> writer = new ObjectWriter<String>( "update_zdb-isil-file2lobid-organisations1.ttl"); opener.setReceiver(xmlDecoder); xmlDecoder.setReceiver(handler); handler.setReceiver(metamorph); metamorph.setReceiver(enrich); enrich.setReceiver(writer); opener.process("<LINK_0>"); opener.closeStream(); }
Source:
public void run() { final VoltDBInterface voltdb = VoltDB.instance(); if (voltdb.getMode() == OperationMode.PAUSED) { return; } ClientInterface cl = voltdb.getClientInterface(); if (!canceled.get() && cl != null && cl.isAcceptingConnections()) { TimeToLive ttl = ttlRef.get(); cl.runTimeToLive(ttl.getTtlcolumn().getName(), transformValue(ttl), CHUNK_SIZE, TIMEOUT, this); } }

Target:
public void run() { final VoltDBInterface voltdb = VoltDB.instance(); if (voltdb.getMode() != OperationMode.RUNNING) { return; } ClientInterface cl = voltdb.getClientInterface(); if (!canceled.get() && cl != null && cl.isAcceptingConnections()) { TimeToLive ttl = ttlRef.get(); cl.runTimeToLive(ttl.getTtlcolumn().getName(), transformValue(ttl), CHUNK_SIZE, TIMEOUT, this); } }
Source:
public void encodeCollectionLink(String link, HierarchicalStreamWriter writer) { String path = request.getRequestURI(); if (path.contains("script")) { try { link = URLDecoder.decode(link, "UTF-8"); encodeAlternateAtomLinkNoExt(link, writer); writer.addAttribute("type", getMediaType()); writer.endNode(); } catch (UnsupportedEncodingException e) { } } else { encodeAlternateAtomLink(link, writer); } }

Target:
public void encodeCollectionLink(String link, HierarchicalStreamWriter writer) { if (checkPath(request)) { try { link = URLDecoder.decode(link, "UTF-8"); encodeAlternateAtomLinkNoExt(link, writer); writer.addAttribute("type", getMediaType()); writer.endNode(); } catch (UnsupportedEncodingException e) { } } else { encodeAlternateAtomLink(link, writer); } }
Source:
public ImageDescriptor getImageDescriptorForProgram(String extension) { ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(extension); if (imageDescriptor == null && extension != null) { Program program = ProgramFinder.findProgram(extension.toLowerCase()); if (program == null || program.getImageData() == null) { } else { imageDescriptor = ImageDescriptor.createFromImageData(program.getImageData()); getImageRegistry().put(extension, imageDescriptor); } } return imageDescriptor; }

Target:
public ImageDescriptor getImageDescriptorForProgram(String extension) { ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(extension); if (imageDescriptor == null && extension != null) { Program program = ProgramFinder.findProgram(extension); if (program == null || program.getImageData() == null) { } else { imageDescriptor = ImageDescriptor.createFromImageData(program.getImageData()); getImageRegistry().put(extension, imageDescriptor); } } return imageDescriptor; }
Source:
private ResultScanner<Row> streamRows(ReadRowsRequest request) { PooledChannel reservedChannel = channelPool.reserveChannel(); final ClientCall<ReadRowsRequest, ReadRowsResponse> readRowsCall = reservedChannel.newCall(BigtableServiceGrpc.METHOD_READ_ROWS, CallOptions.DEFAULT); CancellationToken cancellationToken = new CancellationToken(); cancellationToken.addListener(new Runnable() { @Override public void run() { readRowsCall.cancel(); } }, executorService); int bufferCapacity = retryOptions.getStreamingBufferSize(); int timeout = retryOptions.getReadPartialRowTimeoutMillis(); ResponseQueueReader responseQueueReader = new ResponseQueueReader(timeout, readRowsCall); StreamingBigtableResultScanner resultScanner = new StreamingBigtableResultScanner(reservedChannel, responseQueueReader, cancellationToken); clientCallService.asyncServerStreamingCall( readRowsCall, request, bufferCapacity, createClientCallListener(resultScanner)); return resultScanner; }

Target:
private ResultScanner<Row> streamRows(ReadRowsRequest request) { PooledChannel reservedChannel = channelPool.reserveChannel(); final ClientCall<ReadRowsRequest, ReadRowsResponse> readRowsCall = reservedChannel.newCall(BigtableServiceGrpc.METHOD_READ_ROWS, CallOptions.DEFAULT); CancellationToken cancellationToken = new CancellationToken(); cancellationToken.addListener(new Runnable() { @Override public void run() { readRowsCall.cancel(); } }, executorService); int timeout = retryOptions.getReadPartialRowTimeoutMillis(); int streamingBufferSize = retryOptions.getStreamingBufferSize(); int batchRequestSize = streamingBufferSize / 2; ResponseQueueReader responseQueueReader = new ResponseQueueReader(timeout, streamingBufferSize, batchRequestSize, batchRequestSize, readRowsCall); StreamingBigtableResultScanner resultScanner = new StreamingBigtableResultScanner(reservedChannel, responseQueueReader, cancellationToken); clientCallService.asyncServerStreamingCall( readRowsCall, request, batchRequestSize, createClientCallListener(resultScanner)); return resultScanner; }
Source:
private boolean rootResourceDirsEqual( Collection<String> currentRootResourceDirs, Collection<String> newRootResourceDirs) { return (currentRootResourceDirs.size() == newRootResourceDirs.size()) && newRootResourceDirs.containsAll(currentRootResourceDirs); }

Target:
private boolean rootResourceDirsEqual( Collection<String> currentRootResourceDirs, Collection<String> newRootResourceDirs) { return (currentRootResourceDirs != null) && (currentRootResourceDirs.size() == newRootResourceDirs.size()) && newRootResourceDirs.containsAll(currentRootResourceDirs); }
Source:
public LocalStackContainer(String version) { super(TestcontainersConfiguration.getInstance().getLocalStackImage().split(":")[0] + ":" + version); withFileSystemBind(" waitingFor(Wait.forLogMessage(".*Ready\\.\n", 1)); }

Target:
public LocalStackContainer(String version) { super("localstack/localstack:" + version); sharedSetup(); }
Source:
public static final BundleContext getBundleContext() { if (bundleContext == null) { throw new NullPointerException("There is no bundle context"); } return bundleContext; }

Target:
public static final BundleContext getBundleContext() { if (bundleContext == null) { throw new IllegalStateException("There is no bundle context"); } return bundleContext; }
Source:
protected AbstractDataCommand(Object key, long flagsBitSet) { this.key = key; setFlagsBitSet(flagsBitSet); }

Target:
protected AbstractDataCommand(Object key, long flagsBitSet) { this.key = key; this.flags = flagsBitSet; }
Source:
private void makeLocationQualified(Database database) throws HiveException { if (database.isSetLocationUri()) { database.setLocationUri(Utilities.getQualifiedPath(conf, new Path(database.getLocationUri()))); } else { Path path = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.METASTOREWAREHOUSE), database.getName().toLowerCase() + DATABASE_PATH_SUFFIX); String qualifiedPath = Utilities.getQualifiedPath(conf, path); database.setLocationUri(qualifiedPath); } }

Target:
private void makeLocationQualified(Database database) throws HiveException { if (database.isSetLocationUri()) { database.setLocationUri(Utilities.getQualifiedPath(context.getConf(), new Path(database.getLocationUri()))); } else { Path path = new Path(HiveConf.getVar(context.getConf(), HiveConf.ConfVars.METASTOREWAREHOUSE), database.getName().toLowerCase() + DATABASE_PATH_SUFFIX); String qualifiedPath = Utilities.getQualifiedPath(context.getConf(), path); database.setLocationUri(qualifiedPath); } }
Source:
private void afterVMsRefreshTreatment() { for (Guid vm_guid : _vmsToRerun) { log.errorFormat("Rerun vm {0}. Called from vds {1}", vm_guid, _vds.getName()); ResourceManager.getInstance().RerunFailedCommand(vm_guid, _vds.getId()); } for (Guid vm_guid : _succededToRunVms) { _vdsManager.succededToRunVm(vm_guid); } _autoVmsToRun.removeAll(_vmsToRerun); getVdsEventListener().runFailedAutoStartVMs(_autoVmsToRun); for (Entry<VM, VmDynamic> pair : _vmsClientIpChanged.entrySet()) { getVdsEventListener().processOnClientIpChange(_vds, pair.getValue().getId()); } for (VmDynamic runningVm : _poweringUpVms) { ResourceManager .getInstance() .getEventListener() .processOnVmPoweringUp(_vds.getId(), runningVm.getId(), runningVm.getDisplayIp(), runningVm.getDisplay()); } for (Guid vm_guid : _vmsMovedToDown) { getVdsEventListener().processOnVmStop(vm_guid); } for (Guid vm_guid : _vmsToRemoveFromAsync) { ResourceManager.getInstance().RemoveAsyncRunningVm(vm_guid); } }

Target:
private void afterVMsRefreshTreatment() { for (Guid vm_guid : _vmsToRerun) { log.errorFormat("Rerun vm {0}. Called from vds {1}", vm_guid, _vds.getName()); ResourceManager.getInstance().RerunFailedCommand(vm_guid, _vds.getId()); } for (Guid vm_guid : _succededToRunVms) { _vdsManager.succededToRunVm(vm_guid); } _autoVmsToRun.removeAll(_vmsToRerun); getVdsEventListener().runFailedAutoStartVMs(_autoVmsToRun); for (Entry<VM, VmDynamic> pair : _vmsClientIpChanged.entrySet()) { getVdsEventListener().processOnClientIpChange(_vds, pair.getValue().getId()); } for (VmDynamic runningVm : _poweringUpVms) { ResourceManager .getInstance() .getEventListener() .processOnVmPoweringUp(_vds.getId(), runningVm.getId(), runningVm.getDisplayIp(), runningVm.getDisplay()); } getVdsEventListener().processOnVmStop(_vmsMovedToDown); for (Guid vm_guid : _vmsToRemoveFromAsync) { ResourceManager.getInstance().RemoveAsyncRunningVm(vm_guid); } }
Source:
public List<T> executeAsBlocking() { final GetResolver<T> getResolver; if (explicitGetResolver != null) { getResolver = explicitGetResolver; } else { final ContentResolverTypeMapping<T> typeMapping = storIOContentResolver.internal().typeMapping(type); if (typeMapping == null) { throw new IllegalStateException("This type does not have type mapping: " + "type = " + type + "," + "ContentProvider was not affected by this operation, please add type mapping for this type"); } getResolver = typeMapping.getResolver(); } final Cursor cursor = getResolver.performGet(storIOContentResolver, query); try { final int count = cursor.getCount(); if (count == 0) { return EMPTY_LIST; } else { final List<T> list = new ArrayList<T>(count); while (cursor.moveToNext()) { list.add(getResolver.mapFromCursor(cursor)); } return unmodifiableList(list); } } finally { cursor.close(); } }

Target:
public List<T> executeAsBlocking() { final GetResolver<T> getResolver; if (explicitGetResolver != null) { getResolver = explicitGetResolver; } else { final ContentResolverTypeMapping<T> typeMapping = storIOContentResolver.internal().typeMapping(type); if (typeMapping == null) { throw new IllegalStateException("This type does not have type mapping: " + "type = " + type + "," + "ContentProvider was not touched by this operation, please add type mapping for this type"); } getResolver = typeMapping.getResolver(); } final Cursor cursor = getResolver.performGet(storIOContentResolver, query); try { final int count = cursor.getCount(); if (count == 0) { return EMPTY_LIST; } else { final List<T> list = new ArrayList<T>(count); while (cursor.moveToNext()) { list.add(getResolver.mapFromCursor(cursor)); } return unmodifiableList(list); } } finally { cursor.close(); } }
Source:
public String resolveEval(String toResolve) { String str = ""; try { if ((specfile == null || toResolve.equals("")) && toResolve.length() > 2 && toResolve.substring(2, toResolve.length() - 1).equals(name)) { return toResolve; } str = RPMQuery.eval(UiUtils.resolveDefines(specfile, toResolve)).trim(); } catch (CoreException e) { SpecfileLog.logError("Unable to evaluate " + toResolve, e); } return str; }

Target:
public String resolveEval(String toResolve) { String str = ""; try { if ((specfile == null || toResolve.equals("")) && toResolve.length() > 2 && toResolve.substring(2, toResolve.length() - 1).equals(name)) { return toResolve; } str = RPMQuery.eval(UiUtils.resolveDefines(specfile, toResolve)).trim(); } catch (CoreException e) { SpecfileLog.logError(NLS.bind(Messages.getString("SpecfileElement_unableToResolve"), toResolve), e); } return str; }
Source:
public OverspeedEventHandler() { globalSpeedLimit = Context.getConfig().getInteger("event.globalspeedlimit", 0); suppressRepeated = Context.getConfig().getLong("event.suppressrepeated", 60); try { Server server = Context.getDataManager().getServer(); String speedUnit = server.getSpeedUnit(); if (speedUnit != null) { switch (speedUnit) { case "kmh" : globalSpeedLimit = UnitsConverter.knotsFromKph(globalSpeedLimit); break; case "mph" : globalSpeedLimit = UnitsConverter.knotsFromMph(globalSpeedLimit); default : break; } } } catch (SQLException error) { Log.warning(error); } }

Target:
public OverspeedEventHandler() { globalSpeedLimit = UnitsConverter.knotsFromKph(Context.getConfig().getInteger("event.globalSpeedLimit", 0)); suppressRepeated = Context.getConfig().getInteger("event.suppressRepeated", 60); }
Source:
public BlobServiceAsyncClient buildAsyncClient() { Objects.requireNonNull(endpoint); final List<HttpPipelinePolicy> policies = new ArrayList<>(); if (configuration == null) { configuration = ConfigurationManager.getConfiguration(); } policies.add(new UserAgentPolicy(BlobConfiguration.NAME, BlobConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", endpoint))); } else if (sasTokenCredential != null) { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } policies.add(new RequestRetryPolicy(retryOptions)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new BlobServiceAsyncClient(new AzureBlobStorageBuilder() .url(endpoint) .pipeline(pipeline) .build()); }

Target:
public BlobServiceAsyncClient buildAsyncClient() { Objects.requireNonNull(endpoint); final List<HttpPipelinePolicy> policies = new ArrayList<>(); if (configuration == null) { configuration = ConfigurationManager.getConfiguration(); } policies.add(new UserAgentPolicy(BlobConfiguration.NAME, BlobConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", endpoint))); } else if (sasTokenCredential != null) { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(new RequestRetryPolicy(retryOptions)); policies.addAll(this.additionalPolicies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new BlobServiceAsyncClient(new AzureBlobStorageBuilder() .url(endpoint) .pipeline(pipeline) .build()); }
Source:
public SetOperatorPropertyEvent(String operatorName, String propertyName, String propertyValue) { super(operatorName, LogLevel.INFO); this.propertyName = propertyName; this.propertyValue = propertyValue; }

Target:
public SetOperatorPropertyEvent(String operatorName, String propertyName, String propertyValue) { this(operatorName, propertyName, propertyValue, LogLevel.INFO); }
Source:
public void testMatchSingleReg() throws Throwable { final String exprString = "=$esp"; final String[] children = new String[] { "esp" }; SyncUtil.runToLocation("foo"); MIStoppedEvent stoppedEvent = SyncUtil.step(5, StepType.STEP_OVER); IFrameDMContext frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); final IExpressionDMContext exprDmc = SyncUtil.createExpression(frameDmc, exprString); checkChildrenCount(exprDmc, 1); checkChildrenCount(exprDmc, children.length); }

Target:
public void testMatchSingleReg() throws Throwable { final String exprString = "=$esp"; final String[] children = new String[] { "$esp" }; SyncUtil.runToLocation("foo"); MIStoppedEvent stoppedEvent = SyncUtil.step(5, StepType.STEP_OVER); IFrameDMContext frameDmc = SyncUtil.getStackFrame(stoppedEvent.getDMContext(), 0); final IExpressionDMContext exprDmc = SyncUtil.createExpression(frameDmc, exprString); checkChildren(exprDmc, -1, -1, children); checkChildrenCount(exprDmc, children.length); }
Source:
private Set<String> getNetworkLocations(Set<Node> bookieNodes) { Set<String> networkLocs = new HashSet<String>(); for (Node bookieNode : bookieNodes) { networkLocs.add(bookieNode.getNetworkLocation()); } return networkLocs; }

Target:
private static Set<String> getNetworkLocations(Set<Node> bookieNodes) { Set<String> networkLocs = new HashSet<>(); for (Node bookieNode : bookieNodes) { networkLocs.add(bookieNode.getNetworkLocation()); } return networkLocs; }
Source:
public CompletableFuture<T> get(DataFetchingEnvironment environment) { return CompletableFuture.supplyAsync(() -> wrappedDataFetcher.get(environment)); }

Target:
public CompletableFuture<T> get(DataFetchingEnvironment environment) { return CompletableFuture.supplyAsync(() -> wrappedDataFetcher.get(environment), executor); }
Source:
private void testGeneralQuestionOperations() throws Exception { testCancelNewOrEditQuestion(); testNewQuestionLink(); testInputValidationForQuestion(); testAddQuestionAction(); testEditQuestionLink(); testEditQuestionAction(); testEditVisibilityAction(); testGetQuestionLink(); testCopyQuestion(); testChangeFeedbackRecipient(); testEditQuestionNumberAction(); testAjaxOnVisibilityMessageButton(); testDeleteQuestionAction(2); testDeleteQuestionAction(1); testEditNonExistentQuestion(); }

Target:
private void testGeneralQuestionOperations() throws Exception { testCancelNewOrEditQuestion(); testNewQuestionLink(); testInputValidationForQuestion(); testAddQuestionAction(); testEditQuestionLink(); testEditQuestionAction(); testGetQuestionLink(); testCopyQuestion(); testChangeFeedbackRecipient(); testEditQuestionNumberAction(); testAjaxOnVisibilityMessageButton(); testDeleteQuestionAction(2); testDeleteQuestionAction(1); testEditNonExistentQuestion(); testResponseRate(); }
Source:
public synchronized IOException enterErrorState(final IOException ex) { Preconditions.checkArgument(ex != null, "Null exception"); switch (state) { case Open: case Closed: exception = ex; state = State.Error; break; case Error: break; } return exception; }

Target:
public synchronized IOException enterErrorState(final IOException ex) { Preconditions.checkArgument(ex != null, "Null exception"); switch (state.get()) { case Open: case Closed: exception = ex; state.set(State.Error); break; case Error: break; } return exception; }
Source:
private boolean isUserSearchUsingTags() { return getSearchObjectStr() != null && getSearchObjectStr().equals(SearchObjects.VDC_USER_OBJ_NAME) && origText.contains("vm"); }

Target:
private boolean isUserSearchUsingTags() { return SearchObjects.VDC_USER_OBJ_NAME.equals(getSearchObjectStr()) && origText.contains("vm"); }
Source:
public void onMessage(HTTPCarbonMessage httpResponseMessage) { Util.setupTransferEncodingForResponse(httpResponseMessage, requestDataHolder); sourceContext.channel().eventLoop().execute(() -> { boolean connectionCloseAfterResponse = shouldConnectionClose(httpResponseMessage); if (HTTPTransportContextHolder.getInstance().getHandlerExecutor() != null) { HTTPTransportContextHolder.getInstance().getHandlerExecutor() .executeAtSourceResponseReceiving(httpResponseMessage); } final HttpResponse response = Util .createHttpResponse(httpResponseMessage, connectionCloseAfterResponse); sourceContext.write(response); httpResponseMessage.getHttpContentAsync().setMessageListener(httpContent -> this.sourceContext.channel().eventLoop().execute(() -> { if (httpContent instanceof LastHttpContent) { ChannelFuture future = sourceContext.writeAndFlush(httpContent); if (connectionCloseAfterResponse) { future.addListener(ChannelFutureListener.CLOSE); } if (HTTPTransportContextHolder.getInstance().getHandlerExecutor() != null) { HTTPTransportContextHolder.getInstance().getHandlerExecutor(). executeAtSourceResponseSending(httpResponseMessage); } } else { sourceContext.write(httpContent); } })); }); Util.prepareBuiltMessageForTransfer(httpResponseMessage); }

Target:
public void onMessage(HTTPCarbonMessage httpResponseMessage) { Util.setupTransferEncodingForResponse(httpResponseMessage, requestDataHolder); sourceContext.channel().eventLoop().execute(() -> { boolean connectionCloseAfterResponse = shouldConnectionClose(httpResponseMessage); if (handlerExecutor != null) { handlerExecutor.executeAtSourceResponseReceiving(httpResponseMessage); } final HttpResponse response = Util .createHttpResponse(httpResponseMessage, connectionCloseAfterResponse); sourceContext.write(response); httpResponseMessage.getHttpContentAsync().setMessageListener(httpContent -> this.sourceContext.channel().eventLoop().execute(() -> { if (Util.isLastHttpContent(httpContent)) { ChannelFuture future = sourceContext.writeAndFlush(httpContent); if (connectionCloseAfterResponse) { future.addListener(ChannelFutureListener.CLOSE); } if (handlerExecutor != null) { handlerExecutor.executeAtSourceResponseSending(httpResponseMessage); } } else { sourceContext.write(httpContent); } })); }); Util.prepareBuiltMessageForTransfer(httpResponseMessage); }
Source:
private static boolean isVisibleEventColumn(TableColumn column) { if (column.getData(Key.ASPECT) == TmfMarginColumn.MARGIN_ASPECT) { return false; } return (column.getResizable() && column.getWidth() > 0); }

Target:
private static boolean isVisibleEventColumn(TableColumn column) { if (column.getData(Key.ASPECT) == TmfMarginColumn.MARGIN_ASPECT) { return false; } return (!column.getResizable() && column.getWidth() == 0); }
Source:
public LayerMemoryReport getMemoryReport(InputType inputType) { InputType outputType = getOutputType(-1, inputType); int numParams = initializer().numParams(this); int updaterStateSize = (int) getIUpdater().stateSize(numParams); int trainSizeFixed = 0; int trainSizeVariable = 0; if (getDropOut() > 0) { if (false) { trainSizeVariable += 0; } else { trainSizeVariable += inputType.arrayElementsPerExample(); } } trainSizeVariable += outputType.arrayElementsPerExample(); return new LayerMemoryReport.Builder(layerName, ElementWiseMultiplicationLayer.class, inputType, outputType) .standardMemory(numParams, updaterStateSize) .workingMemory(0, 0, trainSizeFixed, trainSizeVariable) .cacheMemory(MemoryReport.CACHE_MODE_ALL_ZEROS, MemoryReport.CACHE_MODE_ALL_ZEROS) .build(); }

Target:
public LayerMemoryReport getMemoryReport(InputType inputType) { InputType outputType = getOutputType(-1, inputType); int numParams = initializer().numParams(this); int updaterStateSize = (int) getIUpdater().stateSize(numParams); int trainSizeFixed = 0; int trainSizeVariable = 0; if (getIDropout() != null) { if (false) { trainSizeVariable += 0; } else { trainSizeVariable += inputType.arrayElementsPerExample(); } } trainSizeVariable += outputType.arrayElementsPerExample(); return new LayerMemoryReport.Builder(layerName, ElementWiseMultiplicationLayer.class, inputType, outputType) .standardMemory(numParams, updaterStateSize) .workingMemory(0, 0, trainSizeFixed, trainSizeVariable) .cacheMemory(MemoryReport.CACHE_MODE_ALL_ZEROS, MemoryReport.CACHE_MODE_ALL_ZEROS) .build(); }
Source:
public ConcurAccountInfo findAccountingInfoForCashAdvanceLine(ConcurStandardAccountingExtractDetailLine cashAdvanceLine, List<ConcurStandardAccountingExtractDetailLine> saeLines) { LOG.debug("findAccountingInfoForCashAdvanceLine, entering"); ConcurAccountInfo info = new ConcurAccountInfo(); String cashAdvanceReportEntryId = cashAdvanceLine.getReportEntryId(); if (LOG.isDebugEnabled()) { LOG.debug("findAccountingInfoForCashAdvanceLine, cashAdvanceReportEntryId: " + cashAdvanceReportEntryId); } for (ConcurStandardAccountingExtractDetailLine line : saeLines) { if (StringUtils.equalsIgnoreCase(line.getReportEntryId(), cashAdvanceReportEntryId) && !isCashAdvanceLine(line)) { if (LOG.isDebugEnabled()) { LOG.debug("findAccountingInfoForCashAdvanceLine, setting accountNumber to " + line.getAccountNumber() + " and chart to " + line.getChartOfAccountsCode()); } info.setAccountNumber(line.getAccountNumber()); info.setChart(line.getChartOfAccountsCode()); break; } } return info; }

Target:
public ConcurAccountInfo findAccountingInfoForCashAdvanceLine(ConcurStandardAccountingExtractDetailLine cashAdvanceLine, List<ConcurStandardAccountingExtractDetailLine> saeLines) { LOG.debug("findAccountingInfoForCashAdvanceLine, entering"); ConcurAccountInfo info = new ConcurAccountInfo(); String cashAdvanceReportEntryId = cashAdvanceLine.getReportEntryId(); if (LOG.isDebugEnabled()) { LOG.debug("findAccountingInfoForCashAdvanceLine, cashAdvanceReportEntryId: " + cashAdvanceReportEntryId); } for (ConcurStandardAccountingExtractDetailLine line : saeLines) { if (StringUtils.equalsIgnoreCase(line.getReportEntryId(), cashAdvanceReportEntryId) && !isCashAdvanceLine(line)) { info.setChart(line.getChartOfAccountsCode()); info.setAccountNumber(line.getAccountNumber()); info.setSubAccountNumber(line.getSubAccountNumber()); info.setObjectCode(line.getJournalAccountCode()); info.setSubObjectCode(line.getSubObjectCode()); info.setProjectCode(line.getProjectCode()); info.setOrgRefId(line.getOrgRefId()); if (LOG.isDebugEnabled()) { LOG.debug("findAccountingInfoForCashAdvanceLine, returning Concur account info: " + info.toString()); } break; } } return info; }
Source:
boolean systemConditionsAvailable() { if (ActivityLifecycleHandler.curActivity == null) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "OSSystemConditionObserver curActivity null"); return false; } if (isDialogFragmentVisible(ActivityLifecycleHandler.curActivity)) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "OSSystemConditionObserver dialog fragment detected"); return false; } boolean keyboardUp = OSViewUtils.isKeyboardUp(new WeakReference<>(ActivityLifecycleHandler.curActivity)); if (keyboardUp) { ActivityLifecycleHandler.setSystemConditionObserver(TAG, systemConditionObserver); OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "OSSystemConditionObserver keyboard up detected"); } return !keyboardUp; }

Target:
boolean systemConditionsAvailable() { if (ActivityLifecycleHandler.curActivity == null) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.WARN, "OSSystemConditionObserver curActivity null"); return false; } if (isDialogFragmentShowing(ActivityLifecycleHandler.curActivity)) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.WARN, "OSSystemConditionObserver dialog fragment detected"); return false; } boolean keyboardUp = OSViewUtils.isKeyboardUp(new WeakReference<>(ActivityLifecycleHandler.curActivity)); if (keyboardUp) { ActivityLifecycleHandler.setSystemConditionObserver(TAG, systemConditionObserver); OneSignal.onesignalLog(OneSignal.LOG_LEVEL.WARN, "OSSystemConditionObserver keyboard up detected"); } return !keyboardUp; }