auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateDeploymentConfigValues(IReplicationController replicationController, DebuggingContext debugContext) { Collection<IContainer> originalContainers = replicationController.getContainers(); if (originalContainers != null && !originalContainers.isEmpty() && debugContext.isDebugEnabled()) { Collection<IContainer> containers = new ArrayList<>(originalContainers); IContainer container = containers.iterator().next(); Set<IPort> ports = new HashSet<>(container.getPorts()); IPort existing = ports.stream().filter(p -> p.getContainerPort() == debugContext.getDebugPort()) .findFirst().orElse(null); boolean added = false; if (existing == null) { PortSpecAdapter newPort = new PortSpecAdapter("debug", "TCP", debugContext.getDebugPort()); added = ports.add(newPort); } else { PortSpecAdapter newPort = new PortSpecAdapter(existing.getName(), existing.getProtocol(), debugContext.getDebugPort()); if (!existing.equals(newPort)) { ports.remove(existing); added = ports.add(newPort); } } if (added) { container.setPorts(ports); replicationController.setContainers(containers); } } if (debugContext.isDebugEnabled()) { replicationController.setEnvironmentVariable(DEBUG_PORT_KEY, String.valueOf(debugContext.getDebugPort())); } else { replicationController.setEnvironmentVariable(DEBUG_PORT_KEY, ""); } replicationController.setEnvironmentVariable(DEBUG_KEY, String.valueOf(debugContext.isDebugEnabled())); }

Target:
private void updateDeploymentConfigValues(IReplicationController replicationController, DebuggingContext debugContext) { Collection<IContainer> originalContainers = replicationController.getContainers(); if (originalContainers != null && !originalContainers.isEmpty() && debugContext.isDebugEnabled()) { Collection<IContainer> containers = new ArrayList<>(originalContainers); IContainer container = containers.iterator().next(); Set<IPort> ports = new HashSet<>(container.getPorts()); IPort existing = ports.stream().filter(p -> p.getContainerPort() == debugContext.getDebugPort()) .findFirst().orElse(null); boolean added = false; if (existing == null) { PortSpecAdapter newPort = new PortSpecAdapter("debug", "TCP", debugContext.getDebugPort()); added = ports.add(newPort); } else { PortSpecAdapter newPort = new PortSpecAdapter(existing.getName(), existing.getProtocol(), debugContext.getDebugPort()); if (!existing.equals(newPort)) { ports.remove(existing); added = ports.add(newPort); } } if (added) { container.setPorts(ports); replicationController.setContainers(containers); } } if (debugContext.isDebugEnabled()) { replicationController.setEnvironmentVariable(DEBUG_PORT_KEY, String.valueOf(debugContext.getDebugPort())); } else { replicationController.removeEnvironmentVariable(DEBUG_PORT_KEY); } replicationController.setEnvironmentVariable(DEBUG_KEY, String.valueOf(debugContext.isDebugEnabled())); }
Source:
protected Wallet createWallet(boolean isBsqWallet) { Script.ScriptType preferredOutputScriptType = isBsqWallet ? Script.ScriptType.P2PKH : Script.ScriptType.P2PKH; KeyChainGroupStructure structure = new BisqKeyChainGroupStructure(isBsqWallet); KeyChainGroup.Builder kcg = KeyChainGroup.builder(params, structure); if (restoreFromSeed != null) kcg.fromSeed(restoreFromSeed, preferredOutputScriptType).build(); else if (restoreFromKey != null) kcg.addChain(DeterministicKeyChain.builder().spend(restoreFromKey).outputScriptType(preferredOutputScriptType).build()); else kcg.fromRandom(preferredOutputScriptType); if (walletFactory != null) { return walletFactory.create(params, kcg.build()); } else { return new Wallet(params, kcg.build()); } }

Target:
protected Wallet createWallet(boolean isBsqWallet) { Script.ScriptType preferredOutputScriptType = Script.ScriptType.P2PKH; KeyChainGroupStructure structure = new BisqKeyChainGroupStructure(isBsqWallet); KeyChainGroup.Builder kcg = KeyChainGroup.builder(params, structure); if (restoreFromSeed != null) { kcg.fromSeed(restoreFromSeed, preferredOutputScriptType).build(); } else if (restoreFromKey != null) { kcg.addChain(DeterministicKeyChain.builder().spend(restoreFromKey).outputScriptType(preferredOutputScriptType).build()); } else { if (!isBsqWallet) { kcg.fromRandom(preferredOutputScriptType); } else { kcg.fromSeed(vBtcWallet.getKeyChainSeed(), preferredOutputScriptType); } } if (walletFactory != null) { return walletFactory.create(params, kcg.build()); } else { return new Wallet(params, kcg.build()); } }
Source:
public void testSkipKeyValueIteratorCorrectness() { Header[] headers = {new RecordHeader("k1", "v1".getBytes()), new RecordHeader("k2", "v2".getBytes())}; MemoryRecords records = MemoryRecords.withRecords(RecordBatch.MAGIC_VALUE_V2, 0L, CompressionType.LZ4, TimestampType.CREATE_TIME, new SimpleRecord(1L, "a".getBytes(), "1".getBytes()), new SimpleRecord(2L, "b".getBytes(), "2".getBytes()), new SimpleRecord(3L, "c".getBytes(), "3".getBytes()), new SimpleRecord(1000L, "abc".getBytes(), "0".getBytes()), new SimpleRecord(9999L, "abc".getBytes(), "0".getBytes(), headers) ); DefaultRecordBatch batch = new DefaultRecordBatch(records.buffer()); try (CloseableIterator<Record> streamingIterator = batch.skipKeyValueIterator()) { assertEquals(Arrays.asList( new PartialDefaultRecord(9, (byte) 0, 0L, 1L, -1, 1, 1), new PartialDefaultRecord(9, (byte) 0, 1L, 2L, -1, 1, 1), new PartialDefaultRecord(9, (byte) 0, 2L, 3L, -1, 1, 1), new PartialDefaultRecord(12, (byte) 0, 3L, 1000L, -1, 3, 1), new PartialDefaultRecord(25, (byte) 0, 4L, 9999L, -1, 3, 1) ), Utils.toList(streamingIterator) ); } }

Target:
public void testSkipKeyValueIteratorCorrectness() { Header[] headers = {new RecordHeader("k1", "v1".getBytes()), new RecordHeader("k2", "v2".getBytes())}; MemoryRecords records = MemoryRecords.withRecords(RecordBatch.MAGIC_VALUE_V2, 0L, CompressionType.LZ4, TimestampType.CREATE_TIME, new SimpleRecord(1L, "a".getBytes(), "1".getBytes()), new SimpleRecord(2L, "b".getBytes(), "2".getBytes()), new SimpleRecord(3L, "c".getBytes(), "3".getBytes()), new SimpleRecord(1000L, "abc".getBytes(), "0".getBytes()), new SimpleRecord(9999L, "abc".getBytes(), "0".getBytes(), headers) ); DefaultRecordBatch batch = new DefaultRecordBatch(records.buffer()); try (CloseableIterator<Record> streamingIterator = batch.skipKeyValueIterator(BufferSupplier.NO_CACHING)) { assertEquals(Arrays.asList( new PartialDefaultRecord(9, (byte) 0, 0L, 1L, -1, 1, 1), new PartialDefaultRecord(9, (byte) 0, 1L, 2L, -1, 1, 1), new PartialDefaultRecord(9, (byte) 0, 2L, 3L, -1, 1, 1), new PartialDefaultRecord(12, (byte) 0, 3L, 1000L, -1, 3, 1), new PartialDefaultRecord(25, (byte) 0, 4L, 9999L, -1, 3, 1) ), Utils.toList(streamingIterator) ); } }
Source:
void createStreams(String planId, List<StreamSpec> intStreams) throws TimeoutException { if (intStreams.isEmpty()) { LOG.info("Set of intermediate streams is empty. Nothing to create."); System.out.println("1"); return; } String coordinationId = new ApplicationConfig(config).getGlobalAppId() + APPLICATION_RUNNER_ZK_PATH_SUFFIX; CoordinationUtils coordinationUtils = CoordinationUtilsFactory.getCoordinationUtilsFactory(config).getCoordinationUtils(coordinationId, uid, config); System.out.println(" create streams." + uid); if (coordinationUtils == null) { getStreamManager().createStreams(intStreams); System.out.println("failed to create utils" + uid); return; } DistributedLockWithState lockWithState = coordinationUtils.getLockWithState(planId); System.out.println("Init NEEDED for streams" + uid); try { if (lockWithState.lockIfNotSet(1000, TimeUnit.MILLISECONDS)) { System.out.println("CREATING STREAMS" + uid); getStreamManager().createStreams(intStreams); lockWithState.unlockAndSet(); } else { System.out.println("SOMEONE ELSE CREATING STREAMS" + uid); } } catch (TimeoutException e) { LOG.error("Failed to get the lock for stream initialization"); } finally { lockWithState.close(); } }

Target:
void createStreams(String planId, List<StreamSpec> intStreams) throws TimeoutException { if (intStreams.isEmpty()) { LOG.info("Set of intermediate streams is empty. Nothing to create."); return; } LOG.info("A single processor must create the intermediate streams. Processor will attempt to acquire the lock.", uid); String coordinationId = new ApplicationConfig(config).getGlobalAppId() + APPLICATION_RUNNER_PATH_SUFFIX; CoordinationUtils coordinationUtils = CoordinationUtilsFactory.getCoordinationUtilsFactory(config).getCoordinationUtils(coordinationId, uid, config); if (coordinationUtils == null) { LOG.warn("Processor failed to create utils. Each processor will attempt to create streams.", uid); getStreamManager().createStreams(intStreams); return; } DistributedLockWithState lockWithState = coordinationUtils.getLockWithState(planId); try { if (lockWithState.lockIfNotSet(1000, TimeUnit.MILLISECONDS)) { LOG.info("lock acquired for streams creation by " + uid); getStreamManager().createStreams(intStreams); lockWithState.unlockAndSet(); } else { LOG.info("Processor did not obtain the lock for streams creation. They must've been created by another processor.", uid); } } catch (TimeoutException e) { String msg = String.format("Processor failed to get the lock for stream initialization", uid); throw new SamzaException(msg, e); } finally { coordinationUtils.close(); } }
Source:
private static Block projectWithYield(PageProjectionOutput output, DriverYieldSignal yieldSignal) { for (int i = 0; i < 10; i++) { yieldSignal.setWithDelay(1, executor); yieldSignal.forceYieldForTesting(); assertFalse(output.compute().isPresent()); yieldSignal.reset(); } return output.compute().orElseThrow(IllegalStateException::new); }

Target:
private static Block projectWithYield(PageProjectionOutput output, DriverYieldSignal yieldSignal) { int yieldCount = 0; while (true) { yieldSignal.setWithDelay(1, executor); yieldSignal.forceYieldForTesting(); Optional<Block> block = output.compute(); if (block.isPresent()) { assertGreaterThan(yieldCount, 0); return block.get(); } yieldCount++; if (yieldCount > 1_000_000) { fail("projection is not making progress"); } yieldSignal.reset(); } }
Source:
public static Pipeline buildPipeline(HBaseExportOptions options) throws IOException { if(options.getDiskSizeGb() == 0) { options.setDiskSizeGb(20); } if(options.getBigtableProjectId() == null) { options.setBigtableProjectId(options.getProject()); } final Scan scan = new Scan() .setStartRow(options.getStartRow().getBytes()) .setStopRow(options.getStopRow().getBytes()) .setMaxVersions(options.getMaxVersions()); if (!options.getFilter().isEmpty()) { scan.setFilter(new ParseFilter().parseFilterString(options.getFilter())); } final String bigtableProject = Objects.firstNonNull(options.getBigtableProjectId(), options.getProject()); final CloudBigtableScanConfiguration scanConfig = new CloudBigtableScanConfiguration.Builder() .withProjectId(bigtableProject) .withInstanceId(options.getBigtableInstanceId()) .withTableId(options.getBigtableTableId()) .withScan(scan) .build(); final BoundedSource<Result> source = CloudBigtableIO.read(scanConfig); final Pipeline pipeline = Pipeline.create(options); final SerializableCoder<BoundedSource<Result>> sourceCoder = SerializableCoder.of(new TypeDescriptor<BoundedSource<Result>>() {}); final KvCoder<String, BoundedSource<Result>> kvCoder = KvCoder.of(StringUtf8Coder.of(), sourceCoder); pipeline .apply("Initialize", Create.of(source).withCoder(sourceCoder)) .apply("Shard", ParDo.of(new ShardScans<Result>())).setCoder(kvCoder) .apply("Fanout", Reshuffle.<String, BoundedSource<Result>>of()) .apply("Write", ParDo.of(new WriteResultsToSeq(options.getDestination()))); return pipeline; }

Target:
public static Pipeline buildPipeline(HBaseExportOptions options) throws IOException { if (options.getDiskSizeGb() == 0) { options.setDiskSizeGb(20); } if (options.getBigtableProjectId() == null) { options.setBigtableProjectId(options.getProject()); } final Scan scan = new Scan() .setStartRow(options.getStartRow().getBytes()) .setStopRow(options.getStopRow().getBytes()) .setMaxVersions(options.getMaxVersions()); if (!options.getFilter().isEmpty()) { scan.setFilter(new ParseFilter().parseFilterString(options.getFilter())); } final String bigtableProject = Objects.firstNonNull(options.getBigtableProjectId(), options.getProject()); final CloudBigtableScanConfiguration scanConfig = new CloudBigtableScanConfiguration.Builder() .withProjectId(bigtableProject) .withInstanceId(options.getBigtableInstanceId()) .withTableId(options.getBigtableTableId()) .withScan(scan) .build(); return buildPipeline(options, scanConfig, options.getDestination()); }
Source:
public String loadPreviousInput() { MetadataMap filters = (MetadataMap) getSession().getAttribute(FILTER_INPUTS); if (filters == null) return null; else if (filters.get(dataProvider.getClass().getName()) == null) return null; return (String) filters.get(dataProvider.getClass().getName()); }

Target:
private String loadPreviousInput() { MetadataMap filters = getMetaDataMapFromSession(FILTER_INPUTS); if (filters == null) return null; else if (filters.get(dataProvider.getClass().getName(), String.class) == null) return null; return filters.get(dataProvider.getClass().getName(), String.class); }
Source:
public File findArtifact(org.mule.maven.client.api.model.BundleDescriptor bundleDescriptor) { if (checkArtifact(bundleDescriptor)) { if (bundleDescriptor.getType().equals("pom")) { return pomFile; } else { return artifactFile; } } return null; }

Target:
public File findArtifact(org.mule.maven.client.api.model.BundleDescriptor bundleDescriptor) { if (checkArtifact(bundleDescriptor)) { if (bundleDescriptor.getType().equals(POM)) { return pomFile; } else { return artifactFile; } } return null; }
Source:
public void deferred() throws Exception { tester.getApplication().setHeaderResponseDecorator(new IHeaderResponseDecorator() { @Override public IHeaderResponse decorate(IHeaderResponse response) { return new ResourceAggregator(new JavaScriptDeferHeaderResponse(response)); } }); executeTest(DeferredPage.class, "DeferredPageExpected.html"); }

Target:
public void deferred() throws Exception { tester.getApplication().setHeaderResponseDecorator(response -> new ResourceAggregator(new JavaScriptDeferHeaderResponse(response))); executeTest(DeferredPage.class, "DeferredPageExpected.html"); }
Source:
public int compare(IPath arg0, IPath arg1) { if (arg0.equals(arg1)) { return 0; } int res = 0; if (arg0.getDevice() != null && arg1.getDevice() == null) { return +1; } if (arg0.getDevice() == null && arg1.getDevice() != null) { return -1; } if (arg0.getDevice() != null && arg1.getDevice() != null) { res = arg0.getDevice().compareTo(arg1.getDevice()); if (res != 0) { return res; } } res = Boolean.compare(arg0.isAbsolute(), arg1.isAbsolute()); if (res != 0) { return res; } res = Boolean.compare(arg0.isUNC(), arg1.isUNC()); if (res != 0) { return res; } for (int i = 0; i < Math.min(arg0.segmentCount(), arg1.segmentCount()); i++) { res = arg0.segment(i).compareTo(arg1.segment(i)); if (res != 0) { return res; } } return arg0.segmentCount() - arg1.segmentCount(); }

Target:
public int compare(IPath arg0, IPath arg1) { if (arg0 == arg1) { return 0; } int res = 0; String device0 = arg0.getDevice(); String device1 = arg1.getDevice(); if (device0 != null && device1 == null) { return +1; } if (device0 == null && device1 != null) { return -1; } if (device0 != null && device1 != null) { res = device0.compareTo(device1); if (res != 0 && !device0.equalsIgnoreCase(device1)) { return res; } } res = Boolean.compare(arg0.isAbsolute(), arg1.isAbsolute()); if (res != 0) { return res; } res = Boolean.compare(arg0.isUNC(), arg1.isUNC()); if (res != 0) { return res; } for (int i = 0; i < Math.min(arg0.segmentCount(), arg1.segmentCount()); i++) { res = arg0.segment(i).compareTo(arg1.segment(i)); if (res != 0) { return res; } } return arg0.segmentCount() - arg1.segmentCount(); }
Source:
private void performActionForServicesOfCluster() { List<VDS> servers = getClusterUtils().getAllUpServers(clusterId); List<GlusterServerService> serviceList = null; List<Callable<Pair<VDS, VDSReturnValue>>> taskList = new ArrayList<Callable<Pair<VDS, VDSReturnValue>>>(); for (final VDS upServer : servers) { serviceList = getGlusterServerServiceDao().getByServerId(upServer.getId()); final List<String> serviceListStr = new ArrayList<String>(); for (GlusterServerService srvc : serviceList) { serviceListStr.add(srvc.getServiceName()); } taskList.add(new Callable<Pair<VDS, VDSReturnValue>>() { @Override public Pair<VDS, VDSReturnValue> call() throws Exception { VDSReturnValue returnValue = runVdsCommand( manageActionDetailsMap.get(getParameters().getActionType()).getVdsCmdType(), new GlusterServiceVDSParameters(upServer.getId(), serviceListStr, actionType)); return new Pair<VDS, VDSReturnValue>(upServer, returnValue); } }); } boolean atLeastOneSuccess = false; List<Pair<VDS, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(taskList); for (Pair<VDS, VDSReturnValue> pairResult : pairResults) { VDSReturnValue retValue = pairResult.getSecond(); if (retValue.getSucceeded()) { atLeastOneSuccess = true; updateService(serviceList, pairResult); } else { errors.add(retValue.getVdsError().getMessage()); } } setSucceeded(atLeastOneSuccess); if (errors.size() > 0) { handleVdsErrors(getAuditLogTypeValue(), errors); addCustomValue(GlusterConstants.FAILURE_MESSAGE, StringUtils.join(errors, SystemUtils.LINE_SEPARATOR)); } else { setSucceeded(true); } }

Target:
private void performActionForServicesOfCluster() { List<VDS> servers = getClusterUtils().getAllUpServers(clusterId); final List<GlusterService> serviceList = getServiceList(); List<Callable<Pair<VDS, VDSReturnValue>>> taskList = new ArrayList<Callable<Pair<VDS, VDSReturnValue>>>(); for (final VDS upServer : servers) { final List<String> serviceListStr = new ArrayList<String>(); for (GlusterService srvc : serviceList) { serviceListStr.add(srvc.getServiceName()); } taskList.add(new Callable<Pair<VDS, VDSReturnValue>>() { @Override public Pair<VDS, VDSReturnValue> call() throws Exception { VDSReturnValue returnValue; returnValue = runVdsCommand( VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(upServer.getId(), serviceListStr, actionType)); Pair<VDS, VDSReturnValue> pairRetVal = new Pair<VDS, VDSReturnValue>(upServer, returnValue); if (returnValue.getSucceeded()) updateService(upServer.getId(), serviceList, pairRetVal); return pairRetVal; } }); } setSucceeded(true); if (!taskList.isEmpty()) { List<Pair<VDS, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(taskList); for (Pair<VDS, VDSReturnValue> pairResult : pairResults) { VDSReturnValue retValue = pairResult.getSecond(); if (!retValue.getSucceeded()) { errors.add(retValue.getVdsError().getMessage()); } } } else { setSucceeded(false); } if (errors.size() > 0) { setSucceeded(false); handleVdsErrors(getAuditLogTypeValue(), errors); addCustomValue(GlusterConstants.FAILURE_MESSAGE, StringUtils.join(errors, SystemUtils.LINE_SEPARATOR)); } else { setSucceeded(true); } }
Source:
protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { if (caseSensitive) { Schema s = schema.getSubSchema(schemaName); if (s != null) { return new SimpleCalciteSchema(this, s, schemaName); } } else { final String schemaName2 = caseInsensitiveLookup( schema.getSubSchemaNames(), schemaName); if (schemaName2 != null) { return new SimpleCalciteSchema(this, schema.getSubSchema(schemaName2), schemaName2); } } return null; }

Target:
protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { final String schemaName2 = caseSensitive ? schemaName : caseInsensitiveLookup( schema.getSubSchemaNames(), schemaName); if (schemaName2 == null) { return null; } final Schema s = schema.getSubSchema(schemaName2); if (s == null) { return null; } return new SimpleCalciteSchema(this, s, schemaName2); }
Source:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable key, value, qmc; try { abvs.reset(); ob.reset(abvs); int len = args.length; pointables = new TaggedValuePointable[len / 3]; for (int i = 0; i < len; i += 3) { key = args[i]; value = args[i + 1]; qmc = args[i + 2]; if (!isDuplicate(key)) { pointables[i / 3] = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable(); key.getValue(pointables[i / 3]); sp.set(vp); if (value.getTag() == ValueTag.SEQUENCE_TAG) { qmc.getValue(bp); value.getValue(seqp); if (bp.getBoolean()) { continue; } if (seqp.getEntryCount() == 0) { XDMConstants.setJsNull(value); ob.addItem(sp, value); } else { abvs1.reset(); ab.reset(abvs1); int l = seqp.getEntryCount(); for (int j = 0; j < l; j++) { seqp.getEntry(j, value); ab.addItem(value); } ab.finish(); vp.set(abvs1); ob.addItem(sp, vp); } } else { ob.addItem(sp, value); } } else { throw new SystemException(ErrorCode.JNDY0003); } } ob.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } }

Target:
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable key, value, qmc; try { abvs.reset(); ob.reset(abvs); int len = args.length; pointables = new TaggedValuePointable[len / 3]; for (int i = 0; i < len; i += 3) { key = args[i]; value = args[i + 1]; qmc = args[i + 2]; if (!isDuplicate(key)) { pointables[i / 3] = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable(); key.getValue(pointables[i / 3]); sp.set(vp); if (value.getTag() == ValueTag.SEQUENCE_TAG) { qmc.getValue(bp); value.getValue(seqp); if (seqp.getEntryCount() == 0) { if (bp.getBoolean()) { continue; } XDMConstants.setJsNull(value); ob.addItem(sp, value); } else { abvs1.reset(); ab.reset(abvs1); int l = seqp.getEntryCount(); for (int j = 0; j < l; j++) { seqp.getEntry(j, value); ab.addItem(value); } ab.finish(); vp.set(abvs1); ob.addItem(sp, vp); } } else { ob.addItem(sp, value); } } else { throw new SystemException(ErrorCode.JNDY0003); } } ob.finish(); result.set(abvs); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } }
Source:
public LabelMetadataBuilder(String ID, String description) { super(ID); this.description = description; this.priority = Integer.MAX_VALUE; }

Target:
public LabelMetadataBuilder(String ID, String description) { this(ID, description, Integer.MAX_VALUE); }
Source:
public static List<FileFormat> getFileFormats() throws IOException, JAXBException { KitodoServiceLoader<FileManagementInterface> fileManagementInterface = new KitodoServiceLoader<>( FileManagementInterface.class); try (InputStream bytes = fileManagementInterface.loadModule().read(CONFIG_FILE_URI)) { Unmarshaller fileFormatsConfig = JAXBContext.newInstance(FileFormatsConfig.class).createUnmarshaller(); FileFormatsConfig read = (FileFormatsConfig) fileFormatsConfig.unmarshal(bytes); return read.fileFormat; } }

Target:
public static List<FileFormat> getFileFormats() throws IOException, JAXBException { Unmarshaller fileFormatsConfig = JAXBContext.newInstance(FileFormatsConfig.class).createUnmarshaller(); FileFormatsConfig read = (FileFormatsConfig) fileFormatsConfig.unmarshal(CONFIG_FILE); return read.fileFormat; }
Source:
public void onShowPostPopup(View view, final ReaderPost post) { if (view == null || post == null || !isAdded()) { return; } Context context = view.getContext(); final ListPopupWindow listPopup = new ListPopupWindow(context); listPopup.setAnchorView(view); listPopup.setWidth(context.getResources().getDimensionPixelSize(R.dimen.menu_item_width)); listPopup.setModal(true); List<Integer> menuItems = new ArrayList<>(); boolean isFollowed = ReaderPostTable.isPostFollowed(post); if (isFollowed) { menuItems.add(ReaderMenuAdapter.ITEM_UNFOLLOW); } else { menuItems.add(ReaderMenuAdapter.ITEM_FOLLOW); } if (getPostListType() == ReaderPostListType.TAG_FOLLOWED) { menuItems.add(ReaderMenuAdapter.ITEM_BLOCK); } listPopup.setAdapter(new ReaderMenuAdapter(context, menuItems)); listPopup.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (!isAdded()) { return; } listPopup.dismiss(); switch ((int) id) { case ReaderMenuAdapter.ITEM_FOLLOW: showPostNotificationsSnackbar(post); case ReaderMenuAdapter.ITEM_UNFOLLOW: toggleFollowStatusForPost(post); break; case ReaderMenuAdapter.ITEM_BLOCK: blockBlogForPost(post); break; } } }); listPopup.show(); }

Target:
public void onShowPostPopup(View view, final ReaderPost post) { if (view == null || post == null || !isAdded()) { return; } Context context = view.getContext(); final ListPopupWindow listPopup = new ListPopupWindow(context); listPopup.setAnchorView(view); listPopup.setWidth(context.getResources().getDimensionPixelSize(R.dimen.menu_item_width)); listPopup.setModal(true); List<Integer> menuItems = new ArrayList<>(); boolean isFollowed = ReaderPostTable.isPostFollowed(post); if (isFollowed) { menuItems.add(ReaderMenuAdapter.ITEM_UNFOLLOW); } else { menuItems.add(ReaderMenuAdapter.ITEM_FOLLOW); } if (getPostListType() == ReaderPostListType.TAG_FOLLOWED) { menuItems.add(ReaderMenuAdapter.ITEM_BLOCK); } listPopup.setAdapter(new ReaderMenuAdapter(context, menuItems)); listPopup.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (!isAdded()) { return; } listPopup.dismiss(); switch ((int) id) { case ReaderMenuAdapter.ITEM_FOLLOW: case ReaderMenuAdapter.ITEM_UNFOLLOW: toggleFollowStatusForPost(post); break; case ReaderMenuAdapter.ITEM_BLOCK: blockBlogForPost(post); break; } } }); listPopup.show(); }
Source:
public static List<FunctionCall> extractSupportedSpatialFunctions(Expression filterExpression) { ImmutableList.Builder<FunctionCall> spatialFunctions = ImmutableList.builder(); List<Expression> conjuncts = extractConjuncts(filterExpression); for (Expression expression : conjuncts) { if (expression instanceof FunctionCall) { FunctionCall function = (FunctionCall) expression; if (isSupportedSpatialFunction(function)) { spatialFunctions.add(function); } } } return spatialFunctions.build(); }

Target:
public static List<FunctionCall> extractSupportedSpatialFunctions(Expression filterExpression) { return extractConjuncts(filterExpression).stream() .filter(FunctionCall.class::isInstance) .map(FunctionCall.class::cast) .filter(SpatialJoinUtils::isSupportedSpatialFunction) .collect(toImmutableList()); }
Source:
protected void clientInit() { CommonHelper.assertNotBlank("scope", getConfiguration().getScope()); CommonHelper.assertNotBlank("fields", getConfiguration().getFields()); configuration.setApi(LinkedInApi20.instance()); configuration.setProfileDefinition(new LinkedIn2ProfileDefinition()); configuration.setWithState(true); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> error = ctx.getRequestParameter(OAuthCredentialsException.ERROR); final Optional<String> errorDescription = ctx.getRequestParameter(OAuthCredentialsException.ERROR_DESCRIPTION); if ("access_denied".equals(error.orElse(null)) && ("the+user+denied+your+request".equals(errorDescription.orElse(null)) || "the user denied your request" .equals(errorDescription))) { return true; } else { return false; } }); defaultLogoutActionBuilder((ctx, profile, targetUrl) -> Optional.of(RedirectAction.redirect("<LINK_0>")) ); super.clientInit(); }

Target:
protected void clientInit() { CommonHelper.assertNotBlank("scope", getConfiguration().getScope()); CommonHelper.assertNotBlank("fields", getConfiguration().getFields()); configuration.setApi(LinkedInApi20.instance()); configuration.setProfileDefinition(new LinkedIn2ProfileDefinition()); configuration.setWithState(true); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> error = ctx.getRequestParameter(OAuthCredentialsException.ERROR); final Optional<String> errorDescription = ctx.getRequestParameter(OAuthCredentialsException.ERROR_DESCRIPTION); return error.map(e -> "access_denied".equals(e)).orElse(false) && errorDescription.map( e -> "the+user+denied+your+request".equals(e) || "the user denied your request".equals(e) ).orElse(false); }); defaultLogoutActionBuilder((ctx, profile, targetUrl) -> Optional.of(RedirectAction.redirect("<LINK_0>")) ); super.clientInit(); }
Source:
public JSONObject toJSON() { JSONObject event = new JSONObject(); event.put("user", this.user == null ? null : this.user.getName()); event.put("ip", this.ip); event.put("action", this.action); event.put("extra", this.extra); event.put("entity", this.entity == null ? null : this.entity.getName()); event.put("time", this.time == null ? null : this.time.toString()); return event; }

Target:
public JSONObject toJSON() { JSONObject event = new JSONObject(); event.put("user", this.user == null ? null : this.user.getId()); event.put("ip", this.ip); event.put("action", this.action); event.put("extra", this.extra); event.put("entity", this.entity == null ? null : this.entity.toString()); event.put("time", this.time == null ? null : this.time.toInstant().toString()); return event; }
Source:
public ImageCard(String webUrl) throws CardBuilderException { this.cardType = CardType.IMAGE; webUrl(webUrl); MetaTagModel metaTagModel = MetaTagExtractor.getMetaTags(this.webUrl); media(new Image(metaTagModel)); }

Target:
public ImageCard(String webUrl) throws CardBuilderException { super(webUrl); this.cardType = CardType.IMAGE; media(new Image(this.getMetaTagModel())); }
Source:
private void basicCRUD(Realm realm) { showStatus("Perform basic Create/Read/Update/Delete (CRUD) operations..."); RealmResults<Person> persons = realm.where(Person.class).findAll(); persons.addChangeListener((people, changeSet) -> { if(changeSet == null) { return; } String insertions = changeSet.getInsertions().length == 0 ? "" : "\n - Insertions: " + Arrays.toString(changeSet.getInsertions()); String deletions = changeSet.getDeletions().length == 0 ? "" : "\n - Deletions: " + Arrays.toString(changeSet.getDeletions()); String changes = changeSet.getChanges().length == 0 ? "" : "\n - Changes: " + Arrays.toString(changeSet.getChanges()); showStatus("Person was written to: " + insertions + deletions + changes + "]"); }); realm.executeTransaction(r -> { Person person = r.createObject(Person.class, 1); person.setName("Young Person"); person.setAge(14); person.getPhoneNumbers().add("+1 123 4567"); }); final Person person = realm.where(Person.class).findFirst(); showStatus(person.getName() + ":" + person.getAge()); realm.executeTransaction(r -> { person.setName("Senior Person"); person.setAge(99); showStatus(person.getName() + " got older: " + person.getAge()); }); showStatus("Deleting all persons"); realm.executeTransaction(r -> r.delete(Person.class)); }

Target:
private void basicCRUD(Realm realm) { showStatus("Perform basic Create/Read/Update/Delete (CRUD) operations..."); realm.executeTransaction(r -> { Person person = r.createObject(Person.class, 1); person.setName("Young Person"); person.setAge(14); person.getPhoneNumbers().add("+1 123 4567"); }); final Person person = realm.where(Person.class).findFirst(); showStatus(person.getName() + ":" + person.getAge()); realm.executeTransaction(r -> { person.setName("Senior Person"); person.setAge(99); showStatus(person.getName() + " got older: " + person.getAge()); }); showStatus("Deleting all persons"); realm.executeTransaction(r -> r.delete(Person.class)); }
Source:
public final void run() { try { runInternal(); } catch (NativeOutOfMemoryError e) { e.printStackTrace(); } }

Target:
public final void run() { int size = mapEntries != null ? mapEntries.size() : 0; int currentIndex = 0; while (currentIndex < size) { Data dataKey = mapEntries.getKey(currentIndex); Data value = mapEntries.getValue(currentIndex); put(dataKey, value); currentIndex++; } }
Source:
private void shrink(int delta) { Collection<Entity> removedEntities = Lists.newArrayList(); for (int i = 0; i < (delta*-1); i++) { removedEntities.add(removeNode()); } Task<List<Void>> invoke = Entities.invokeEffectorList(this, removedEntities, Startable.STOP, Collections.<String,Object>emptyMap()); try { invoke.get(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw Throwables.propagate(e); } catch (ExecutionException e) { throw Throwables.propagate(e); } }

Target:
private void shrink(int delta) { Collection<Entity> removedEntities = Lists.newArrayList(); for (int i = 0; i < (delta*-1); i++) { removedEntities.add(pickAndRemoveMember()); } Task<List<Void>> invoke = Entities.invokeEffectorList(this, removedEntities, Startable.STOP, Collections.<String,Object>emptyMap()); try { invoke.get(); } catch (Exception e) { throw Exceptions.propagate(e); } finally { for (Entity removedEntity : removedEntities) { discardNode(removedEntity); } } }
Source:
public void setGlobalTargetTaskThreadPoolSize(int globalTargetTaskThreadPoolSize) throws IllegalArgumentException { if (globalTargetTaskThreadPoolSize <= 0) { throw new IllegalArgumentException("globalTargetTaskThreadPoolSize must be greater than 0!"); } _record .setIntField(ClusterConfig.ClusterConfigProperty.GLOBAL_TARGET_TASK_THREAD_POOL_SIZE.name(), globalTargetTaskThreadPoolSize); }

Target:
public void setGlobalTargetTaskThreadPoolSize(int globalTargetTaskThreadPoolSize) throws IllegalArgumentException { if (globalTargetTaskThreadPoolSize < 0) { throw new IllegalArgumentException("globalTargetTaskThreadPoolSize must be non-negative!"); } _record .setIntField(ClusterConfig.ClusterConfigProperty.GLOBAL_TARGET_TASK_THREAD_POOL_SIZE.name(), globalTargetTaskThreadPoolSize); }
Source:
ProposalStats() { final MetricRegistry metrics = new MetricRegistry(); Reservoir reservoir = new ExponentiallyDecayingReservoir(); proposalSizes = new Histogram(reservoir); metrics.register(name(CommonNames.DOMAIN, "Leader", "proposalSize"), proposalSizes); final JmxReporter jmxReporter = JmxReporter.forRegistry(metrics).registerWith(MBeanRegistry.getInstance().getPlatformMBeanServer()).build(); jmxReporter.start(); }

Target:
ProposalStats() { final MetricRegistry metrics = new MetricRegistry(); long winSize = getWindowSizeInMinutes(); Reservoir reservoir = new SlidingTimeWindowArrayReservoir(winSize, TimeUnit.MINUTES); LOG.info("Initialized histogram sliding window size to minutes", winSize); proposalSizes = new Histogram(reservoir); metrics.register(name(CommonNames.DOMAIN, "Leader", "proposalSize"), proposalSizes); final JmxReporter jmxReporter = JmxReporter.forRegistry(metrics).registerWith(MBeanRegistry.getInstance().getPlatformMBeanServer()).build(); jmxReporter.start(); }
Source:
private ContentType getContentType(Request request) { ContentType contentType = ContentType.DEFAULT_TEXT; for (Map.Entry<String, Collection<String>> entry : request.headers().entrySet()) if (entry.getKey().equalsIgnoreCase("Content-Type")) { Collection<String> values = entry.getValue(); if (values != null && !values.isEmpty()) { String mimeType = values.iterator().next(); try { contentType = ContentType.create(mimeType, request.charset()); } catch (IllegalArgumentException e) { contentType = ContentType.parse(mimeType); } break; } } return contentType; }

Target:
private ContentType getContentType(Request request) { ContentType contentType = ContentType.DEFAULT_TEXT; for (Map.Entry<String, Collection<String>> entry : request.headers().entrySet()) if (entry.getKey().equalsIgnoreCase("Content-Type")) { Collection<String> values = entry.getValue(); if (values != null && !values.isEmpty()) { contentType = ContentType.parse(values.iterator().next()); break; } } return contentType; }
Source:
protected boolean runTest(DatabaseRegistryEntry dbre) { SqlTemplate srv = getSqlTemplate(dbre); boolean result = true; getTotalCould(dbre); result = computeMissingValues (dbre, totalCount); return result; }

Target:
protected boolean runTest(DatabaseRegistryEntry dbre) { boolean result = true; result = computeMissingValues (dbre); return result; }
Source:
public void queryInventoryAsync(final boolean querySkuDetails, final List<String> moreItemSkus, final List<String> moreSubsSkus, final IabHelper.QueryInventoryFinishedListener listener) { checkSetupDone("queryInventory"); if(listener == null) return; flagStartAsync("refresh inventory"); (new Thread(new Runnable() { public void run() { IabResult result = new IabResult(BILLING_RESPONSE_RESULT_OK, "Inventory refresh successful."); Inventory inv = null; try { inv = queryInventory(querySkuDetails, moreItemSkus, moreSubsSkus); } catch (IabException ex) { result = ex.getResult(); } flagEndAsync(); final IabResult result_f = result; final Inventory inv_f = inv; notifyHandler.post(new Runnable() { public void run() { listener.onQueryInventoryFinished(result_f, inv_f); } }); } })).start(); }

Target:
public void queryInventoryAsync(final boolean querySkuDetails, final List<String> moreItemSkus, final List<String> moreSubsSkus, final IabHelper.QueryInventoryFinishedListener listener) { checkSetupDone("queryInventory"); if (listener == null) { throw new IllegalArgumentException("Inventory listener must be not null"); } flagStartAsync("refresh inventory"); (new Thread(new Runnable() { public void run() { IabResult result = new IabResult(BILLING_RESPONSE_RESULT_OK, "Inventory refresh successful."); Inventory inv = null; try { inv = queryInventory(querySkuDetails, moreItemSkus, moreSubsSkus); } catch (IabException ex) { result = ex.getResult(); } flagEndAsync(); final IabResult result_f = result; final Inventory inv_f = inv; if (setupState != SETUP_DISPOSED) { notifyHandler.post(new Runnable() { public void run() { listener.onQueryInventoryFinished(result_f, inv_f); } }); } } })).start(); }
Source:
Territory getRetreat( final String message, final Collection<Territory> possible, final boolean submerge) { if (SwingUtilities.isEventDispatchThread()) { throw new IllegalStateException("Should not be called from dispatch thread"); } final CompletableFuture<Territory> future = new CompletableFuture<>(); final String title; final Supplier<RetreatResult> supplier; if (!submerge || possible.size() > 1) { title = "Retreat?"; supplier = () -> showRetreatDialog(message, possible); } else { title = "Submerge Subs?"; supplier = () -> showSubmergeDialog(message); } final Action action = getPlayerAction(title, supplier, future); SwingUtilities.invokeLater( () -> { actionButton.setAction(action); action.actionPerformed(null); }); return awaitUserInput(future); }

Target:
Territory getRetreat( final String message, final Collection<Territory> possible, final boolean submerge) { if (SwingUtilities.isEventDispatchThread()) { throw new IllegalStateException("Should not be called from dispatch thread"); } final String title; final Supplier<RetreatResult> supplier; if (!submerge || possible.size() > 1) { title = "Retreat?"; supplier = () -> showRetreatDialog(message, possible); } else { title = "Submerge Subs?"; supplier = () -> showSubmergeDialog(message); } final CompletableFuture<Territory> future = new CompletableFuture<>(); final Action action = getPlayerAction(title, supplier, future); SwingUtilities.invokeLater( () -> { actionButton.setAction(action); action.actionPerformed(null); }); return awaitUserInput(future); }
Source:
public static Class<?> getRealClassFromClass(Class<?> cls) { Bus bus = getBus(null); if (checkUseDefaultClassHelper(bus)) { return CXF_HELPER.getRealClassFromClassInternal(cls); } else { return HELPER.getRealClassFromClassInternal(cls); } }

Target:
public static Class<?> getRealClassFromClass(Class<?> cls) { return getRealClassFromClass(null, cls); }
Source:
public String toString() { StringBuilder builder = new StringBuilder(50); builder.append("commandId: "); builder.append(getCommandId()); builder.append(", user: "); builder.append(getParametersCurrentUser().getUserName()); builder.append(", commandType: "); builder.append(getCommandType()); return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(50); builder.append("commandId: "); builder.append(getCommandId()); builder.append(", user: "); if(getParametersCurrentUser() != null) { builder.append(getParametersCurrentUser().getUserName()); } builder.append(", commandType: "); builder.append(getCommandType()); return builder.toString(); }
Source:
public void findAll() throws Exception { getClient().perform(get("/api/config/submissionsections")) .andExpect(status().isForbidden()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/config/submissionsections")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", greaterThanOrEqualTo(1))) .andExpect(jsonPath("$.page.totalPages", greaterThanOrEqualTo(1))) .andExpect(jsonPath("$.page.number", is(0))) .andExpect(jsonPath("$._links.self.href", Matchers.startsWith(REST_SERVER_URL + "config/submissionsections"))) .andExpect(jsonPath("$._embedded.submissionsections", hasSize(greaterThanOrEqualTo(1)) )) ; }

Target:
public void findAll() throws Exception { getClient().perform(get("/api/config/submissionsections")) .andExpect(status().isUnauthorized()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/config/submissionsections")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", greaterThanOrEqualTo(1))) .andExpect(jsonPath("$.page.totalPages", greaterThanOrEqualTo(1))) .andExpect(jsonPath("$.page.number", is(0))) .andExpect(jsonPath("$._links.self.href", Matchers.startsWith(REST_SERVER_URL + "config/submissionsections"))) .andExpect(jsonPath("$._embedded.submissionsections", hasSize(greaterThanOrEqualTo(1)) )) ; }
Source:
private Answer[] attemptHypervisorMigration(StoragePool destPool, VMInstanceVO vm) { boolean migrationResult = false; final HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType()); List<Command> commandsToSend = hvGuru.finalizeMigrate(vm, destPool); Long hostId = vm.getHostId(); if(hostId == null) { hostId = vm.getLastHostId(); if (s_logger.isDebugEnabled()) { s_logger.debug(String.format("host id is null, using last host id %d", hostId) ); } } if(CollectionUtils.isNotEmpty(commandsToSend)) { Commands commandsContainer = new Commands(commandsToSend.get(0)); try { Answer[] answers = _agentMgr.send(hostId, commandsContainer); return answers; } catch (AgentUnavailableException | OperationTimedoutException e) { throw new CloudRuntimeException("Failed to migration: " + e.toString()); } } return null; }

Target:
private Answer[] attemptHypervisorMigration(StoragePool destPool, VMInstanceVO vm) { final HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType()); List<Command> commandsToSend = hvGuru.finalizeMigrate(vm, destPool); Long hostId = vm.getHostId(); if(hostId == null) { hostId = vm.getLastHostId(); if (s_logger.isDebugEnabled()) { s_logger.debug(String.format("host id is null, using last host id %d", hostId) ); } } if(CollectionUtils.isNotEmpty(commandsToSend)) { Commands commandsContainer = new Commands(Command.OnError.Stop); commandsContainer.addCommands(commandsToSend); try { return _agentMgr.send(hostId, commandsContainer); } catch (AgentUnavailableException | OperationTimedoutException e) { throw new CloudRuntimeException(String.format("Failed to migrate VM: %s", vm.getUuid()),e); } } return null; }
Source:
private CompleteTransactionMessage makeCompleteTxnMsg(boolean readOnly, boolean isRollback, boolean isRestart) { CompleteTransactionMessage msg = new CompleteTransactionMessage(0l, 0l, m_mpiTxnEgo.getTxnId(), readOnly, 0, isRollback, false, isRestart, false); msg.setForReplica(false); return msg; }

Target:
private CompleteTransactionMessage makeCompleteTxnMsg(boolean readOnly, boolean isRollback, boolean isRestart) { CompleteTransactionMessage msg = new CompleteTransactionMessage(0l, 0l, m_mpiTxnEgo.getTxnId(), readOnly, 0, isRollback, false, isRestart, false); return msg; }
Source:
public ModelEditor(Composite composite, IEclipseContext context, IModelResource modelProvider, IProject project, final IResourcePool resourcePool) { this.resourcePool = resourcePool; this.modelProvider = modelProvider; this.project = project; this.context = context; this.context.set(ModelEditor.class, this); this.obsManager = new ObservablesManager(); if (project != null) { String localString = ""; Object object = this.context.get(TranslationService.LOCALE); if (object instanceof String) { localString = (String) object; } else { Locale local = (Locale) object; localString = local.toString(); } ProjectOSGiTranslationProvider translationProvider = new ProjectOSGiTranslationProvider(project, localString) { @Override protected void updateResourceBundle() { super.updateResourceBundle(); if (viewer != null) { viewer.getControl().getDisplay().asyncExec(new Runnable() { @Override public void run() { viewer.refresh(); } }); } } }; context.set(ProjectOSGiTranslationProvider.class, translationProvider); } labelFeaturePaths.add(FeaturePath.fromList(UiPackageImpl.Literals.UI_ELEMENT__TO_BE_RENDERED)); labelFeaturePaths.add(FeaturePath.fromList(UiPackageImpl.Literals.UI_ELEMENT__VISIBLE)); composite.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent arg0) { persistState(); } }); }

Target:
public ModelEditor(Composite composite, IEclipseContext context, IModelResource modelProvider, IProject project, final IResourcePool resourcePool) { this.resourcePool = resourcePool; this.modelProvider = modelProvider; this.project = project; this.context = context; this.context.set(ModelEditor.class, this); this.obsManager = new ObservablesManager(); if (project != null) { String localeString = ""; Object object = this.context.get(TranslationService.LOCALE); if (object != null) { localeString = object.toString(); } ProjectOSGiTranslationProvider translationProvider = new ProjectOSGiTranslationProvider(project, localeString) { @Override protected void updateResourceBundle() { super.updateResourceBundle(); if (viewer != null) { viewer.getControl().getDisplay().asyncExec(new Runnable() { @Override public void run() { viewer.refresh(); } }); } } }; context.set(ProjectOSGiTranslationProvider.class, translationProvider); } labelFeaturePaths.add(FeaturePath.fromList(UiPackageImpl.Literals.UI_ELEMENT__TO_BE_RENDERED)); labelFeaturePaths.add(FeaturePath.fromList(UiPackageImpl.Literals.UI_ELEMENT__VISIBLE)); composite.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent arg0) { persistState(); } }); }
Source:
public Construct exec(Target t, Environment env, Construct... args) throws CancelCommandException, ConfigRuntimeException { long arg1 = Static.getInt(args[0], t); long arg2 = Static.getInt(args[1], t); if(arg2 == 0) { throw new CRERangeException("Moduloing by 0!", t); } return new CInt(arg1 % arg2, t); }

Target:
public Construct exec(Target t, Environment env, Construct... args) throws CancelCommandException, ConfigRuntimeException { long arg1 = Static.getInt(args[0], t); long arg2 = Static.getInt(args[1], t); if(arg2 == 0) { throw new CRERangeException("Modulo by 0!", t); } return new CInt(arg1 % arg2, t); }