auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static IResource getResource(String path) throws CoreException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject(TmfCommonConstants.DEFAULT_TRACE_PROJECT_NAME); IPath iPath = org.eclipse.core.runtime.Path.forPosix(path); String[] segments = iPath.segments(); IFolder folder = null; if (segments.length > 1) { folder = project.getFolder(segments[0]); if (!folder.exists()) { folder.create(true, true, null); } for (int i = 1; i < segments.length - 1; i++) { folder = folder.getFolder(segments[i]); if (!folder.exists()) { folder.create(true, true, null); } } } String lastSegment = segments[segments.length - 1]; IResource resource; if (iPath.toFile().isFile()) { IFile iFile = folder != null ? folder.getFile(lastSegment) : project.getFile(lastSegment); iFile.createLink(iPath, IResource.REPLACE, null); resource = iFile; } else { IFolder iFolder = folder != null ? folder.getFolder(lastSegment) : project.getFolder(lastSegment); iFolder.createLink(iPath, IResource.REPLACE, null); resource = iFolder; } String ws = root.getRawLocation().toOSString(); String suppFolder = ws + resource.getFullPath().toString(); File suppFile = new File(suppFolder); suppFile.mkdir(); resource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, suppFolder); return resource; }

Target:
private static IResource getResource(String path) throws CoreException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject(TmfCommonConstants.DEFAULT_TRACE_PROJECT_NAME); IPath iPath = org.eclipse.core.runtime.Path.forPosix(path); IResource resource = null; boolean isSuccess = false; if (new File(path).isFile()) { IFile file = project.getFile(path); createFolder((IFolder) file.getParent(), null); isSuccess = ResourceUtil.createSymbolicLink(file, iPath, true, null); resource = file; } else { IFolder folder = project.getFolder(path); createFolder((IFolder) folder.getParent(), null); isSuccess = ResourceUtil.createSymbolicLink(folder, iPath, true, null); resource = folder; } if (!isSuccess) { return null; } IFolder supplRootFolder = project.getFolder(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER_NAME); IFolder supplFolder = supplRootFolder.getFolder(path); createFolder(supplFolder, null); resource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, supplFolder.getLocation().toOSString()); return resource; }
Source:
public void replicaFromStandbyToLeaderTest() throws Exception { MockClusterMap clusterMap = new MockClusterMap(); ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties); MockHelixParticipant mockHelixParticipant = new MockHelixParticipant(clusterMapConfig); Pair<StorageManager, ReplicationManager> managers = createStorageManagerAndReplicationManager(clusterMap, clusterMapConfig, mockHelixParticipant); StorageManager storageManager = managers.getFirst(); MockReplicationManager replicationManager = (MockReplicationManager) managers.getSecond(); PartitionId existingPartition = replicationManager.partitionToPartitionInfo.keySet().iterator().next(); String currentdatacenter = storageManager.getReplica(existingPartition.toString()).getDataNodeId().getDatacenterName(); mockHelixParticipant.onPartitionBecomeLeaderFromStandby(existingPartition.toPathString()); List<ReplicaId> peerLeaderReplicasInReplicationManager = replicationManager.getPeerLeaderReplicasByPartition().get(existingPartition.toString()); List<ReplicaId> peerLeaderReplicasInClusterMap = (List<ReplicaId>) existingPartition.getReplicaIdsByState(ReplicaState.LEADER, null) .stream() .filter(r -> !r.getDataNodeId().getDatacenterName().equals(currentdatacenter)) .collect(Collectors.toList()); assertThat("mismatch in leader peer replicas", peerLeaderReplicasInReplicationManager, is(peerLeaderReplicasInClusterMap)); storageManager.shutdown(); }

Target:
public void replicaFromStandbyToLeaderTest() throws Exception { MockClusterMap clusterMap = new MockClusterMap(); ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties); MockHelixParticipant.metricRegistry = new MetricRegistry(); MockHelixParticipant mockHelixParticipant = new MockHelixParticipant(clusterMapConfig); Pair<StorageManager, ReplicationManager> managers = createStorageManagerAndReplicationManager(clusterMap, clusterMapConfig, mockHelixParticipant); StorageManager storageManager = managers.getFirst(); MockReplicationManager replicationManager = (MockReplicationManager) managers.getSecond(); PartitionId existingPartition = replicationManager.partitionToPartitionInfo.keySet().iterator().next(); String currentDataCenter = storageManager.getReplica(existingPartition.toString()).getDataNodeId().getDatacenterName(); mockHelixParticipant.onPartitionBecomeLeaderFromStandby(existingPartition.toPathString()); List<ReplicaId> peerLeaderReplicasInReplicationManager = replicationManager.getPeerLeaderReplicasByPartition().get(existingPartition.toPathString()); List<ReplicaId> peerLeaderReplicasInClusterMap = existingPartition.getReplicaIdsByState(ReplicaState.LEADER, null) .stream() .filter(r -> !r.getDataNodeId().getDatacenterName().equals(currentDataCenter)) .collect(Collectors.toList()); assertThat("Mismatch in list of leader peer replicas stored by partition in replication manager and cluster map", peerLeaderReplicasInReplicationManager, is(peerLeaderReplicasInClusterMap)); storageManager.shutdown(); }
Source:
public void valuesAtLocation_single_assignment() { Name x = (Name) lastExpressionInFunction("x = 42; x"); ReachingDefinitionsAnalysis analysis = new ReachingDefinitionsAnalysis(file); assertThat(analysis.valuesAtLocation(x)).extracting(expression -> ((NumericLiteral) expression).valueAsString()).containsExactly("42"); }

Target:
public void valuesAtLocation_single_assignment() { Name x = (Name) lastExpressionInFunction("x = 42; x"); assertThat(analysis.valuesAtLocation(x)).extracting(ReachingDefinitionsAnalysisTest::getValueAsString).containsExactly("42"); }
Source:
boolean isRngSupportedByCluster() { VDSGroup cluster = getVdsGroup(); VmRngDevice.Source source = getParameters().getRngDevice().getSource(); return cluster != null && FeatureSupported.virtIoRngSupported(cluster.getcompatibility_version()) && cluster.getRequiredRngSources().contains(source); }

Target:
protected boolean isRngSupportedByCluster() { VDSGroup cluster = getVdsGroup(); VmRngDevice.Source source = getParameters().getRngDevice().getSource(); return cluster != null && isFeatureSupported(cluster.getcompatibility_version()) && cluster.getRequiredRngSources().contains(source); }
Source:
public void upgrade(SQLiteDatabase db, int oldVersion, int newVersion) { if (oldVersion == 1) { if (upgradeOneTwo(db, oldVersion, newVersion)) { oldVersion = 2; } } if (oldVersion == 2) { if (upgradeTwoThree(db)) { oldVersion = 3; } } if (oldVersion == 3) { if (upgradeThreeFour(db)) { oldVersion = 4; } } if (oldVersion == 4) { if (upgradeFourFive(db)) { oldVersion = 5; } } if (oldVersion == 5) { upgradeFiveSix(db); } }

Target:
public void upgrade(SQLiteDatabase db, int oldVersion, int newVersion) { if (oldVersion == 1) { if (upgradeOneTwo(db, oldVersion, newVersion)) { oldVersion = 2; } } if (oldVersion == 2) { if (upgradeTwoThree(db)) { oldVersion = 3; } } if (oldVersion == 3) { if (upgradeThreeFour(db)) { oldVersion = 4; } } if (oldVersion == 4) { if (upgradeFourFive(db)) { oldVersion = 5; } } if (oldVersion == 5) { if (upgradeFiveSix(db)) { oldVersion = 6; } } }
Source:
public void shouldRunFlyweightTaskOnProvisionedNodeWhenNodeRestricted() throws Exception { MatrixProject project = r.createMatrixProject(); project.setAxes(new AxisList( new Axis("axis", "a", "b") )); Label label = LabelExpression.get("aws-linux-dummy"); DummyCloudImpl dummyCloud = new DummyCloudImpl(r, 0); dummyCloud.label = label; r.jenkins.clouds.add(dummyCloud); project.setAssignedLabel(label); r.assertBuildStatusSuccess(project.scheduleBuild2(0)); }

Target:
public void shouldRunFlyweightTaskOnProvisionedNodeWhenNodeRestricted() throws Exception { MatrixProject matrixProject = r.createMatrixProject(); matrixProject.setAxes(new AxisList( new Axis("axis", "a", "b") )); Label label = LabelExpression.get("aws-linux-dummy"); DummyCloudImpl dummyCloud = new DummyCloudImpl(r, 0); dummyCloud.label = label; r.jenkins.clouds.add(dummyCloud); matrixProject.setAssignedLabel(label); r.assertBuildStatusSuccess(matrixProject.scheduleBuild2(0)); assertEquals("aws-linux-dummy", matrixProject.getBuilds().getLastBuild().getBuiltOn().getLabelString()); }
Source:
public void dispose() { cm.unregisterForAvailable(this); cm.unregisterForRadioStateChanged(this); cm.unregisterForNetworkStateChanged(this); cm.unregisterForSIMReady(this); phone.mSIMRecords.unregisterForRecordsLoaded(this); cm.unSetOnSignalStrengthUpdate(this); cm.unSetOnNITZTime(this); this.removeCallbacksAndMessages(null); cr.unregisterContentObserver(this.mAutoTimeObserver); this.phone = null; this.cm = null; this.ss = null; this.newSS = null; this.cellLoc = null; this.newCellLoc = null; this.cr = null; this.mAutoTimeObserver = null; this.gprsAttachedRegistrants = null; this.gprsDetachedRegistrants = null; }

Target:
public void dispose() { cm.unregisterForAvailable(this); cm.unregisterForRadioStateChanged(this); cm.unregisterForNetworkStateChanged(this); cm.unregisterForSIMReady(this); phone.mSIMRecords.unregisterForRecordsLoaded(this); cm.unSetOnSignalStrengthUpdate(this); cm.unSetOnNITZTime(this); cr.unregisterContentObserver(this.mAutoTimeObserver); }
Source:
private CepInput(final CepInputType cepInputTypeParam, final Map<String, Object> cepInputConfigurationParam, final List<Tuple2<String, CepValueType>> fieldsParam){ this.cepInputType = cepInputTypeParam; this.cepInputConfiguration = cepInputConfigurationParam; this.fields = fieldsParam; this.separator = ","; }

Target:
private CepInput(final CepInputType cepInputTypeParam, final Map<String, Object> cepInputConfigurationParam, final List<Tuple2<String, CepValueType>> fieldsParam) { this(cepInputTypeParam, cepInputConfigurationParam, fieldsParam, DEFAULT_SEPARATOR); }
Source:
public MatrixAggregator createAggregator(MatrixBuild matrixBuild, Launcher launcher, BuildListener buildListener) { return new MatrixAggregator(matrixBuild, launcher, buildListener) { @Override public boolean startBuild() throws InterruptedException, IOException { if (getMatrixTriggerMode().forParent) { return SlackNotifier.this.perform(this.build, this.launcher, this.listener); } return true; } @Override public boolean endBuild() throws InterruptedException, IOException { if (getMatrixTriggerMode().forParent) { return SlackNotifier.this.perform(this.build, this.launcher, this.listener); } return true; } }; }

Target:
public MatrixAggregator createAggregator(MatrixBuild matrixBuild, Launcher launcher, BuildListener buildListener) { return new MatrixAggregator(matrixBuild, launcher, buildListener) { @Override public boolean startBuild() { if (getMatrixTriggerMode().forParent) { return SlackNotifier.this.perform(this.build, this.launcher, this.listener); } return true; } @Override public boolean endBuild() { if (getMatrixTriggerMode().forParent) { return SlackNotifier.this.perform(this.build, this.launcher, this.listener); } return true; } }; }
Source:
public Visitor(Session session, Metadata metadata, SqlParser parser, Map<Symbol, Type> types) { this.session = session; this.metadata = metadata; this.parser = parser; this.types = types; }

Target:
Visitor(Session session, Metadata metadata, SqlParser parser, Map<Symbol, Type> types) { this.session = requireNonNull(session, "session is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.parser = requireNonNull(parser, "parser is null"); this.types = requireNonNull(types, "types is null"); }
Source:
public void open() throws TTransportException { if (conn.getState() != Constants.ConnState.CONNECTED) { throw new TTransportException(TTransportException.NOT_OPEN, "NATS not connected, has status " + conn.getState()); } if (connectionSubject != null) { handshake(); } if (listenTo == null || "".equals(listenTo) || writeTo == null || "".equals(writeTo)) { throw new TTransportException("listenTo and writeTo cannot be empty."); } writeBuffer = ByteBuffer.allocate(NATS_MAX_MESSAGE_SIZE); try { writer = new PipedOutputStream(); reader = new PipedInputStream(writer); } catch (IOException e) { throw new TTransportException(e); } sub = conn.subscribe(listenTo, new MessageHandler() { @Override public void onMessage(Message msg) { if (DISCONNECT.equals(msg.getReplyTo())) { close(); return; } try { writer.write(msg.getData()); writer.flush(); } catch (IOException e) { LOGGER.warning("could not write incoming data to buffer" + e.getMessage()); } } }); if (heartbeatInterval > 0) { startTimer(); heartbeatSub = conn.subscribe(heartbeatListen, new MessageHandler() { @Override public void onMessage(Message message) { receiveHeartbeat(); conn.publish(heartbeatReply, null); } }); } }

Target:
public synchronized void open() throws TTransportException { if (conn.getState() != Constants.ConnState.CONNECTED) { throw new TTransportException(TTransportException.NOT_OPEN, "NATS not connected, has status " + conn.getState()); } if (isOpen) { throw new TTransportException(TTransportException.ALREADY_OPEN, "NATS transport already open"); } if (connectionSubject != null) { handshake(); } if (listenTo == null || "".equals(listenTo) || writeTo == null || "".equals(writeTo)) { throw new TTransportException("listenTo and writeTo cannot be empty."); } writeBuffer = ByteBuffer.allocate(NATS_MAX_MESSAGE_SIZE); try { writer = new PipedOutputStream(); reader = new PipedInputStream(writer); } catch (IOException e) { throw new TTransportException(e); } sub = conn.subscribe(listenTo, new MessageHandler() { @Override public void onMessage(Message msg) { if (DISCONNECT.equals(msg.getReplyTo())) { close(); return; } try { writer.write(msg.getData()); writer.flush(); } catch (IOException e) { LOGGER.warning("could not write incoming data to buffer" + e.getMessage()); } } }); if (heartbeatInterval > 0) { startTimer(); heartbeatSub = conn.subscribe(heartbeatListen, new MessageHandler() { @Override public void onMessage(Message message) { receiveHeartbeat(); conn.publish(heartbeatReply, null); } }); } isOpen = true; }
Source:
public void updatePartitionKeyAndRowKey() { Schema inputSchema = schema.schema.getValue(); possibleValues = new ArrayList<String>(); for (Field field : inputSchema.getFields()) { Schema fSchema = field.schema(); if (fSchema.getType() == Type.UNION) { for (Schema s : field.schema().getTypes()) { if (s.getType() != Type.NULL) { fSchema = s; break; } } } if (fSchema.getType().equals(Type.STRING)) { possibleValues.add(field.name()); } } partitionKey.setPossibleValues(possibleValues); rowKey.setPossibleValues(possibleValues); }

Target:
public void updatePartitionKeyAndRowKey() { Schema inputSchema = schema.schema.getValue(); List<String> possibleValues = new ArrayList<String>(); for (Field field : inputSchema.getFields()) { Schema fSchema = field.schema(); if (fSchema.getType() == Type.UNION) { for (Schema s : field.schema().getTypes()) { if (s.getType() != Type.NULL) { fSchema = s; break; } } } if (fSchema.getType().equals(Type.STRING)) { possibleValues.add(field.name()); } } partitionKey.setPossibleValues(possibleValues); rowKey.setPossibleValues(possibleValues); }
Source:
public void writeToXml(PrintWriter pw1, int indent) { writeToXmlBegin(pw1, indent); MekHqXmlUtil.writeSimpleXmlTag(pw1, indent + 1, "typeName", MekHqXmlUtil.escape(type.getInternalName())); MekHqXmlUtil.writeSimpleXmlTag(pw1, indent + 1, "equipmentNum", equipmentNum); MekHqXmlUtil.writeSimpleXmlTag(pw1, indent + 1, "size", size); MekHqXmlUtil.writeSimpleXmlTag(pw1, indent + 1, "equipTonnage", equipTonnage); writeToXmlEnd(pw1, indent); }

Target:
public void writeToXml(PrintWriter pw1, int indent) { writeToXmlBegin(pw1, indent); MekHqXmlUtil.writeSimpleXmlTag(pw1, indent + 1, "typeName", type.getInternalName()); MekHqXmlUtil.writeSimpleXmlTag(pw1, indent + 1, "equipmentNum", equipmentNum); MekHqXmlUtil.writeSimpleXmlTag(pw1, indent + 1, "size", size); MekHqXmlUtil.writeSimpleXmlTag(pw1, indent + 1, "equipTonnage", equipTonnage); writeToXmlEnd(pw1, indent); }
Source:
public boolean acknowledgeRecord(ConsumerRecord<?, ?> record) throws InterruptedException { lock.readLock().lock(); try { boolean acknowledged; TopicPartition topicPartition = new TopicPartition(record.topic(), record.partition()); if (!assignment.contains(topicPartition)) { acknowledged = false; } else { long commitOffset = record.offset() + 1; OffsetAndMetadata offsetAndMetadata = new OffsetAndMetadata(commitOffset, "Commit From Forklift Server"); pendingOffsets.merge(topicPartition, offsetAndMetadata, this::greaterOffset); acknowledged = true; } return acknowledged; } finally { lock.readLock().unlock(); } }

Target:
public boolean acknowledgeRecord(ConsumerRecord<?, ?> record) throws InterruptedException { lock.readLock().lock(); try { TopicPartition topicPartition = new TopicPartition(record.topic(), record.partition()); if (!assignment.contains(topicPartition)) { return false; } long commitOffset = record.offset() + 1; OffsetAndMetadata offsetAndMetadata = new OffsetAndMetadata(commitOffset, "Commit From Forklift Server"); offsets.merge(topicPartition, offsetAndMetadata, this::greaterOffset); return true; } finally { lock.readLock().unlock(); } }
Source:
public double getScaleFactor() { if (method_getScaleFactor != null) { try { return Math.max(0.25f, Math.min((Float)method_getScaleFactor.invoke(realScaleGestureDetector), 1.95f)); } catch (Exception e) { e.printStackTrace(); return 1.0; } } return 1.0; }

Target:
public double getScaleFactor() { if (method_getScaleFactor != null) { try { return (Float) method_getScaleFactor.invoke(realScaleGestureDetector); } catch (Exception e) { e.printStackTrace(); return 1.0; } } return 1.0; }
Source:
protected void buildSrcAttribute(final ComponentTag tag, IModel<?> srcModel) { tag.put("src", srcModel.getObject().toString()); }

Target:
protected void buildSrcAttribute(final ComponentTag tag, IModel<?> srcModel) { tag.put("src", String.valueOf(srcModel.getObject())); }
Source:
public PageHelper<E> addBooleanFacet(String name, String title) { Objects.requireNonNull(ctx); Facet facet = new Facet(title, name, ctx.get(name).asString(), null); facet.addItem("true", NLS.get("NLS.yes"), -1); facet.addItem("false", NLS.get("NLS.no"), -1); return addFacet(facet, (f, q) -> { Value isUsed = Value.of(f.getValue()); if (isUsed.isFilled()) { q.eqIgnoreNull(Column.named(f.getName()), isUsed.asBoolean()); } }); }

Target:
public PageHelper<E> addBooleanFacet(String name, String title) { Objects.requireNonNull(ctx); Facet facet = new Facet(title, name, ctx.get(name).asString(), null); facet.addItem("true", NLS.get("NLS.yes"), -1); facet.addItem("false", NLS.get("NLS.no"), -1); return addFacet(facet, (f, q) -> { Value filterValue = Value.of(f.getValue()); if (filterValue.isFilled()) { q.eq(Column.named(f.getName()), filterValue.asBoolean()); } }); }
Source:
public static void skipContent(@Nonnull JayceInternalReaderImpl in) throws IOException { throw new UnsupportedOperationException(); }

Target:
public static void skipContent(@Nonnull JayceInternalReaderImpl in) { throw new UnsupportedOperationException(); }
Source:
public SimpleLitTemplateNoShadowRootView() { add(new SimpleLitTemplateNoShadowRoot()); }

Target:
public SimpleLitTemplateNoShadowRootView() { getElement().setProperty("text", "Client button"); mappedButton.setText("Server button"); mappedButton.addClickListener(e -> { label.setText("Hello from server component event listener"); }); }
Source:
protected void sendLine(String text, Object... parameters) throws IOException { out.format(FORMAT_LOCALE, text.replace(" ", "")+LINEEND(), parameters); System.out.println(String.format(FORMAT_LOCALE, "> "+text+LINEEND(), parameters)); out.flush(); if (isWaitForOKafterEachLine()) { String line = waitForLine(); if (!"ok".equals(line)) { throw new IOException("Lasercutter did not respond 'ok', but '"+line+"'instead."); } } }

Target:
protected void sendLine(String text, Object... parameters) throws IOException { out.format(FORMAT_LOCALE, text+LINEEND(), parameters); System.out.println(String.format(FORMAT_LOCALE, "> "+text+LINEEND(), parameters)); out.flush(); if (isWaitForOKafterEachLine()) { String line = waitForLine(); if (!"ok".equals(line)) { throw new IOException("Lasercutter did not respond 'ok', but '"+line+"'instead."); } } }
Source:
public AbstractSosResponseEncoder(Class<T> type, String operation) { super(type, new OperationEncoderKey(SosConstants.SOS, Sos2Constants.SERVICEVERSION, operation, MediaTypes.APPLICATION_JSON), new OperationEncoderKey(SosConstants.SOS, Sos1Constants.SERVICEVERSION, operation, MediaTypes.APPLICATION_JSON)); }

Target:
public AbstractSosResponseEncoder(Class<T> type, String operation) { super(type, new OperationEncoderKey(SosConstants.SOS, Sos2Constants.SERVICEVERSION, operation, MediaTypes.APPLICATION_JSON)); }
Source:
public String getName() { return name != null ? name : ""; }

Target:
public String getName() { return firstNonNull(name, ""); }
Source:
public PriceIndexValues priceIndexValues(PriceIndex index) { Curve curve = marketData.getValue(PriceIndexCurveKey.of(index)); if (curve == null) { throw new IllegalArgumentException("Unable to find forward curve: " + index); } if (!(curve instanceof InterpolatedNodalCurve)) { throw new IllegalArgumentException("Curve must be an InterpolatedNodalCurve: " + index); } return ForwardPriceIndexValues.of(index, getValuationDate(), (InterpolatedNodalCurve) curve, timeSeries(index)); }

Target:
public PriceIndexValues priceIndexValues(PriceIndex index) { Curve curve = marketData.getValue(PriceIndexCurveKey.of(index)); if (!(curve instanceof InterpolatedNodalCurve)) { throw new IllegalArgumentException("Curve must be an InterpolatedNodalCurve: " + index); } return ForwardPriceIndexValues.of(index, getValuationDate(), (InterpolatedNodalCurve) curve, timeSeries(index)); }
Source:
GC100IRConnection(InetAddress ipAddress, String ipAddressString, int port, int module, int connector, String deviceType) throws IOException { this.inetAddress = ipAddress; this.ipAddressString = ipAddressString; this.port = port; this.module = module; this.connector = connector; this.deviceType = deviceType; }

Target:
GC100IRConnection(InetAddress ipAddress, String ipAddressString, int port, int module, int connector, String deviceType) { this.inetAddress = ipAddress; this.ipAddressString = ipAddressString; this.port = port; this.module = module; this.connector = connector; this.deviceType = deviceType; }
Source:
private void simpleTransactionInAnotherThread() throws Exception { final IgniteCache<String, Integer> cache = jcache(grid(0), cacheConfiguration(null).setName("testCache"), String.class, Integer.class); final IgniteTransactions transactions = transactions(); assertNull(cache.get("key1")); final Transaction tx = transactions.txStart(transactionConcurrency, transactionIsolation); cache.put("key1", 1); cache.put("key2", 2); tx.suspend(); assertNull(cache.get("key1")); IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(new Callable<Boolean>() { @Override public Boolean call() throws Exception { Assert.assertNull(transactions.tx()); Assert.assertEquals(TransactionState.SUSPENDED, tx.state()); tx.resume(); Assert.assertEquals(TransactionState.ACTIVE, tx.state()); cache.put("key3", 3); cache.remove("key2"); tx.commit(); return true; } }); try { fut.get(); } catch (IgniteCheckedException e) { e.printStackTrace(); fail("Transaction in another thread failed"); } Assert.assertEquals(TransactionState.COMMITTED, tx.state()); Assert.assertEquals((long)1, (long)cache.get("key1")); Assert.assertEquals((long)3, (long)cache.get("key3")); Assert.assertFalse(cache.containsKey("key2")); cache.removeAll(); }

Target:
private void simpleTransactionInAnotherThread() throws IgniteCheckedException { final IgniteCache<String, Integer> cache = jcache(txInitiatorNodeId); final IgniteTransactions transactions = ignite(txInitiatorNodeId).transactions(); assertNull(cache.get("key1")); final Transaction tx = transactions.txStart(TransactionConcurrency.OPTIMISTIC, transactionIsolation); cache.put("key1", 1); cache.put("key2", 2); tx.suspend(); assertNull(cache.get("key1")); IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(new Callable<Boolean>() { @Override public Boolean call() throws Exception { assertNull(transactions.tx()); assertEquals(TransactionState.SUSPENDED, tx.state()); tx.resume(); assertEquals(TransactionState.ACTIVE, tx.state()); cache.put("key3", 3); cache.remove("key2"); tx.commit(); return true; } }); fut.get(5000); assertEquals(TransactionState.COMMITTED, tx.state()); assertEquals((long)1, (long)cache.get("key1")); assertEquals((long)3, (long)cache.get("key3")); assertFalse(cache.containsKey("key2")); cache.removeAll(); }
Source:
public void add(final RyaStatement statement) throws RyaDAOException { try { final boolean canAdd = DocumentVisibilityUtil.doesUserHaveDocumentAccess(auths, statement.getColumnVisibility()); if (canAdd) { coll.insert(storageStrategy.serialize(statement)); for(final RyaSecondaryIndexer index: secondaryIndexers) { index.storeStatement(statement); } } } catch (final IOException e) { log.error("Unable to add: " + statement.toString()); throw new RyaDAOException(e); } catch (final DuplicateKeyException e){ log.error("Attempting to load duplicate triple: " + statement.toString()); } }

Target:
public void add(final RyaStatement statement) throws RyaDAOException { try { final boolean canAdd = DocumentVisibilityUtil.doesUserHaveDocumentAccess(auths, statement.getColumnVisibility()); if (canAdd) { coll.insert(storageStrategy.serialize(statement)); for(final RyaSecondaryIndexer index: secondaryIndexers) { index.storeStatement(statement); } } else { throw new RyaDAOException("User does not have the required authorizations to add statement"); } } catch (final IOException e) { log.error("Unable to add: " + statement.toString()); throw new RyaDAOException(e); } catch (final DuplicateKeyException e){ log.error("Attempting to load duplicate triple: " + statement.toString()); } }
Source:
public void stop() { ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPING); StartableMethods.stop(this); ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPED); }

Target:
public void stop() { ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPING); setAttribute(SERVICE_UP, false); try { StartableMethods.stop(this); ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPED); } catch (Exception e) { ServiceStateLogic.setExpectedState(this, Lifecycle.ON_FIRE); throw Exceptions.propagate(e); } }
Source:
public static Trade adaptTrade(LatokenTrade latokenTrade, CurrencyPair pair) { return new Trade( adaptOrderType(latokenTrade.getSide()), BigDecimal.valueOf(latokenTrade.getAmount()), pair, BigDecimal.valueOf(latokenTrade.getPrice()), latokenTrade.getTimestamp(), null); }

Target:
public static Trade adaptTrade(LatokenTrade latokenTrade, CurrencyPair pair) { return new Trade.Builder() .type(adaptOrderType(latokenTrade.getSide())) .currencyPair(pair) .originalAmount(latokenTrade.getAmount()) .price(latokenTrade.getPrice()) .timestamp(latokenTrade.getTimestamp()) .build(); }
Source:
public void changeDefaultServer(String nameNewServer) { new DefaultHyperlink(new WithTooltipTextMatcher("Change Default Server;")); if (new ShellIsActive("Default server unchanged").test()) { throw new Error("Only 1 server is configured"); } if (new ShellIsActive("Server Selection").test()) { new DefaultCombo().setSelection(nameNewServer); new OkButton().click(); } if (new ShellIsActive("Change of Teiid Version").test()) { new YesButton(new DefaultShell("Change of Teiid Version")).click(); } if (new ShellIsActive("Untested Teiid Version").test()) { new YesButton(new DefaultShell("Untested Teiid Version")).click(); } if (new ShellIsActive("Disconnect Current Default Instance").test()) { new YesButton(new DefaultShell("Disconnect Current Default Instance")).click(); } if (new ShellIsActive("Default Server Changed").test()) { new OkButton(new DefaultShell("Default Server Changed")).click(); } else if (new ShellIsActive("Default server unchanged").test()) { new OkButton(new DefaultShell("Default server unchanged")).click(); } else { throw new Error("Default server not been changed due to an error"); } }

Target:
public void changeDefaultServer(String nameNewServer) { new DefaultHyperlink(new WithTooltipTextMatcher("Change Default Server;")); if (new ShellIsAvailable("Default server unchanged").test()) { throw new Error("Only 1 server is configured"); } DefaultShell shell = new DefaultShell("Server Selection"); if (new ShellIsAvailable(shell).test()) { new DefaultCombo().setSelection(nameNewServer); new OkButton().click(); } if (new ShellIsAvailable("Change of Teiid Version").test()) { new YesButton(new DefaultShell("Change of Teiid Version")).click(); } if (new ShellIsAvailable("Untested Teiid Version").test()) { new YesButton(new DefaultShell("Untested Teiid Version")).click(); } if (new ShellIsAvailable("Disconnect Current Default Instance").test()) { new YesButton(new DefaultShell("Disconnect Current Default Instance")).click(); } if (new ShellIsAvailable("Default Server Changed").test()) { new OkButton(new DefaultShell("Default Server Changed")).click(); } else if (new ShellIsAvailable("Default server unchanged").test()) { new OkButton(new DefaultShell("Default server unchanged")).click(); } else { throw new Error("Default server not been changed due to an error"); } }
Source:
public void run() { try { delegate.run(); } catch (Throwable t) { IllegalStateException ie; if (t instanceof OnErrorNotImplementedException) { ie = new IllegalStateException( "Exception thrown on Scheduler. Add `onError` handling.", t); } else { ie = new IllegalStateException("Fatal Exception thrown on Scheduler.", t); } RxJavaPlugins.onError(ie); Thread thread = Thread.currentThread(); thread.getUncaughtExceptionHandler().uncaughtException(thread, ie); return; } if (periodMillis != NO_PERIOD && !disposed) { handler.postDelayed(this, periodMillis); if (disposed) { handler.removeCallbacks(this); } } }

Target:
public void run() { try { delegate.run(); } catch (Throwable t) { IllegalStateException ie; if (t instanceof OnErrorNotImplementedException) { ie = new IllegalStateException( "Exception thrown on Scheduler. Add `onError` handling.", t); } else { ie = new IllegalStateException("Fatal Exception thrown on Scheduler.", t); } RxJavaPlugins.onError(ie); Thread thread = Thread.currentThread(); thread.getUncaughtExceptionHandler().uncaughtException(thread, ie); } }
Source:
public int indexOf(final Object o) { if (o instanceof String) { final String s = (String) o; for (int i = 0; i < table.size(); i++) { if (s.equals(table.getStringValue(col, i))) return i; } } else if (o instanceof Number) { final double d = ((Number) o).doubleValue(); for (int i = 0; i < table.size(); i++) { if (d == table.getValueAsDouble(col, i)) return i; } } return -1; }

Target:
public int indexOf(final Object o) { return findInRange(o, IntStream.range(0, table.size())); }
Source:
public static Archive<?> createTestArchive() { WebArchive war = TestUtil.prepareArchive(AsyncPostProcessingTest.class.getSimpleName()); war.addClasses(TestUtil.class, PortProviderUtil.class); war.addAsWebInfResource(AsyncPostProcessingTest.class.getPackage(), "AsyncPostProcessingTestWeb.xml", "web.xml"); war.addAsManifestResource(PermissionUtil.createPermissionsXmlAsset( new ReflectPermission("suppressAccessChecks"), new PropertyPermission("arquillian.*", "read"), new PropertyPermission("ipv6", "read"), new PropertyPermission("node", "read"), new PropertyPermission("org.jboss.resteasy.port", "read"), new RuntimePermission("accessDeclaredMembers"), new RuntimePermission("getenv.RESTEASY_PORT"), new RuntimePermission("getClassLoader"), new SocketPermission(PortProviderUtil.getHost(), "connect,resolve") ), "permissions.xml"); return TestUtil.finishContainerPrepare(war, null, AsyncPostProcessingResource.class, AsyncPostProcessingMsgBodyWriterInterceptor.class, AsyncPostProcessingInterceptor.class); }

Target:
public static Archive<?> createTestArchive() { WebArchive war = TestUtil.prepareArchive(AsyncPostProcessingTest.class.getSimpleName()); war.addClasses(TestUtil.class, PortProviderUtil.class); war.addAsWebInfResource(AsyncPostProcessingTest.class.getPackage(), "AsyncPostProcessingTestWeb.xml", "web.xml"); war.addAsManifestResource(PermissionUtil.createPermissionsXmlAsset( new ReflectPermission("suppressAccessChecks"), new PropertyPermission("arquillian.*", "read"), new PropertyPermission("ipv6", "read"), new PropertyPermission("node", "read"), new PropertyPermission("org.jboss.resteasy.port", "read"), new RuntimePermission("accessDeclaredMembers"), new RuntimePermission("getenv.RESTEASY_PORT"), new SocketPermission(PortProviderUtil.getHost(), "connect,resolve") ), "permissions.xml"); return TestUtil.finishContainerPrepare(war, null, AsyncPostProcessingResource.class, AsyncPostProcessingMsgBodyWriterInterceptor.class, AsyncPostProcessingInterceptor.class); }
Source:
public static void validateMethodOrThrow(Method method) { Class<?> returnType = method.getReturnType(); if (returnType.equals(Void.TYPE)) { return; } else if (!Publisher.class.isAssignableFrom(returnType)) { throw new UnsupportedOperationException("Service method return type can be Publisher only"); } if (method.getParameterCount() > 1) { int paramsCount = 0; for (Parameter parameter : method.getParameters()) { if (!parameter.isAnnotationPresent(Principal.class) && ++paramsCount > 1) { throw new UnsupportedOperationException( "Service method can accept 0 or 1 parameters only (except @Principal parameter)"); } } } }

Target:
public static void validateMethodOrThrow(Method method) { Class<?> returnType = method.getReturnType(); if (returnType.equals(Void.TYPE)) { return; } else if (!Publisher.class.isAssignableFrom(returnType)) { throw new UnsupportedOperationException("Service method return type can be Publisher only"); } validatePrincipalParameter(method); if (method.getParameterCount() > 2) { throw new UnsupportedOperationException("Service method can accept maximum 2 parameters"); } }
Source:
public static SequencerMetrics getSequencerMetrics(SequencerMetricsMsg msg) { switch(msg.getSequencerStatus()) { case READY: return SequencerMetrics.READY; case NOT_READY: return SequencerMetrics.NOT_READY; case UNKNOWN: return SequencerMetrics.UNKNOWN; default: } return null; }

Target:
public static SequencerMetrics getSequencerMetrics(SequencerMetricsMsg msg) { switch (msg.getSequencerStatus()) { case READY: return SequencerMetrics.READY; case NOT_READY: return SequencerMetrics.NOT_READY; case UNKNOWN: return SequencerMetrics.UNKNOWN; default: throw new UnsupportedOperationException("SequencerMetrics message unrecognized: " + "Status=" + msg.getSequencerStatus()); } }
Source:
protected void registerThroughputGauge(String counterName, String throughputName) { MetricsSystem.registerGaugeIfAbsent(throughputName, new Gauge<Object>() { @Override public Object getValue() { long uptime = (mClock.millis() - mMetricsStore.getLastClearTime()) / Constants.MINUTE_MS; long value = MetricsSystem.counter(counterName).getCount(); return uptime == 0 ? value : value / uptime; } }); }

Target:
protected void registerThroughputGauge(String counterName, String throughputName) { MetricsSystem.registerGaugeIfAbsent(throughputName, new Gauge<Object>() { @Override public Object getValue() { long lastClearTime = mMetricsStore.getLastClearTime(); long uptime = (mClock.millis() - lastClearTime) / Constants.MINUTE_MS; long value = MetricsSystem.counter(counterName).getCount(); return uptime <= 0 ? value : value / uptime; } }); }
Source:
static String getSuccessTokenResponseWithFamilyClientId() { final String tokenResponse = "{\"id_token\":\"" + TEST_IDTOKEN + "\",\"access_token\":\"I am a new access token\",\"token_type\":\"Bearer\",\"expires_in\":\"10\",\"expires_on\":\"1368768616\",\"refresh_token\":\"I am a new refresh token\",\"scope\":\"*\""; final StringBuilder tokenResponseBuilder = new StringBuilder(tokenResponse); tokenResponseBuilder.append(",\"resource\":\"resource\""); tokenResponseBuilder.append(",\"foci\":\"1\"}"); return tokenResponseBuilder.toString(); }

Target:
static String getSuccessTokenResponseWithFamilyClientId() throws JSONException { final JSONObject responseJsonObject = getCommonSuccessResponseData(); responseJsonObject.put("refresh_token", "I am a new refresh token"); responseJsonObject.put("resource", "resource"); responseJsonObject.put("foci", "1"); return responseJsonObject.toString(); }
Source:
public Optional<Credentials> retrieveCredentials(HttpServletRequest request) { String authenticationHeader = request.getHeader("Authorization"); if (authenticationHeader == null) { return Optional.empty(); } StringTokenizer tokenizer = new StringTokenizer(authenticationHeader, " "); String authType = tokenizer.nextToken(); if (HttpServletRequest.BASIC_AUTH.equalsIgnoreCase(authType)) { String usernameAndPassword = new String(Base64.getDecoder().decode(tokenizer.nextToken())); tokenizer = new StringTokenizer(usernameAndPassword, ":"); String username = tokenizer.nextToken(); String password = tokenizer.nextToken(); return Optional.of(new UsernamePasswordCredentials(username, password)); } return Optional.empty(); }

Target:
public Optional<Credentials> retrieveCredentials(HttpServletRequest request) { String authenticationHeader = request.getHeader("Authorization"); if (authenticationHeader == null) { return Optional.empty(); } String[] tokens = authenticationHeader.split(" "); if (tokens.length == 2) { String authType = tokens[0]; if (HttpServletRequest.BASIC_AUTH.equalsIgnoreCase(authType)) { String usernameAndPassword = new String(Base64.getDecoder().decode(tokens[1])); tokens = usernameAndPassword.split(":"); if (tokens.length == 2) { String username = tokens[0]; String password = tokens[1]; return Optional.of(new UsernamePasswordCredentials(username, password)); } } } return Optional.empty(); }
Source:
public void announce(String path, byte[] bytes, boolean removeParentIfCreated) { synchronized (toAnnounce) { if (!started) { toAnnounce.add(new Announceable(path, bytes, removeParentIfCreated)); return; } } final String parentPath = ZKPathsUtils.getParentPath(path); boolean buildParentPath = false; byte[] value = announcedPaths.get(path); if (value == null) { try { if (curator.checkExists().forPath(parentPath) == null) { buildParentPath = true; } } catch (Exception e) { log.debug(e, "Problem checking if the parent existed, ignoring."); } synchronized (toAnnounce) { if (!listeners.containsKey(path)) { final NodeCache cache = new NodeCache(curator, path, true); cache.getListenable().addListener( () -> { ChildData currentData = cache.getCurrentData(); if (currentData == null) { final byte[] value1 = announcedPaths.get(path); if (value1 != null) { log.info("Node[%s] dropped, reinstating.", path); createAnnouncement(path, value1); } } } ); if (started) { if (buildParentPath) { createPath(parentPath, removeParentIfCreated); } startCache(cache); listeners.put(path, cache); } } } } boolean created = false; synchronized (toAnnounce) { if (started) { byte[] oldBytes = announcedPaths.putIfAbsent(path, bytes); if (oldBytes == null) { created = true; } else if (!Arrays.equals(oldBytes, bytes)) { throw new IAE("Cannot reannounce different values under the same path"); } } } if (created) { try { createAnnouncement(path, bytes); } catch (Exception e) { throw new RuntimeException(e); } } }

Target:
public void announce(String path, byte[] bytes, boolean removeParentIfCreated) { synchronized (toAnnounce) { if (!started) { toAnnounce.add(new Announceable(path, bytes, removeParentIfCreated)); return; } } final String parentPath = ZKPathsUtils.getParentPath(path); boolean buildParentPath = false; byte[] value = announcedPaths.get(path); if (value == null) { try { if (curator.checkExists().forPath(parentPath) == null) { buildParentPath = true; } } catch (Exception e) { log.debug(e, "Problem checking if the parent path doesn't exist, ignoring."); } synchronized (toAnnounce) { if (!listeners.containsKey(path)) { final NodeCache cache = new NodeCache(curator, path, true); cache.getListenable().addListener( () -> { ChildData currentData = cache.getCurrentData(); if (currentData == null) { final byte[] value1 = announcedPaths.get(path); if (value1 != null) { log.info("Node[%s] dropped, reinstating.", path); createAnnouncement(path, value1); } } } ); if (started) { if (buildParentPath) { createPath(parentPath, removeParentIfCreated); } startCache(cache); listeners.put(path, cache); } } } } boolean created = false; synchronized (toAnnounce) { if (started) { byte[] oldBytes = announcedPaths.putIfAbsent(path, bytes); if (oldBytes == null) { created = true; } else if (!Arrays.equals(oldBytes, bytes)) { throw new IAE("Cannot reannounce different values under the same path"); } } } if (created) { try { createAnnouncement(path, bytes); } catch (Exception e) { throw new RuntimeException(e); } } }
Source:
private boolean connectHostToPool() { final VDS vds = getVds(); EventResult result = ((EventQueue) EjbUtils.findBean(BeanType.EVENTQUEUE_MANAGER, BeanProxyType.LOCAL)).submitEventSync(new Event(getStoragePool().getId(), null, vds.getId(), EventType.VDSCONNECTTOPOOL, "Trying to connect the host to the pool "+getStoragePool().getId()), new Callable<EventResult>() { @Override public EventResult call() { return runConnectHostToPoolEvent(getStoragePool().getId(), vds); } }); if (result != null) { return result.isSuccess(); } return false; }

Target:
private boolean connectHostToPool() { final VDS vds = getVds(); EventResult result = ((EventQueue) EjbUtils.findBean(BeanType.EVENTQUEUE_MANAGER, BeanProxyType.LOCAL)).submitEventSync(new Event(getStoragePool().getId(), null, vds.getId(), EventType.VDSCONNECTTOPOOL,"Trying to connect host " + vds.getHostName() + " with id "+ vds.getId()+" to the pool " + getStoragePool().getId()), new Callable<EventResult>() { @Override public EventResult call() { return runConnectHostToPoolEvent(getStoragePool().getId(), vds); } }); if (result != null) { return result.isSuccess(); } return false; }
Source:
public ProcessStreamHandler( Process process, boolean quiet, String prefix, StreamExceptionHandler failureHandler, PrintStream out, PrintStream err ) { this.process = process; storedOutput = new PrintStream( byteArrayOutputStream ); storedError = new PrintStream( byteArrayErrorStream ); out = duplexPrintStream( out, storedOutput ); err = duplexPrintStream( err, storedError ); this.out = new Thread( new StreamConsumer( process.getInputStream(), out, quiet, prefix, failureHandler ) ); this.err = new Thread( new StreamConsumer( process.getErrorStream(), err, quiet, prefix, failureHandler ) ); }

Target:
public ProcessStreamHandler( Process process, boolean quiet, String prefix, StreamExceptionHandler failureHandler, PrintStream out, PrintStream err ) { this.process = process; this.out = new Thread( new StreamConsumer( process.getInputStream(), out, quiet, prefix, failureHandler ) ); this.err = new Thread( new StreamConsumer( process.getErrorStream(), err, quiet, prefix, failureHandler ) ); }
Source:
private List<PhaseConfig> create( final List<PhaseConfigModel> phaseConfigList ) { if ( phaseConfigList == null ) { return null; } else { List<PhaseConfig> result = new ArrayList<>( phaseConfigList.size() ); for ( PhaseConfigModel phaseConfigModel : phaseConfigList ) { if ( phaseConfigModel instanceof ConstructionHeuristicPhaseConfigModel ) { ConstructionHeuristicPhaseConfig phaseConfig = new ConstructionHeuristicPhaseConfig(); ConstructionHeuristicPhaseConfigModel constructionHeuristicPhaseConfigModel = (ConstructionHeuristicPhaseConfigModel) phaseConfigModel; if ( constructionHeuristicPhaseConfigModel.getConstructionHeuristicType() != null ) { phaseConfig.setConstructionHeuristicType( ConstructionHeuristicType.valueOf( ( constructionHeuristicPhaseConfigModel.getConstructionHeuristicType().name() ) ) ); } result.add( phaseConfig ); } } return result; } }

Target:
private List<PhaseConfig> create( final List<PhaseConfigModel> phaseConfigList ) { if ( phaseConfigList == null ) { return new ArrayList<>(); } else { List<PhaseConfig> result = new ArrayList<>( phaseConfigList.size() ); for ( PhaseConfigModel phaseConfigModel : phaseConfigList ) { if ( phaseConfigModel instanceof ConstructionHeuristicPhaseConfigModel ) { ConstructionHeuristicPhaseConfig phaseConfig = new ConstructionHeuristicPhaseConfig(); ConstructionHeuristicPhaseConfigModel constructionHeuristicPhaseConfigModel = (ConstructionHeuristicPhaseConfigModel) phaseConfigModel; if ( constructionHeuristicPhaseConfigModel.getConstructionHeuristicType() != null ) { phaseConfig.setConstructionHeuristicType( ConstructionHeuristicType.valueOf( ( constructionHeuristicPhaseConfigModel.getConstructionHeuristicType().name() ) ) ); } result.add( phaseConfig ); } } return result; } }
Source:
private long insertRevision(SQLDatabase db,InsertRevisionOptions options) throws AttachmentException { long newSequence; ContentValues args = new ContentValues(); args.put("doc_id", options.docNumericId); args.put("revid", options.revId); if (options.parentSequence > 0) { args.put("parent", options.parentSequence); } args.put("current", options.current); args.put("deleted", options.deleted); args.put("available", options.available); args.put("json", options.data); logger.fine("New revision inserted: " + options.docNumericId + ", " + options.revId); newSequence = db.insert("revs", args); if (newSequence < 0) { throw new IllegalStateException("Unknown error inserting new updated doc, please checking log"); } if (options.copyAttachments) { this.attachmentManager.copyAttachments(db,options.parentSequence, newSequence); } return newSequence; }

Target:
private long insertRevision(SQLDatabase db,InsertRevisionOptions options) { long newSequence; ContentValues args = new ContentValues(); args.put("doc_id", options.docNumericId); args.put("revid", options.revId); if (options.parentSequence > 0) { args.put("parent", options.parentSequence); } args.put("current", options.current); args.put("deleted", options.deleted); args.put("available", options.available); args.put("json", options.data); logger.fine("New revision inserted: " + options.docNumericId + ", " + options.revId); newSequence = db.insert("revs", args); if (newSequence < 0) { throw new IllegalStateException("Unknown error inserting new updated doc, please check log"); } return newSequence; }
Source:
public void testBaseline() throws Exception { assertBaseline(content(null, GridRestCommand.BASELINE_CURRENT_STATE), gridCount(), gridCount()); stopGrid(gridCount() - 1); assertBaseline(content(null, GridRestCommand.BASELINE_CURRENT_STATE), gridCount(), gridCount() - 1); startGrid(gridCount() - 1); assertBaseline(content(null, GridRestCommand.BASELINE_CURRENT_STATE), gridCount(), gridCount()); }

Target:
public void testBaseline() throws Exception { int sz = gridCount(); assertBaseline(content(null, GridRestCommand.BASELINE_CURRENT_STATE), sz, sz); stopGrid(sz - 1); assertBaseline(content(null, GridRestCommand.BASELINE_CURRENT_STATE), sz, sz - 1); startGrid(sz - 1); assertBaseline(content(null, GridRestCommand.BASELINE_CURRENT_STATE), sz, sz); }
Source:
private ModuleMeta(String name, Module module) { this(name, module, new DefaultAttributeMap()); }

Target:
private ModuleMeta(String name, Module module) { LOG.debug("Initializing as {}", name, module.getClass().getName()); this.name = name; this.module = module; this.attributes = new DefaultAttributeMap(); this.dag = new LogicalPlan(); }
Source:
public String getEditorConfigId() { return "XTEXT_ValueSpecification_Cell_Editor"; }

Target:
public String getEditorConfigId() { return XTEXT_VALUE_SPECIFICATION_CELL_EDITOR_IDENTIFIER; }
Source:
public void setMaximized(boolean maximized) { getElement().setAttribute("maximized", "" + maximized); }

Target:
public void setMaximized(boolean maximized) { getElement().setAttribute("maximized", Boolean.toString(maximized)); }