auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Task<OsDetails> getOsDetails(final SshMachineLocation sshLocation) { return Tasks.<OsDetails>builder() .name("Get OsDetails for " + sshLocation) .body(new Callable<OsDetails>() { @Override public OsDetails call() throws Exception { BufferedReader reader = new BufferedReader(Streams.reader( new ResourceUtils(this).getResourceFromUrl("classpath://brooklyn/entity/software/os-details.sh"))); List<String> script = CharStreams.readLines(reader); reader.close(); String output = DynamicTasks.queue(SshEffectorTasks.ssh(script) .machine(sshLocation) .requiringZeroAndReturningStdout()) .get(); String[] details = output.split("\\r?\\n"); if (details.length != 3) LOG.warn("Unexpected length ({}) of os details for {}: {}", new Object[]{details.length, sshLocation, output}); String name = find(details, "name:").or("unknown"); String version = find(details, "version:").or("unknown"); String architecture = find(details, "architecture:").or("unknown"); OsDetails osDetails = new BasicOsDetails(name, architecture, version); if (LOG.isDebugEnabled()) LOG.debug("OsDetails for {}: {}", sshLocation, osDetails); return osDetails; } private Optional<String> find(String[] inputs, String field) { for (String input : inputs) { if (input.startsWith(field)) { return Optional.of(input.substring(field.length())); } } return Optional.absent(); } }) .build(); }

Target:
public static Task<OsDetails> getOsDetails(final SshMachineLocation sshLocation) { return Tasks.<OsDetails>builder() .name("Get OsDetails for " + sshLocation) .body(new Callable<OsDetails>() { @Override public OsDetails call() throws Exception { BufferedReader reader = new BufferedReader(Streams.reader( new ResourceUtils(this).getResourceFromUrl("classpath://brooklyn/entity/software/os-details.sh"))); List<String> script = CharStreams.readLines(reader); reader.close(); String output = DynamicTasks.queue(SshEffectorTasks.ssh(script) .machine(sshLocation) .requiringZeroAndReturningStdout()) .get(); String[] details = output.split("\\r?\\n"); if (details.length != 3) LOG.warn("Unexpected length ({}) of os details for {}: {}", new Object[]{details.length, sshLocation, output}); String name = find(details, "name:").or("unknown"); String version = find(details, "version:").or("unknown"); String architecture = find(details, "architecture:").or("unknown"); OsDetails osDetails = new BasicOsDetails(name, architecture, version); if (LOG.isDebugEnabled()) LOG.debug("OsDetails for {}: {}", sshLocation, osDetails); return osDetails; } private Optional<String> find(String[] inputs, String field) { for (String input : inputs) { if (input.startsWith(field)) { String value = input.substring(field.length()).trim(); return (!value.isEmpty()) ? Optional.of(input.substring(field.length())) : Optional.<String>absent(); } } return Optional.absent(); } }) .build(); }
Source:
public boolean loadFromConfig( File configFile ) { String namespace = DataStorePluginOptions.getStoreNamespace(storeName); return loadFromConfig( ConfigOptions.loadProperties( configFile, "^" + namespace), namespace, null); }

Target:
public boolean loadFromConfig( File configFile ) { String namespace = DataStorePluginOptions.getStoreNamespace(storeName); return loadFromConfig( ConfigOptions.loadProperties( configFile, "^" + namespace), namespace, configFile); }
Source:
public void setBccVisibility(boolean visible) { boolean bccAlreadyVisible = isBccVisible(); bccWrapper.setVisibility(visible ? View.VISIBLE : View.GONE); if(visible && !bccAlreadyVisible){ List<Recipient> bccRecipients = getBccRecipients(); bccView.clear(); bccView.addRecipients(bccRecipients.toArray(new Recipient[0])); } bccDivider.setVisibility(visible ? View.VISIBLE : View.GONE); }

Target:
public void setBccVisibility(boolean visible) { bccWrapper.setVisibility(visible ? View.VISIBLE : View.GONE); bccDivider.setVisibility(visible ? View.VISIBLE : View.GONE); }
Source:
protected List<DeploymentContent> generateDeploymentContent(TestClass testClass) { final List<DeploymentContent> deploymentContents = new ArrayList<DeploymentContent>(); final ServiceLoader<AutomaticDeployment> deploymentSpis = automaticDeploymentLocator.find(); final Iterator<AutomaticDeployment> deploymentSpiIterator = deploymentSpis.iterator(); while (deploymentSpiIterator.hasNext()) { final DeploymentContent deploymentContent = deploymentSpiIterator.next().generateDeploymentScenario(testClass); if (deploymentContent != null) { deploymentContents.add(deploymentContent); } } return deploymentContents; }

Target:
protected List<DeploymentConfiguration> generateDeploymentContent(TestClass testClass) { final List<DeploymentConfiguration> deploymentConfigurations = new ArrayList<DeploymentConfiguration>(); final ServiceLoader<AutomaticDeployment> deploymentSpis = automaticDeploymentLocator.find(); for (AutomaticDeployment deploymentSpi : deploymentSpis) { final DeploymentConfiguration deploymentConfiguration = deploymentSpi.generateDeploymentScenario(testClass); if (deploymentConfiguration != null) { deploymentConfigurations.add(deploymentConfiguration); } } return deploymentConfigurations; }
Source:
public String explain(String impliedTableName) { ExpressionType type = getExpressionType(); if (type == ExpressionType.OPERATOR_IS_NULL) { return "(" + m_left.explain(impliedTableName) + " IS NULL)"; } if (type == ExpressionType.OPERATOR_NOT) { return "(NOT " + m_left.explain(impliedTableName) + ")"; } if (type == ExpressionType.OPERATOR_CAST) { return "(CAST (" + m_left.explain(impliedTableName) + " AS " + m_valueType.toSQLString() + "))"; } if (type == ExpressionType.OPERATOR_EXISTS) { return "(EXISTS " + m_left.explain(impliedTableName) + ")"; } if (type == ExpressionType.OPERATOR_CASE_WHEN) { return "(CASE WHEN " + m_left.explain(impliedTableName) + " THEN " + m_right.m_left.explain(impliedTableName) + " ELSE " + m_right.m_right.explain(impliedTableName) + " END)"; } if (type == ExpressionType.OPERATOR_UNARY_MINUS) { return "(-" + m_left.explain(impliedTableName) + ")"; } return "(" + m_left.explain(impliedTableName) + " " + type.symbol() + " " + m_right.explain(impliedTableName) + ")"; }

Target:
public String explain(String impliedTableName) { final String explainLeftTableName = m_left.explain(impliedTableName); switch(getExpressionType()) { case OPERATOR_IS_NULL: return String.format("(%s IS NULL)", explainLeftTableName); case OPERATOR_NOT: return String.format("(NOT %s)", explainLeftTableName); case OPERATOR_CAST: return String.format("(CAST (%s AS %s))", explainLeftTableName, m_valueType.toSQLString()); case OPERATOR_EXISTS: return String.format("(EXISTS %s)", explainLeftTableName); case OPERATOR_CASE_WHEN: return String.format("(CASE WHEN %s THEN %s ELSE %s END)", explainLeftTableName, m_right.m_left.explain(impliedTableName), m_right.m_right.explain(impliedTableName)); case OPERATOR_UNARY_MINUS: return String.format("(-%s)", explainLeftTableName); default: return String.format("(%s %s %s)", explainLeftTableName, getExpressionType().symbol(), m_right.explain(impliedTableName)); } }
Source:
public static <T extends MinecraftLens> ReusableLens<T> getLens(Class<T> lensType, InventoryAdapter<IInventory, ItemStack> adapter, Function<SlotCollection, T> lens, Supplier<SlotCollection> slots) { Map<Integer, ReusableLens> reusableLens = reusableLenses.computeIfAbsent(lensType, k -> new HashMap<>()); return reusableLens.computeIfAbsent(adapter.getInventory().getSize(), k -> new ReusableLens(slots.get(), lens)); }

Target:
public static <T extends Lens<IInventory, ItemStack>> ReusableLens<T> getLens(Class<T> lensType, InventoryAdapter<IInventory, ItemStack> adapter, Function<SlotCollection, T> lens, Supplier<SlotCollection> slots) { Map<Class<? extends Lens<IInventory, ItemStack>>, Int2ObjectMap<ReusableLens>> adapterLenses = reusableLenses.computeIfAbsent(adapter.getClass(), k -> new HashMap<>()); Int2ObjectMap<ReusableLens> lenses = adapterLenses.computeIfAbsent(lensType, k -> new Int2ObjectOpenHashMap<>()); return lenses.computeIfAbsent(adapter.getInventory().getSize(), k -> new ReusableLens(slots.get(), lens, adapter.getClass())); }
Source:
public void typeAmountOfColumns(int columns) { tablePropertiesInputs.get(1).clear(); tablePropertiesInputs.get(1).sendKeys(Integer.toString(columns)); PageObjectLogging.log("typeAmountOfColumns", "amount of columns was typed", true, driver); }

Target:
public void typeAmountOfColumns(int columns) { tablePropertiesInputs.get(1).clear(); tablePropertiesInputs.get(1).sendKeys(Integer.toString(columns)); PageObjectLogging.log( "typeAmountOfColumns", "amount of columns was typed: " + columns, true ); }
Source:
public void start() throws InterruptedException { this.bossGroup = new NioEventLoopGroup(); final InetSocketAddress address = this.host != null ? SocketUtils.socketAddress(this.host, this.port) : new InetSocketAddress(this.port); this.socketFuture = new Bootstrap() .group(this.bossGroup) .channel(NioDatagramChannel.class) .option(ChannelOption.SO_REUSEADDR, true) .handler(new ChannelInitializer<DatagramChannel>() { @Override protected void initChannel(final DatagramChannel ch) throws Exception { ch.pipeline() .addLast(new PacketDecoder()) .addLast(new PacketHandler(Listener.this.dispatcher)) .addLast(new ChannelInboundHandlerAdapter() { @Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { LOG.warn("Invalid packet: {}", cause.getMessage()); LOG.debug("", cause); } }); } }) .bind(address) .sync(); }

Target:
public void start() throws InterruptedException { this.bossGroup = new NioEventLoopGroup(); final InetSocketAddress address = this.host != null ? SocketUtils.socketAddress(this.host, this.port) : new InetSocketAddress(this.port); this.socketFuture = new Bootstrap() .group(this.bossGroup) .channel(NioDatagramChannel.class) .option(ChannelOption.SO_REUSEADDR, true) .option(ChannelOption.SO_RCVBUF, Integer.MAX_VALUE) .option(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(this.maxPacketSize)) .handler(new ChannelInitializer<DatagramChannel>() { @Override protected void initChannel(final DatagramChannel ch) throws Exception { ch.pipeline() .addLast(new PacketDecoder()) .addLast(new PacketHandler(Listener.this.dispatcher)) .addLast(new ChannelInboundHandlerAdapter() { @Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { LOG.warn("Invalid packet: {}", cause.getMessage()); LOG.debug("", cause); } }); } }) .bind(address) .sync(); }
Source:
private <T> CompletableFuture<T> executeCommandAndCommitIfNeededAsync(InvocationContext ctx, VisitableCommand command) { final boolean txInjected = isTxInjected(ctx); CompletableFuture<T> cf; final Transaction implicitTransaction; try { cf = (CompletableFuture<T>) invoker.invokeAsync(ctx, command); if (txInjected) { implicitTransaction = transactionManager.suspend(); assert implicitTransaction != null; } else { implicitTransaction = null; } } catch (SystemException e) { throw new CacheException("Cannot suspend implicit transaction", e); } catch (Throwable e) { if (txInjected) tryRollback(); throw e; } if (txInjected) { return cf.handle((result, throwable) -> { if (throwable != null) { try { implicitTransaction.rollback(); } catch (SystemException e) { log.trace("Could not rollback", e); throwable.addSuppressed(e); } throw CompletableFutures.asCompletionException(throwable); } try { implicitTransaction.commit(); } catch (Exception e) { log.couldNotCompleteInjectedTransaction(e); throw CompletableFutures.asCompletionException(e); } return result; }); } else { return cf; } }

Target:
private <T> CompletableFuture<T> executeCommandAndCommitIfNeededAsync(InvocationContext ctx, VisitableCommand command) { final boolean txInjected = isTxInjected(ctx); CompletableFuture<T> cf; final Transaction implicitTransaction; try { if (txInjected) { implicitTransaction = transactionManager.suspend(); assert implicitTransaction != null; } else { implicitTransaction = null; } cf = (CompletableFuture<T>) invoker.invokeAsync(ctx, command); } catch (SystemException e) { throw new CacheException("Cannot suspend implicit transaction", e); } catch (Throwable e) { if (txInjected) tryRollback(); throw e; } if (txInjected) { return cf.handle((result, throwable) -> { if (throwable != null) { try { implicitTransaction.rollback(); } catch (SystemException e) { log.trace("Could not rollback", e); throwable.addSuppressed(e); } throw CompletableFutures.asCompletionException(throwable); } try { implicitTransaction.commit(); } catch (Exception e) { log.couldNotCompleteInjectedTransaction(e); throw CompletableFutures.asCompletionException(e); } return result; }); } else { return cf; } }
Source:
private long generateCidaFromFilepaths(String[] fileNames) { final int n = fileNames.length; long pidls = new long [n]; try { CIDA cida = new CIDA(); cida.cidl = n; int cidaSize = CIDA.sizeof + 4 * n; cida.aoffset = cidaSize; int[] pidlOffsets = new int[n]; int[] pidlSizes = new int[n]; int pidlSizeSum = 2; for (int i = 0; i < n; i++) { TCHAR szfileName = new TCHAR(0, fileNames[i], true); long ppv = new long [1]; int hr = COM.PathToPIDL(szfileName.chars, ppv); if (hr != OS.S_OK) { DND.error(DND.ERROR_INVALID_DATA); } pidls[i] = ppv[0]; pidlSizes[i] = OS.ILGetSize(pidls[i]); pidlSizeSum += pidlSizes[i]; if (i == 0) { pidlOffsets[0] = cidaSize + 2; } else { pidlOffsets[i] = pidlOffsets[i - 1] + pidlSizes[i - 1]; } } long newPtr = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, cidaSize + pidlSizeSum); if (newPtr != 0) { OS.MoveMemory(newPtr, cida, CIDA.sizeof); OS.MoveMemory(newPtr + CIDA.sizeof, pidlOffsets, 4 * cida.cidl); for (int i = 0; i < n; i++) { OS.MoveMemory(newPtr + pidlOffsets[i], pidls[i], pidlSizes[i]); } } return newPtr; } finally { for (int i = 0; i < n; i++) { if (pidls[i] != 0) { OS.CoTaskMemFree(pidls[i]); } } } }

Target:
private long generateCidaFromFilepaths(String[] fileNames) { final int n = fileNames.length; long pidls = new long [n]; try { CIDA cida = new CIDA(); cida.cidl = n; int cidaSize = CIDA.sizeof + 4 * n; cida.aoffset = cidaSize; int[] pidlOffsets = new int[n]; int[] pidlSizes = new int[n]; int pidlSizeSum = 2; for (int i = 0; i < n; i++) { TCHAR szfileName = new TCHAR(0, fileNames[i], true); long ppv = new long [1]; int hr = COM.PathToPIDL(szfileName.chars, ppv); if (hr != OS.S_OK) { return 0; } pidls[i] = ppv[0]; pidlSizes[i] = OS.ILGetSize(pidls[i]); pidlSizeSum += pidlSizes[i]; if (i == 0) { pidlOffsets[0] = cidaSize + 2; } else { pidlOffsets[i] = pidlOffsets[i - 1] + pidlSizes[i - 1]; } } long newPtr = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, cidaSize + pidlSizeSum); if (newPtr != 0) { OS.MoveMemory(newPtr, cida, CIDA.sizeof); OS.MoveMemory(newPtr + CIDA.sizeof, pidlOffsets, 4 * cida.cidl); for (int i = 0; i < n; i++) { OS.MoveMemory(newPtr + pidlOffsets[i], pidls[i], pidlSizes[i]); } } return newPtr; } finally { for (int i = 0; i < n; i++) { if (pidls[i] != 0) { OS.CoTaskMemFree(pidls[i]); } } } }
Source:
public void onTestRunEnd(DataRecord runData, Result result) { File destination = FULL_REPORT_DESTINATION.toFile(); File directory = destination.getParentFile(); Log.e(LOG_TAG, String.format("Exists? : %b", destination.exists())); if (destination.exists()) { throw new IllegalStateException( String.format("Report destination already written to: %s", FULL_REPORT_DESTINATION)); } else if (!directory.exists() && !directory.mkdirs()) { throw new RuntimeException( String.format("Could not create incident destination folder: %s.", directory.toString())); } String fullReportCmd = String.format(REDIRECT_INCIDENT_REPORT_CMD, "EXPLICIT"); Log.v(LOG_TAG, String.format("Collecting full incident report: %s.", fullReportCmd)); InstrumentationRegistry.getInstrumentation().getUiAutomation() .adoptShellPermissionIdentity(); byte[] output = executeCommandBlocking(fullReportCmd); InstrumentationRegistry.getInstrumentation().getUiAutomation() .dropShellPermissionIdentity(); if (output == null) { throw new RuntimeException("Failed to run the incident report command."); } if (output.length == 0) { throw new RuntimeException("The incident report command returned no data."); } else { try { Files.write(destination.toPath(), output, StandardOpenOption.CREATE_NEW); } catch (IOException e) { throw new RuntimeException("Unable to write incident report.", e); } if (!destination.exists()) { throw new RuntimeException("Unable to find the full incident report available."); } runData.addFileMetric(FULL_REPORT_KEY, destination); } }

Target:
public void onTestRunEnd(DataRecord runData, Result result) { if (!REPORT_DIRECTORY.toFile().exists()) { throw new IllegalStateException(String.format( "Report destination folder does not exist: %s", REPORT_DIRECTORY.toString())); } String fullReportCmd = String.format(REDIRECT_INCIDENT_REPORT_CMD, "EXPLICIT"); Log.v(LOG_TAG, String.format("Collecting full incident report: %s.", fullReportCmd)); InstrumentationRegistry.getInstrumentation().getUiAutomation() .adoptShellPermissionIdentity(); byte[] output = executeCommandBlocking(fullReportCmd); InstrumentationRegistry.getInstrumentation().getUiAutomation() .dropShellPermissionIdentity(); if (output == null) { throw new RuntimeException("Failed to run the incident report command."); } if (output.length == 0) { throw new RuntimeException("The incident report command returned no data."); } else { try { Files.write(FINAL_REPORT_PATH, output, StandardOpenOption.CREATE_NEW); } catch (IOException e) { throw new RuntimeException("Unable to write full incident report.", e); } File destination = FINAL_REPORT_PATH.toFile(); if (!destination.exists()) { throw new RuntimeException("Unable to find the full incident report available."); } runData.addFileMetric(FINAL_REPORT_KEY, destination); } }
Source:
protected void onInit() throws Exception { super.onInit(); Assert.state(!(this.discardChannelName != null && this.discardChannel != null), "'discardChannelName' and 'discardChannel' are mutually exclusive."); BeanFactory beanFactory = this.getBeanFactory(); if (beanFactory != null) { if (this.outputProcessor instanceof BeanFactoryAware) { ((BeanFactoryAware) this.outputProcessor).setBeanFactory(beanFactory); } if (this.correlationStrategy instanceof BeanFactoryAware) { ((BeanFactoryAware) this.correlationStrategy).setBeanFactory(beanFactory); } if (this.releaseStrategy instanceof BeanFactoryAware) { ((BeanFactoryAware) this.releaseStrategy).setBeanFactory(beanFactory); } } if (this.discardChannel == null) { this.discardChannel = new NullChannel(); } if (this.releasePartialSequences) { Assert.isInstanceOf(SequenceSizeReleaseStrategy.class, this.releaseStrategy, "Release strategy of type [" + this.releaseStrategy.getClass().getSimpleName() + "] cannot release partial sequences. Use the default SequenceSizeReleaseStrategy instead."); ((SequenceSizeReleaseStrategy) this.releaseStrategy) .setReleasePartialSequences(this.releasePartialSequences); } if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } if (this.sequenceAware && this.logger.isWarnEnabled()) { this.logger.warn("Using a SequenceSizeReleaseStrategy with large groups may not perform well, consider " + "using a SimpleSequenceSizeReleaseStrategy"); } this.lockRegistrySet = true; this.forceReleaseProcessor = createGroupTimeoutProcessor(); }

Target:
protected void onInit() throws Exception { super.onInit(); Assert.state(!(this.discardChannelName != null && this.discardChannel != null), "'discardChannelName' and 'discardChannel' are mutually exclusive."); BeanFactory beanFactory = this.getBeanFactory(); if (beanFactory != null) { if (this.outputProcessor instanceof BeanFactoryAware) { ((BeanFactoryAware) this.outputProcessor).setBeanFactory(beanFactory); } if (this.correlationStrategy instanceof BeanFactoryAware) { ((BeanFactoryAware) this.correlationStrategy).setBeanFactory(beanFactory); } if (this.releaseStrategy instanceof BeanFactoryAware) { ((BeanFactoryAware) this.releaseStrategy).setBeanFactory(beanFactory); } } if (this.discardChannel == null) { this.discardChannel = new NullChannel(); } if (this.releasePartialSequences) { Assert.isInstanceOf(SequenceSizeReleaseStrategy.class, this.releaseStrategy, "Release strategy of type [" + this.releaseStrategy.getClass().getSimpleName() + "] cannot release partial sequences. Use a SequenceSizeReleaseStrategy instead."); ((SequenceSizeReleaseStrategy) this.releaseStrategy) .setReleasePartialSequences(this.releasePartialSequences); } if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } if (this.sequenceAware && this.logger.isWarnEnabled()) { this.logger.warn("Using a SequenceSizeReleaseStrategy with large groups may not perform well, consider " + "using a SimpleSequenceSizeReleaseStrategy"); } this.lockRegistrySet = true; this.forceReleaseProcessor = createGroupTimeoutProcessor(); }
Source:
public static Definitions wbFromDMN(final org.kie.dmn.model.api.Definitions dmn) { if (dmn == null) { return null; } Id id = new Id(dmn.getId()); Name name = new Name(dmn.getName()); String namespace = dmn.getNamespace(); Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); Definitions result = new Definitions(); result.setId(id); result.setName(name); result.setNamespace(namespace); result.setDescription(description); result.getNsContext().putAll(dmn.getNsContext()); result.getNsContext().put(DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix(), DMNModelInstrumentedBase.Namespace.DEFAULT.getUri()); for (org.kie.dmn.model.api.ItemDefinition itemDef : dmn.getItemDefinition()) { ItemDefinition itemDefConverted = ItemDefinitionPropertyConverter.wbFromDMN(itemDef); if (itemDefConverted != null) { itemDefConverted.setParent(result); } result.getItemDefinition().add(itemDefConverted); } for (org.kie.dmn.model.api.Import i : dmn.getImport()) { Import importConverted = ImportConverter.nodeFromDMN(i); if (importConverted != null) { importConverted.setParent(result); } result.getImport().add(importConverted); } return result; }

Target:
public static Definitions wbFromDMN(final org.kie.dmn.model.api.Definitions dmn) { if (dmn == null) { return null; } Id id = new Id(dmn.getId()); Name name = new Name(dmn.getName()); String namespace = dmn.getNamespace(); Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription()); Definitions result = new Definitions(); result.setId(id); result.setName(name); result.setNamespace(namespace); result.getNsContext().put(DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix(), namespace); result.setDescription(description); for (Entry<String, String> kv : dmn.getNsContext().entrySet()) { String mappedURI = kv.getValue(); switch (mappedURI) { case org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase.URI_DMN: mappedURI = org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase.URI_DMN; break; case org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase.URI_FEEL: mappedURI = org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase.URI_FEEL; break; case org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase.URI_KIE: mappedURI = org.kie.dmn.model.v1_2.KieDMNModelInstrumentedBase.URI_KIE; break; } result.getNsContext().put(kv.getKey(), mappedURI); } for (org.kie.dmn.model.api.ItemDefinition itemDef : dmn.getItemDefinition()) { ItemDefinition itemDefConverted = ItemDefinitionPropertyConverter.wbFromDMN(itemDef); if (itemDefConverted != null) { itemDefConverted.setParent(result); } result.getItemDefinition().add(itemDefConverted); } for (org.kie.dmn.model.api.Import i : dmn.getImport()) { Import importConverted = ImportConverter.wbFromDMN(i); if (importConverted != null) { importConverted.setParent(result); } result.getImport().add(importConverted); } return result; }
Source:
private StoreKey getKeyAt(ByteBuffer mmap, int index) throws StoreException { StoreKey storeKey = null; try { mmap.position(firstKeyRelativeOffset + index * persistedEntrySize); storeKey = factory.getStoreKey(new DataInputStream(new ByteBufferInputStream(mmap))); } catch (Throwable t) { if (t.getClass() == InternalError.class && t.getMessage().equals(StoreException.INTERNAL_ERROR_STR)) { throw new StoreException("Internal error occurred due to unsafe memory access", t, StoreErrorCodes.IOError); } else if (t.getClass() == IOException.class && t.getMessage().equals(StoreException.IO_ERROR_STR)) { throw new StoreException("IO error while trying to get store key", t, StoreErrorCodes.IOError); } else { throw new StoreException("Unknown error while trying to get store key ", t, StoreErrorCodes.Unknown_Error); } } return storeKey; }

Target:
private StoreKey getKeyAt(ByteBuffer mmap, int index) throws StoreException { StoreKey storeKey = null; try { mmap.position(firstKeyRelativeOffset + index * persistedEntrySize); storeKey = factory.getStoreKey(new DataInputStream(new ByteBufferInputStream(mmap))); } catch (InternalError e) { throw e.getMessage().equals(StoreException.INTERNAL_ERROR_STR) ? new StoreException( "Internal error occurred due to unsafe memory access", e, StoreErrorCodes.IOError) : new StoreException("Unknown internal error while trying to get store key", e, StoreErrorCodes.Unknown_Error); } catch (IOException e) { throw e.getMessage().equals(StoreException.IO_ERROR_STR) ? new StoreException( "IO error while trying to get store key", e, StoreErrorCodes.IOError) : new StoreException("Unknown IO error while trying to get store key", e, StoreErrorCodes.Unknown_Error); } catch (Throwable t) { throw new StoreException("Unknown error while trying to get store key ", t, StoreErrorCodes.Unknown_Error); } return storeKey; }
Source:
public synchronized int onStartCommand(Intent intent, int flags, int startId) { Logger.d(TAG, "BeginQuestionnaireService started"); super.onStartCommand(intent, flags, startId); if (statusManager.areParametersUpdated()) { notifyQuestionnaire(); } stopSelf(); return START_REDELIVER_INTENT; }

Target:
public synchronized int onStartCommand(Intent intent, int flags, int startId) { Logger.d(TAG, "BeginQuestionnaireService started"); super.onStartCommand(intent, flags, startId); if (statusManager.areParametersUpdated() && !statusManager.areBeginQuestionnairesCompleted()) { notifyQuestionnaire(); } stopSelf(); return START_REDELIVER_INTENT; }
Source:
public void init(BibEntry entry) { cancelSearch(); entryKey.set(entry.getCiteKeyOptional().orElse(null)); if (entryKey.get() == null) { searchError.set(Localization.lang("Selected entry does not have an associated BibTeX key.")); status.set(Status.ERROR); return; } startSearch(); }

Target:
public void init(BibEntry entry) { cancelSearch(); Optional<String> citeKey = entry.getCiteKeyOptional(); if (citeKey.isPresent()) { startSearch(citeKey.get()); } else { searchError.set(Localization.lang("Selected entry does not have an associated BibTeX key.")); status.set(Status.ERROR); } }
Source:
public static String reconcilePath(String originalPath ) { int len = originalPath.length(); int len1 = len - 1; int j = 0; boolean noSepBefore = true; char[] ein = new char[len]; char[] aus = new char[len + 1]; originalPath.getChars(0, len, ein, 0); char separatorChar = File.separatorChar; if (UNCPathConverter.isUNC(originalPath)) { Assert.isTrue(len >= 2, "Unknown UNC path format"); Assert.isTrue(ein[0] == ein[1], "Unknown UNC path format"); Assert.isTrue(ein[0] == BSLASH || ein[0] == SLASH, "Unknown UNC path format"); separatorChar = ein[0]; aus[j++] = separatorChar; } for (int i= 0; i < len; i++) { char c = ein[i]; switch (c) { case QUOTE: noSepBefore = true; break; case SLASH: case BSLASH: if (noSepBefore) { noSepBefore = false; aus[j++] = separatorChar; } break; case DOT: if (noSepBefore && j > 0) { aus[j++] = c; } else { if (i < len1) { c = ein[i + 1]; if (c == SLASH || c == BSLASH) { i++; noSepBefore = false; } else { i++; noSepBefore = true; aus[j++] = DOT; aus[j++] = c; } } } break; default: noSepBefore = true; aus[j++] = c; } } return new String(aus, 0, j); }

Target:
public static String reconcilePath(String originalPath ) { int len = originalPath.length(); int len1 = len - 1; int j = 0; boolean noSepBefore = true; char[] ein = new char[len]; char[] aus = new char[len + 1]; originalPath.getChars(0, len, ein, 0); char separatorChar = File.separatorChar; if (UNCPathConverter.isUNC(originalPath)) { separatorChar = ein[0]; aus[j++] = separatorChar; } for (int i= 0; i < len; i++) { char c = ein[i]; switch (c) { case QUOTE: noSepBefore = true; break; case SLASH: case BSLASH: if (noSepBefore) { noSepBefore = false; aus[j++] = separatorChar; } break; case DOT: if (noSepBefore && j > 0) { aus[j++] = c; } else { if (i < len1) { c = ein[i + 1]; if (c == SLASH || c == BSLASH) { i++; noSepBefore = false; } else { i++; noSepBefore = true; aus[j++] = DOT; aus[j++] = c; } } } break; default: noSepBefore = true; aus[j++] = c; } } return new String(aus, 0, j); }
Source:
public List<PoolQuantity> getDryRun(Consumer consumer, String serviceLevelOverride) { List<PoolQuantity> result = new ArrayList<PoolQuantity>(); try { Owner owner = consumer.getOwner(); if (consumer.isDev()) { if (config.getBoolean(ConfigProperties.STANDALONE) || !poolCurator.hasActiveEntitlementPools(consumer.getOwner(), null)) { throw new ForbiddenException(i18n.tr( "Development units may only be used on hosted servers" + " and with orgs that have active subscriptions.")); } String sku = consumer.getFact("dev_sku"); Pool devPool = poolCurator.findDevPool(consumer); if (devPool != null) { poolManager.deletePool(devPool); } devPool = poolManager.createPool(assembleDevPool(consumer, sku)); result.add(new PoolQuantity(devPool, 1)); } else { result = poolManager.getBestPools( consumer, null, null, owner, serviceLevelOverride, null); } log.debug("Created Pool Quantity list: " + result); } catch (EntitlementRefusedException e) { if (log.isDebugEnabled()) { log.debug("consumer dry-run " + consumer.getUuid() + ": errors:"); for (Entry<String, ValidationResult> entry : e.getResults().entrySet()) { log.debug("errors for pool id: " + entry.getKey()); for (ValidationError error : entry.getValue().getErrors()) { log.debug(error.getResourceKey()); } } } } return result; }

Target:
public List<PoolQuantity> getDryRun(Consumer consumer, String serviceLevelOverride) { List<PoolQuantity> result = new ArrayList<PoolQuantity>(); try { Owner owner = consumer.getOwner(); if (consumer.isDev()) { if (config.getBoolean(ConfigProperties.STANDALONE) || !poolCurator.hasActiveEntitlementPools(consumer.getOwner(), null)) { throw new ForbiddenException(i18n.tr( "Development units may only be used on hosted servers" + " and with orgs that have active subscriptions.")); } String sku = consumer.getFact("dev_sku"); Pool devPool = poolCurator.findDevPool(consumer); if (devPool != null) { poolManager.deletePool(devPool); } devPool = poolManager.createPool(assembleDevPool(consumer, sku)); result.add(new PoolQuantity(devPool, 1)); } else { result = poolManager.getBestPools( consumer, null, null, owner, serviceLevelOverride, null); } log.debug("Created Pool Quantity list: " + result); } catch (EntitlementRefusedException e) { if (log.isDebugEnabled()) { log.debug("consumer dry-run errors:", consumer.getUuid()); for (Entry<String, ValidationResult> entry : e.getResults().entrySet()) { log.debug("errors for pool id: {}", entry.getKey()); for (ValidationError error : entry.getValue().getErrors()) { log.debug(error.getResourceKey()); } } } } return result; }
Source:
private double[] sumOverFirstDimension(final double[][][] data) { final double result = new double[data.length]; for (int i = 0; i < data.length; i++) { result[i] = 0; for (int j = 0; j < data[0].length; j++) { for (int k = 0; k < data[0][0].length; k++) { result[i] += data[i][j][k]; } } } return result; }

Target:
static double[][] sumOverFirstDimension(final double[][][] data) { final double [][] result = new double[data[0].length][data[0][0].length]; for (int j = 0; j < data[0].length; j++) { for (int k = 0; k < data[0][0].length; k++) { result[j][k] = 0; for (int i = 0; i < data.length; i++) { result[j][k] += data[i][j][k]; } } } return result; }
Source:
void enqueueContentForDelivery(String content) { if (storeDirectory == null) { return; } String filename = getFilename(content); discardOldestFileIfNeeded(); lock.lock(); try { FileOutputStream fos = new FileOutputStream(filename); Writer out = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8")); out.write(content); out.close(); } catch (Exception exception) { Logger.warn(String.format("Couldn't save unsent payload to disk (%s) ", filename), exception); } finally { lock.unlock(); } }

Target:
void enqueueContentForDelivery(String content) { if (storeDirectory == null) { return; } String filename = getFilename(content); discardOldestFileIfNeeded(); lock.lock(); Writer out = null; try { FileOutputStream fos = new FileOutputStream(filename); out = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8")); out.write(content); } catch (Exception exception) { Logger.warn(String.format("Couldn't save unsent payload to disk (%s) ", filename), exception); } finally { try { if (out != null) { out.close(); } } catch (Exception exception) { Logger.warn(String.format("Failed to close unsent payload writer (%s) ", filename), exception); } lock.unlock(); } }
Source:
public Subject createSubject(String sd) { Subject subject = delegator.createSubject(sd); if (log.isTraceEnabled()) { log.trace("Subject=" + subject); log.trace("Subject identity=" + System.identityHashCode(subject)); } return subject; }

Target:
public Subject createSubject(String sd) { Subject subject = delegator.createSubject(sd); if (trace) { log.trace("Subject=" + subject); log.trace("Subject identity=" + Integer.toHexString(System.identityHashCode(subject))); } return subject; }
Source:
private PanmirrorEditingLocation savedEditingLocation() { String location = docUpdateSentinel_.getProperty(RMD_VISUAL_MODE_LOCATION, null); if (StringUtil.isNullOrEmpty(location)) return null; String[] parts = location.split(":"); if (parts.length != 2) return null; try { PanmirrorEditingLocation editingLocation = new PanmirrorEditingLocation(); editingLocation.pos = Integer.parseInt(parts[0]); editingLocation.scrollTop = Integer.parseInt(parts[1]); return editingLocation; } catch(Exception ex) { return null; } }

Target:
private PanmirrorEditingLocation savedEditingLocation() { String location = docUpdateSentinel_.getProperty(RMD_VISUAL_MODE_LOCATION, null); if (StringUtil.isNullOrEmpty(location)) return null; String[] parts = location.split(":"); if (parts.length != 2) return null; try { PanmirrorEditingLocation editingLocation = new PanmirrorEditingLocation(); editingLocation.pos = Integer.parseInt(parts[0]); editingLocation.scrollTop = Integer.parseInt(parts[1]); return editingLocation; } catch(Exception ex) { Debug.logException(ex); return null; } }
Source:
private RepoCollection createCollection(RepoCollection repoCollection, List<InputObject> inputObjects, Operation operation) throws SQLException, RepoException { Integer versionNumber = sqlService.getCollectionNextAvailableVersion(repoCollection.getBucketName(), repoCollection.getKey()); repoCollection.setVersionNumber(versionNumber); repoCollection.setUuid(UUID.randomUUID()); Integer collId = sqlService.insertCollection(repoCollection); if (collId == -1) { throw new RepoException("Error saving content to database"); } List<RepoObject> repoObjectList = new ArrayList<>(); RepoObject repoObject = null; for (InputObject inputObject : inputObjects) { UUID objectUUID = UUIDFormatter.getUuid(inputObject.getUuid()); repoObject = sqlService.getObject(repoCollection.getBucketName(), inputObject.getKey(), null, objectUUID, null); if (repoObject != null) { sqlService.insertCollectionObjects(collId, repoObject.getId()); repoObjectList.add(repoObject); } else { throw new RepoException(RepoException.Type.ObjectCollectionNotFound); } } repoCollection.addObjects(repoObjectList); auditOperation(new Audit.AuditBuilder(repoCollection.getBucketName(), operation) .setKey(repoCollection.getKey()) .setUuid(repoCollection.getUuid()) .build()); return repoCollection; }

Target:
private RepoCollection createCollection(RepoCollection repoCollection, List<InputObject> inputObjects, Operation operation) throws SQLException, RepoException { Integer versionNumber = sqlService.getCollectionNextAvailableVersion(repoCollection.getBucketName(), repoCollection.getKey()); repoCollection.setVersionNumber(versionNumber); repoCollection.setUuid(UUID.randomUUID()); Integer collId = sqlService.insertCollection(repoCollection); if (collId == -1) { throw new RepoException("Error saving content to database"); } List<RepoObject> repoObjectList = new ArrayList<>(); for (InputObject inputObject : inputObjects) { UUID objectUUID = UUIDFormatter.getUuid(inputObject.getUuid()); log.debug("createCollection repoCollection=" + repoCollection.getBucketName() + "," + repoCollection.getKey() + " inputObjects=" + inputObject.getKey() + "," + inputObject.getUuid() + " collId=" + collId + " objectUUID=" + objectUUID.toString()); RepoObject repoObject = sqlService.getObject(repoCollection.getBucketName(), inputObject.getKey(), null, objectUUID, null, true, true); if (repoObject != null) { if (sqlService.insertCollectionObjects(collId, repoObject.getId())) { repoObjectList.add(repoObject); } } else { throw new RepoException(RepoException.Type.ObjectCollectionNotFound); } } repoCollection.addObjects(repoObjectList); auditOperation(new Audit.AuditBuilder(repoCollection.getBucketName(), operation) .setKey(repoCollection.getKey()) .setUuid(repoCollection.getUuid()) .build()); return repoCollection; }
Source:
private void writeBackupTo(FileOutputStream outFileStream) { try { File currentDB = getDatabasePath(PodDBAdapter.DATABASE_NAME); if (currentDB.exists()) { FileChannel src = new FileInputStream(currentDB).getChannel(); FileChannel dst = outFileStream.getChannel(); dst.transferFrom(src, 0, src.size()); src.close(); dst.close(); Snackbar.make(findViewById(R.id.import_export_layout), R.string.export_ok, Snackbar.LENGTH_SHORT).show(); } else { Snackbar.make(findViewById(R.id.import_export_layout), "Can not access current database", Snackbar.LENGTH_SHORT).show(); } } catch (Exception e) { e.printStackTrace(); Snackbar.make(findViewById(R.id.import_export_layout), e.getMessage(), Snackbar.LENGTH_SHORT).show(); } }

Target:
private void writeBackupTo(FileOutputStream outFileStream) { FileChannel src = null; FileChannel dst = null; try { File currentDB = getDatabasePath(PodDBAdapter.DATABASE_NAME); if (currentDB.exists()) { src = new FileInputStream(currentDB).getChannel(); dst = outFileStream.getChannel(); dst.transferFrom(src, 0, src.size()); Snackbar.make(findViewById(R.id.import_export_layout), R.string.export_ok, Snackbar.LENGTH_SHORT).show(); } else { Snackbar.make(findViewById(R.id.import_export_layout), "Can not access current database", Snackbar.LENGTH_SHORT).show(); } } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); Snackbar.make(findViewById(R.id.import_export_layout), e.getLocalizedMessage(), Snackbar.LENGTH_SHORT).show(); } finally { IOUtils.closeQuietly(src); IOUtils.closeQuietly(dst); } }
Source:
public static Map<String, Object> request(OP op, String uri, Map<String, String> headers, Map<String, Object> body, ContentType contentType) throws Exception { switch (op) { case DELETE: return handleRequest(new HttpDelete(uri), headers); case GET: return handleRequest(new HttpGet(uri), headers); case POST: HttpPost post = new HttpPost(uri); if (body != null) { if (contentType == ContentType.MULTIPART_FORM_DATA) { MultipartEntityBuilder builder = MultipartEntityBuilder.create(); for (Map.Entry<String, Object> entry : body.entrySet()) { builder.addTextBody(entry.getKey(), (String) entry.getValue()); } post.setEntity(builder.build()); } else { JSONObject jsonBody = new JSONObject(body); StringEntity strBody = new StringEntity(jsonBody.toJSONString(), ContentType.APPLICATION_JSON); post.setEntity(strBody); } } return handleRequest(post, headers); case PUT: HttpPut put = new HttpPut(uri); if (body != null) { if (contentType == ContentType.MULTIPART_FORM_DATA) { MultipartEntityBuilder builder = MultipartEntityBuilder.create(); for (Map.Entry<String, Object> entry : body.entrySet()) { builder.addTextBody(entry.getKey(), (String) entry.getValue()); } put.setEntity(builder.build()); } else { JSONObject jsonBody = new JSONObject(body); StringEntity strBody = new StringEntity(jsonBody.toJSONString(), ContentType.APPLICATION_JSON); put.setEntity(strBody); } } return handleRequest(put, headers); default: throw new Exception("Unrecognized OP type... Perhaps your binaries are the wrong version?"); } }

Target:
public static Map<String, Object> request(OP op, String uri, Map<String, String> headers, Map<String, Object> body, ContentType contentType) throws Exception { if (!verifyBody(body)) { throw new CandybeanException("Body is not representable as JSON"); } switch (op) { case DELETE: return handleRequest(new HttpDelete(uri), headers); case GET: return handleRequest(new HttpGet(uri), headers); case POST: HttpPost post = new HttpPost(uri); addBodyToRequest(post, body, contentType); return handleRequest(post, headers); case PUT: HttpPut put = new HttpPut(uri); addBodyToRequest(put, body, contentType); return handleRequest(put, headers); default: throw new Exception("Unrecognized OP type... Perhaps your binaries are the wrong version?"); } }
Source:
public EntitlerJobConfig() { this.setJobKey(JOB_KEY) .setJobName(JOB_NAME) .addConstraint(JobConstraints.uniqueByArgument(OWNER_KEY)); }

Target:
public EntitlerJobConfig() { this.setJobKey(JOB_KEY) .setJobName(JOB_NAME) .addConstraint(JobConstraints.uniqueByArguments(CONSUMER_UUID_KEY)); }
Source:
private static boolean checkpointsEqual(BooleanStreamCheckpoint left, BooleanStreamCheckpoint right) { if (left == null && right == null) { return true; } if (left == null || right == null) { return false; } if (left.getOffset() != right.getOffset()) { return false; } ByteStreamCheckpoint leftCheckpoint = left.getByteStreamCheckpoint(); ByteStreamCheckpoint rightCheckpoint = right.getByteStreamCheckpoint(); if (leftCheckpoint == null && rightCheckpoint == null) { return true; } if (leftCheckpoint == null || rightCheckpoint == null) { return false; } return leftCheckpoint.getInputStreamCheckpoint() == rightCheckpoint.getInputStreamCheckpoint() && leftCheckpoint.getOffset() == rightCheckpoint.getOffset(); }

Target:
private static boolean checkpointsEqual(BooleanStreamCheckpoint left, BooleanStreamCheckpoint right) { assertNotNull(left); assertNotNull(right); if (left.getOffset() != right.getOffset()) { return false; } ByteStreamCheckpoint leftCheckpoint = left.getByteStreamCheckpoint(); ByteStreamCheckpoint rightCheckpoint = right.getByteStreamCheckpoint(); assertNotNull(leftCheckpoint); assertNotNull(rightCheckpoint); return leftCheckpoint.getInputStreamCheckpoint() == rightCheckpoint.getInputStreamCheckpoint() && leftCheckpoint.getOffset() == rightCheckpoint.getOffset(); }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("history", history) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("size", history.size()) .toString(); }
Source:
public BlockingChannelInfo(ConnectionPoolConfig config, String host, int port, MetricRegistry registry) { this.config = config; this.blockingChannelAvailableConnections = new ArrayBlockingQueue<BlockingChannel>(config.connectionPoolMaxConnectionsPerHost); this.blockingChannelActiveConnections = new ArrayBlockingQueue<BlockingChannel>(config.connectionPoolMaxConnectionsPerHost); this.numberOfConnections = new AtomicInteger(0); this.rwlock = new ReentrantReadWriteLock(); this.lock = new Object(); this.host = host; this.port = port; this.registry = registry; this.name = host + ":" + port; availableConnections = new Gauge<Integer>() { @Override public Integer getValue() { return blockingChannelAvailableConnections.size(); } }; registry .register(MetricRegistry.name(BlockingChannelInfo.class, name + "availableConnections"), availableConnections); activeConnections = new Gauge<Integer>() { @Override public Integer getValue() { return blockingChannelActiveConnections.size(); } }; registry.register(MetricRegistry.name(BlockingChannelInfo.class, name + "activeConnections"), activeConnections); totalNumberOfConnections = new Gauge<Integer>() { @Override public Integer getValue() { return numberOfConnections.intValue(); } }; registry.register(MetricRegistry.name(BlockingChannelInfo.class, name + "totalNumberOfConnections"), totalNumberOfConnections); logger.info("Starting blocking channel info for host and port {}", host, port); }

Target:
public BlockingChannelInfo(ConnectionPoolConfig config, String host, int port, MetricRegistry registry) { this.config = config; this.blockingChannelAvailableConnections = new ArrayBlockingQueue<BlockingChannel>(config.connectionPoolMaxConnectionsPerHost); this.blockingChannelActiveConnections = new ArrayBlockingQueue<BlockingChannel>(config.connectionPoolMaxConnectionsPerHost); this.numberOfConnections = new AtomicInteger(0); this.rwlock = new ReentrantReadWriteLock(); this.lock = new Object(); this.host = host; this.port = port; this.name = host + ":" + port; availableConnections = new Gauge<Integer>() { @Override public Integer getValue() { return blockingChannelAvailableConnections.size(); } }; registry .register(MetricRegistry.name(BlockingChannelInfo.class, name + "-availableConnections"), availableConnections); activeConnections = new Gauge<Integer>() { @Override public Integer getValue() { return blockingChannelActiveConnections.size(); } }; registry.register(MetricRegistry.name(BlockingChannelInfo.class, name + "-activeConnections"), activeConnections); totalNumberOfConnections = new Gauge<Integer>() { @Override public Integer getValue() { return numberOfConnections.intValue(); } }; registry.register(MetricRegistry.name(BlockingChannelInfo.class, name + "-totalNumberOfConnections"), totalNumberOfConnections); logger.info("Starting blocking channel info for host and port {}", host, port); }
Source:
private Function<Version, Iterable<Broadcast>> toBroadcasts() { return new Function<Version, Iterable<Broadcast>>() { @Override public Iterable<Broadcast> apply(Version input) { return input.getBroadcasts(); } }; }

Target:
private static Function<Version, Iterable<Broadcast>> toBroadcasts() { return new Function<Version, Iterable<Broadcast>>() { @Override public Iterable<Broadcast> apply(Version input) { return input.getBroadcasts(); } }; }
Source:
SlotSharingExecutionSlotAllocator( PhysicalSlotProvider slotProvider, boolean slotWillBeOccupiedIndefinitely, SlotSharingStrategy slotSharingStrategy, SharedSlotProfileRetrieverFactory sharedSlotProfileRetrieverFactory) { this.slotProvider = slotProvider; this.slotWillBeOccupiedIndefinitely = slotWillBeOccupiedIndefinitely; this.slotSharingStrategy = slotSharingStrategy; this.sharedSlotProfileRetrieverFactory = sharedSlotProfileRetrieverFactory; this.sharedSlots = new HashMap<>(); }

Target:
SlotSharingExecutionSlotAllocator( PhysicalSlotProvider slotProvider, boolean slotWillBeOccupiedIndefinitely, SlotSharingStrategy slotSharingStrategy, SharedSlotProfileRetrieverFactory sharedSlotProfileRetrieverFactory) { this.slotProvider = slotProvider; this.slotWillBeOccupiedIndefinitely = slotWillBeOccupiedIndefinitely; this.slotSharingStrategy = slotSharingStrategy; this.sharedSlotProfileRetrieverFactory = sharedSlotProfileRetrieverFactory; this.sharedSlots = new IdentityHashMap<>(); }
Source:
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) { if (sharedPref.getBoolean("settings_clear_backbuffer_on_track_change", true)) { backBuffer.clear(); } }

Target:
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) { }
Source:
private void setPartitionStatus(int partitionID, int state, String description) { String itemName; itemName = getItemName(DSCAlarmItemType.PARTITION_STATUS, partitionID, 0); if (itemName != "") { updateItem(itemName, state, description); } }

Target:
private void setPartitionStatus(int partitionID, int state, String description) { String itemName; itemName = getItemName(DSCAlarmItemType.PARTITION_STATUS, partitionID, 0); if (StringUtils.isNotEmpty(itemName)) { updateItem(itemName, state, description); } }