auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static Endpoint parseEndpoint(JsonParser parser) throws IOException { if (!parser.isExpectedStartObjectToken()) { throw new IOException("Not a valid JSON object, start token: " + parser.currentToken()); } String serviceName = null, ipv4 = null, ipv6 = null; int port = 0; while (parser.nextToken() != JsonToken.END_OBJECT) { JsonToken value = parser.nextValue(); if (value == JsonToken.VALUE_NULL) { continue; } switch (parser.currentName()) { case "serviceName": serviceName = parser.getText(); break; case "ipv4": ipv4 = parser.getText(); break; case "ipv6": ipv6 = parser.getText(); break; case "port": port = parser.getIntValue(); break; default: } } if (serviceName == null && ipv4 == null && ipv6 == null && port == 0) return null; return Endpoint.newBuilder() .serviceName(serviceName) .ip(ipv4) .ip(ipv6) .port(port) .build(); }

Target:
static Endpoint parseEndpoint(JsonParser parser) throws IOException { if (!parser.isExpectedStartObjectToken()) { throw new IllegalArgumentException("Not a valid JSON object, start token: " + parser.currentToken()); } String serviceName = null, ipv4 = null, ipv6 = null; int port = 0; while (parser.nextToken() != JsonToken.END_OBJECT) { JsonToken value = parser.nextValue(); if (value == JsonToken.VALUE_NULL) { continue; } switch (parser.currentName()) { case "serviceName": serviceName = parser.getText(); break; case "ipv4": ipv4 = parser.getText(); break; case "ipv6": ipv6 = parser.getText(); break; case "port": port = parser.getIntValue(); break; default: } } if (serviceName == null && ipv4 == null && ipv6 == null && port == 0) return null; return Endpoint.newBuilder() .serviceName(serviceName) .ip(ipv4) .ip(ipv6) .port(port) .build(); }
Source:
public Jdbi build(Environment environment, PooledDataSourceFactory configuration, ManagedDataSource dataSource, String name) { final Jdbi jdbi = this.newInstance(dataSource); environment.lifecycle().manage(dataSource); final String validationQuery = configuration.getValidationQuery(); environment.healthChecks().register(name, new JdbiHealthCheck( environment.getHealthCheckExecutorService(), configuration.getValidationQueryTimeout().orElseGet(() -> Duration.seconds(5)), jdbi, validationQuery)); jdbi.setTimingCollector(new InstrumentedTimingCollector(environment.metrics(), nameStrategy)); if (configuration.isAutoCommentsEnabled()) { final TemplateEngine original = jdbi.getConfig(SqlStatements.class).getTemplateEngine(); jdbi.setTemplateEngine(new NamePrependingTemplateEngine(original)); } configure(jdbi, configuration); return jdbi; }

Target:
public Jdbi build(Environment environment, PooledDataSourceFactory configuration, ManagedDataSource dataSource, String name) { final Jdbi jdbi = newInstance(dataSource); environment.lifecycle().manage(dataSource); final String validationQuery = configuration.getValidationQuery(); environment.healthChecks().register(name, new JdbiHealthCheck( environment.getHealthCheckExecutorService(), configuration.getValidationQueryTimeout().orElseGet(() -> Duration.seconds(5)), jdbi, validationQuery)); jdbi.setTimingCollector(new InstrumentedTimingCollector(environment.metrics(), nameStrategy)); if (configuration.isAutoCommentsEnabled()) { final TemplateEngine original = jdbi.getConfig(SqlStatements.class).getTemplateEngine(); jdbi.setTemplateEngine(new NamePrependingTemplateEngine(original)); } configure(jdbi); return jdbi; }
Source:
private ValidationResult validateCoherentNetworkIdentification(NetworkAttachment attachment) { Guid networkId = attachment.getNetworkId(); String networkName = attachment.getNetworkName(); Guid violatingEntityId = attachment.getId(); return validateCoherentIdentification(violatingEntityId == null ? null : violatingEntityId.toString(), networkId, networkName, EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY, networkBusinessEntityMap); }

Target:
private ValidationResult validateCoherentNetworkIdentification(NetworkAttachment attachment) { Guid networkId = attachment.getNetworkId(); String networkName = attachment.getNetworkName(); Guid violatingEntityId = attachment.getId(); return validateCoherentIdentification(String.valueOf(violatingEntityId), networkId, networkName, EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY, networkBusinessEntityMap); }
Source:
public String getUsernameWithProfile() { String user = String.format("%s@%s", StringUtils.defaultIfEmpty(username, ""), StringUtils.defaultIfEmpty(profile, "")); return "@".equals(user) ? "N/A" : user; }

Target:
public String getUsernameWithProfile() { String user = String.format("%s@%s", java.util.Objects.toString(username, ""), java.util.Objects.toString(profile, "")); return "@".equals(user) ? "N/A" : user; }
Source:
private Container getRandomContainer(short accountId) { short refContainerId = Utils.getRandomShort(TestUtils.RANDOM); String refContainerName = UtilsTest.getRandomString(10); Container.ContainerStatus refContainerStatus = Container.ContainerStatus.ACTIVE; String refContainerDescription = UtilsTest.getRandomString(10); boolean refContainerEncryption = TestUtils.RANDOM.nextBoolean(); boolean refContainerPreviousEncryption = refContainerEncryption || TestUtils.RANDOM.nextBoolean(); boolean refContainerCaching = TestUtils.RANDOM.nextBoolean(); boolean refContainerMediaScanDisabled = TestUtils.RANDOM.nextBoolean(); boolean refContainerTtlRequired = TestUtils.RANDOM.nextBoolean(); return new ContainerBuilder(refContainerId, refContainerName, refContainerStatus, refContainerDescription, accountId).setEncrypted(refContainerEncryption) .setPreviouslyEncrypted(refContainerPreviousEncryption) .setCacheable(refContainerCaching) .setMediaScanDisabled(refContainerMediaScanDisabled) .setTtlRequired(refContainerTtlRequired) .build(); }

Target:
private Container getRandomContainer(short accountId) { short refContainerId = Utils.getRandomShort(TestUtils.RANDOM); String refContainerName = UtilsTest.getRandomString(10); Container.ContainerStatus refContainerStatus = Container.ContainerStatus.ACTIVE; String refContainerDescription = UtilsTest.getRandomString(10); boolean refContainerEncryption = TestUtils.RANDOM.nextBoolean(); boolean refContainerPreviousEncryption = refContainerEncryption || TestUtils.RANDOM.nextBoolean(); boolean refContainerCaching = TestUtils.RANDOM.nextBoolean(); boolean refContainerMediaScanDisabled = TestUtils.RANDOM.nextBoolean(); return new ContainerBuilder(refContainerId, refContainerName, refContainerStatus, refContainerDescription, accountId).setEncrypted(refContainerEncryption) .setPreviouslyEncrypted(refContainerPreviousEncryption) .setCacheable(refContainerCaching) .setMediaScanDisabled(refContainerMediaScanDisabled) .setTtlRequired(false) .build(); }
Source:
private static String getPathString(IPath path, boolean isCygwin) { String s = path.toString(); if (isCygwin) { s = s.replaceAll("^([A-Z])(:)", "/" + CYGWIN_PREFIX + "/$1"); } else { s = s.replaceAll("^([A-Z])(:)", "/$1"); } return s; }

Target:
private static String getPathString(IPath path, boolean isCygwin) { String s = path.toString(); if (isCygwin) { s = s.replaceAll("^([a-zA-Z]):", "/" + CYGWIN_PREFIX + "/$1"); } else { s = s.replaceAll("^([a-zA-Z]):", "/$1"); } return s; }
Source:
private List<NetworkAttachment> getNetworkAttachmentsToSync(Guid hostId, List<Network> networks) { List<NetworkAttachment> allAttachmentsOfHost = networkAttachmentDao.getAllForHost(hostId); Map<Guid, NetworkAttachment> attachmentsByNetworkId = new MapNetworkAttachments(allAttachmentsOfHost).byNetworkId(); List<NetworkAttachment> attachmentsToSync = new ArrayList<>(); for (Network network : networks) { Guid networkId = network.getId(); NetworkAttachment attachmentToSync = attachmentsByNetworkId.get(networkId); attachmentToSync.setOverrideConfiguration(!attachmentToSync.isQosOverridden()); attachmentsToSync.add(attachmentToSync); } return attachmentsToSync; }

Target:
private List<NetworkAttachment> getNetworkAttachmentsToSync(Guid hostId, List<Network> networks) { List<NetworkAttachment> allAttachmentsOfHost = networkAttachmentDao.getAllForHost(hostId); Map<Guid, NetworkAttachment> attachmentsByNetworkId = new MapNetworkAttachments(allAttachmentsOfHost).byNetworkId(); List<NetworkAttachment> attachmentsToSync = new ArrayList<>(); for (Network network : networks) { Guid networkId = network.getId(); NetworkAttachment attachmentToSync = attachmentsByNetworkId.get(networkId); if (!attachmentToSync.isQosOverridden()) { attachmentToSync.setOverrideConfiguration(true); attachmentsToSync.add(attachmentToSync); } } return attachmentsToSync; }
Source:
public static Object[] inject(final Parameter[] parameters, final Set<InjectableParameter> filters, final Object[] args, final Method injectionMethod, final ITestContext context, final ITestResult testResult) { if (filters == null || filters.isEmpty()) { return args; } final ArrayList<Object> arguments = new ArrayList<>(args.length); final ListBackedImmutableQueue<Object> queue = new ListBackedImmutableQueue<>(args); boolean firstMethodInjected = false; for (final Parameter parameter : parameters) { boolean inject = false; Object injectObject = null; for (final InjectableParameter injectableParameter : filters) { inject = canInject(parameter, injectableParameter); switch (injectableParameter) { case CURRENT_TEST_METHOD: injectObject = injectionMethod; if (inject && !firstMethodInjected) { firstMethodInjected = true; } else { inject = false; } break; case ITEST_CONTEXT: injectObject = context; break; case ITEST_RESULT: injectObject = testResult; break; case XML_TEST: injectObject = context != null ? context.getCurrentXmlTest() : null; break; default: break; } if (inject) { arguments.add(injectObject); break; } } if (!inject) { arguments.add(queue.poll()); } } if (!queue.backingList.isEmpty()) { String msg = MethodMatcherException.generateMessage("Missing one or more parameters " + "that are being injected by the data provider. Please add the below arguments to the method.", injectionMethod, queue.backingList.toArray()); boolean block = Boolean.parseBoolean(System.getProperty("strictParameterMatch")); if (block) { throw new MethodMatcherException(msg); } else { System.err.println(":::WARNING:::\n" + msg); } } final Object[] injectedArray = new Object[arguments.size()]; return arguments.toArray(injectedArray); }

Target:
public static Object[] inject(final Parameter[] parameters, final Set<InjectableParameter> filters, final Object[] args, final Method injectionMethod, final ITestContext context, final ITestResult testResult) { return nativelyInject(parameters, filters, args, injectionMethod, context, testResult); }
Source:
public String getNickname() { return nickname; }

Target:
public String getNickname() { return _nickname; }
Source:
private boolean isEqualParameterTypes(IService service1, IService service2) { final List<IType> paramTypes1 = service1.getParameterTypes(queryEnvironment); final List<IType> paramTypes2 = service2.getParameterTypes(queryEnvironment); boolean result = paramTypes1.size() == paramTypes2.size(); if (result) { final Iterator<IType> it1 = paramTypes1.iterator(); final Iterator<IType> it2 = paramTypes2.iterator(); while (it1.hasNext()) { IType paramType1 = it1.next(); IType paramType2 = it2.next(); if (!paramType2.equals(paramType1)) { result = false; break; } } } return result; }

Target:
private boolean isEqualParameterTypes(IService service1, IService service2) { final List<IType> paramTypes1 = service1.getParameterTypes(queryEnvironment); final List<IType> paramTypes2 = service2.getParameterTypes(queryEnvironment); boolean result = paramTypes1.size() == paramTypes2.size(); final Iterator<IType> it1 = paramTypes1.iterator(); final Iterator<IType> it2 = paramTypes2.iterator(); while (result && it1.hasNext()) { IType paramType1 = it1.next(); IType paramType2 = it2.next(); if (!paramType2.equals(paramType1)) { result = false; } } return result; }
Source:
protected void decode(ChannelHandlerContext ctx, WebSocketFrame frame, List<Object> out) throws Exception { if (frame instanceof CloseWebSocketFrame) { serverReceivedCloseHandshake = true; frame.retain(); return; } super.decode(ctx, frame, out); }

Target:
protected void decode(ChannelHandlerContext ctx, WebSocketFrame frame, List<Object> out) throws Exception { if (frame instanceof CloseWebSocketFrame) { serverReceivedCloseHandshake = true; return; } super.decode(ctx, frame, out); }
Source:
public RngDeviceParameters(VmRngDevice rngDevice, boolean vm) { if (rngDevice == null) { throw new IllegalArgumentException("RNG Device must be specified."); } this.rngDevice = rngDevice; isVm = vm; }

Target:
public RngDeviceParameters(VmRngDevice rngDevice, boolean vm) { this.rngDevice = rngDevice; isVm = vm; }
Source:
public void testClientsConnections() throws Exception { try (IgniteEx g0 = startGrid(0)) { String host = g0.configuration().getClientConnectorConfiguration().getHost(); if (host == null) host = g0.configuration().getLocalHost(); int port = g0.configuration().getClientConnectorConfiguration().getPort(); try (IgniteClient client = Ignition.startClient(new ClientConfiguration().setAddresses(host + ":" + port))) { SystemView<ClientConnectionView> conns = g0.context().systemView().view(CLI_CONN_SYS_VIEW); assertEquals(1, conns.size()); ClientConnectionView cliConn = conns.iterator().next(); assertEquals("THIN", cliConn.type()); assertEquals(cliConn.localAddress().getHostName(), cliConn.remoteAddress().getHostName()); assertEquals(g0.configuration().getClientConnectorConfiguration().getPort(), cliConn.localAddress().getPort()); assertEquals(cliConn.version(), DEFAULT_VER.asString()); try (Connection conn = new IgniteJdbcThinDriver().connect("jdbc:ignite:thin://" + host, new Properties())) { assertEquals(2, conns.size()); assertEquals(1, F.size(jdbcConnectionsIterator(conns), alwaysTrue())); ClientConnectionView jdbcConn = jdbcConnectionsIterator(conns).next(); assertEquals("JDBC", jdbcConn.type()); assertEquals(jdbcConn.localAddress().getHostName(), jdbcConn.remoteAddress().getHostName()); assertEquals(g0.configuration().getClientConnectorConfiguration().getPort(), jdbcConn.localAddress().getPort()); assertEquals(jdbcConn.version(), CURRENT_VER.asString()); } } } }

Target:
public void testClientsConnections() throws Exception { try (IgniteEx g0 = startGrid(0)) { String host = g0.configuration().getClientConnectorConfiguration().getHost(); if (host == null) host = g0.configuration().getLocalHost(); int port = g0.configuration().getClientConnectorConfiguration().getPort(); SystemView<ClientConnectionView> conns = g0.context().systemView().view(CLI_CONN_SYS_VIEW); try (IgniteClient cli = Ignition.startClient(new ClientConfiguration().setAddresses(host + ":" + port))) { assertEquals(1, conns.size()); ClientConnectionView cliConn = conns.iterator().next(); assertEquals("THIN", cliConn.type()); assertEquals(cliConn.localAddress().getHostName(), cliConn.remoteAddress().getHostName()); assertEquals(g0.configuration().getClientConnectorConfiguration().getPort(), cliConn.localAddress().getPort()); assertEquals(cliConn.version(), ProtocolVersion.CURRENT_VER.toString()); try (Connection conn = new IgniteJdbcThinDriver().connect("jdbc:ignite:thin://" + host, new Properties())) { assertEquals(2, conns.size()); assertEquals(1, F.size(jdbcConnectionsIterator(conns))); ClientConnectionView jdbcConn = jdbcConnectionsIterator(conns).next(); assertEquals("JDBC", jdbcConn.type()); assertEquals(jdbcConn.localAddress().getHostName(), jdbcConn.remoteAddress().getHostName()); assertEquals(g0.configuration().getClientConnectorConfiguration().getPort(), jdbcConn.localAddress().getPort()); assertEquals(jdbcConn.version(), JdbcConnectionContext.CURRENT_VER.asString()); } } boolean res = GridTestUtils.waitForCondition(() -> conns.size() == 0, 5_000); assertTrue(res); } }
Source:
public SnapshotInfo takeSnapshot(SnapshotInfo snapshot) { SnapshotInfo snapshotOnPrimary = null; Object payload = snapshot.getPayload(); CreateSnapshotPayload createSnapshotPayload = null; if (payload != null) { createSnapshotPayload = (CreateSnapshotPayload)payload; if (createSnapshotPayload.getQuiescevm()) { throw new InvalidParameterValueException("can't handle quiescevm equal true for volume snapshot"); } } SnapshotVO snapshotVO = snapshotDao.acquireInLockTable(snapshot.getId()); if (snapshotVO == null) { throw new CloudRuntimeException("Failed to get lock on snapshot:" + snapshot.getId()); } try { VolumeInfo volumeInfo = snapshot.getBaseVolume(); volumeInfo.stateTransit(Volume.Event.SnapshotRequested); SnapshotResult result = null; try { result = snapshotSvr.takeSnapshot(snapshot); if (result.isFailed()) { s_logger.debug("Failed to take snapshot: " + result.getResult()); throw new CloudRuntimeException(result.getResult()); } } finally { if (result != null && result.isSuccess()) { volumeInfo.stateTransit(Volume.Event.OperationSucceeded); } else { volumeInfo.stateTransit(Volume.Event.OperationFailed); } } snapshotOnPrimary = result.getSnapshot(); snapshotOnPrimary.addPayload(snapshot.getPayload()); _snapshotDetailsDao.addDetail(((SnapshotObject)snapshotOnPrimary).getId(), AsyncJob.Constants.MS_ID, Long.toString(MacAddress.getMacAddress().toLong()), false); return snapshotOnPrimary; } finally { if (snapshotVO != null) { snapshotDao.releaseFromLockTable(snapshotOnPrimary.getId()); } } }

Target:
public SnapshotInfo takeSnapshot(SnapshotInfo snapshot) { SnapshotInfo snapshotOnPrimary = null; Object payload = snapshot.getPayload(); CreateSnapshotPayload createSnapshotPayload = null; if (payload != null) { createSnapshotPayload = (CreateSnapshotPayload)payload; if (createSnapshotPayload.getQuiescevm()) { throw new InvalidParameterValueException("can't handle quiescevm equal true for volume snapshot"); } } SnapshotVO snapshotVO = snapshotDao.acquireInLockTable(snapshot.getId()); if (snapshotVO == null) { throw new CloudRuntimeException("Failed to get lock on snapshot:" + snapshot.getId()); } try { VolumeInfo volumeInfo = snapshot.getBaseVolume(); volumeInfo.stateTransit(Volume.Event.SnapshotRequested); SnapshotResult result = null; try { result = snapshotSvr.takeSnapshot(snapshot); if (result.isFailed()) { s_logger.debug("Failed to take snapshot: " + result.getResult()); throw new CloudRuntimeException(result.getResult()); } } finally { if (result != null && result.isSuccess()) { volumeInfo.stateTransit(Volume.Event.OperationSucceeded); } else { volumeInfo.stateTransit(Volume.Event.OperationFailed); } } snapshotOnPrimary = result.getSnapshot(); snapshotOnPrimary.addPayload(snapshot.getPayload()); _snapshotDetailsDao.addDetail(((SnapshotObject)snapshotOnPrimary).getId(), AsyncJob.Constants.MS_ID, Long.toString(ManagementServerNode.getManagementServerId()), false); return snapshotOnPrimary; } finally { if (snapshotVO != null) { snapshotDao.releaseFromLockTable(snapshot.getId()); } } }
Source:
@Test public void nonNull() throws Exception { JsonAdapter<String> toUpperCase = new JsonAdapter<String>() { @Override public String fromJson(JsonReader reader) throws IOException { return reader.nextString().toUpperCase(Locale.US); } @Override public void toJson(JsonWriter writer, String value) throws IOException { writer.value(value.toUpperCase(Locale.US)); } }.nonNull(); JsonReader reader = factory.newReader("[\"a\", null, \"c\"]"); reader.beginArray(); assertThat(toUpperCase.fromJson(reader)).isEqualTo("A"); try { toUpperCase.fromJson(reader); fail(); } catch (JsonDataException expected) { assertThat(expected).hasMessage("Unexpected null at $[1]"); assertThat(reader.<Object>nextNull()).isNull(); } assertThat(toUpperCase.fromJson(reader)).isEqualTo("C"); reader.endArray(); JsonWriter writer = factory.newWriter(); writer.beginArray(); toUpperCase.toJson(writer, "a"); try { toUpperCase.toJson(writer, null); fail(); } catch (JsonDataException expected) { assertThat(expected).hasMessage("Unexpected null at $[1]"); writer.nullValue(); } toUpperCase.toJson(writer, "c"); writer.endArray(); assertThat(factory.json()).isEqualTo("[\"A\",null,\"C\"]"); }

Target:
@Test public void nonNull() throws Exception { JsonAdapter<String> toUpperCase = new JsonAdapter<String>() { @Override public String fromJson(JsonReader reader) throws IOException { return reader.nextString().toUpperCase(Locale.US); } @Override public void toJson(JsonWriter writer, String value) throws IOException { writer.value(value.toUpperCase(Locale.US)); } }.nonNull(); JsonReader reader = factory.newReader("[\"a\", null, \"c\"]"); reader.beginArray(); assertThat(toUpperCase.fromJson(reader)).isEqualTo("A"); try { toUpperCase.fromJson(reader); fail(); } catch (JsonDataException expected) { assertThat(expected).hasMessage("Unexpected null at $[1]"); assertThat(reader.nextNull()).isNull(); } assertThat(toUpperCase.fromJson(reader)).isEqualTo("C"); reader.endArray(); JsonWriter writer = factory.newWriter(); writer.beginArray(); toUpperCase.toJson(writer, "a"); try { toUpperCase.toJson(writer, null); fail(); } catch (JsonDataException expected) { assertThat(expected).hasMessage("Unexpected null at $[1]"); writer.nullValue(); } toUpperCase.toJson(writer, "c"); writer.endArray(); assertThat(factory.json()).isEqualTo("[\"A\",null,\"C\"]"); }
Source:
public boolean createOzoneVolumeIfNeeded(String userName) throws IOException { boolean newVolumeCreate = true; String ozoneVolumeName = formatOzoneVolumeName(userName); try { OmVolumeArgs args = OmVolumeArgs.newBuilder() .setAdminName(S3_ADMIN_NAME) .setOwnerName(userName) .setVolume(ozoneVolumeName) .setQuotaInBytes(OzoneConsts.MAX_QUOTA_IN_BYTES) .build(); if (isRatisEnabled) { volumeManager.applyCreateVolume(args, volumeManager.createVolume(args)); } volumeManager.createVolume(args); } catch (OMException exp) { newVolumeCreate = false; if (exp.getResult().compareTo(VOLUME_ALREADY_EXISTS) == 0) { if (LOG.isDebugEnabled()) { LOG.debug("Volume already exists. {}", exp.getMessage()); } } else { throw exp; } } return newVolumeCreate; }

Target:
public boolean createOzoneVolumeIfNeeded(String userName) throws IOException { boolean newVolumeCreate = true; String ozoneVolumeName = formatOzoneVolumeName(userName); try { OmVolumeArgs args = OmVolumeArgs.newBuilder() .setAdminName(S3_ADMIN_NAME) .setOwnerName(userName) .setVolume(ozoneVolumeName) .setQuotaInBytes(OzoneConsts.MAX_QUOTA_IN_BYTES) .build(); if (isRatisEnabled) { volumeManager.applyCreateVolume(args, volumeManager.createVolume(args)); } else { volumeManager.createVolume(args); } } catch (OMException exp) { newVolumeCreate = false; if (exp.getResult().compareTo(VOLUME_ALREADY_EXISTS) == 0) { if (LOG.isDebugEnabled()) { LOG.debug("Volume already exists. {}", exp.getMessage()); } } else { throw exp; } } return newVolumeCreate; }
Source:
public JSONObject toJSON() throws JSONException { JSONObject rv = new JSONObject(); JSONArray array; rv.put("format", format.ordinal()); rv.put("plainLat", plainLat); rv.put("plainLon", plainLon); rv.put("latHemisphere", latHemisphere); rv.put("lonHemisphere", lonHemisphere); array = new JSONArray(); for (CalculateButton.ButtonData but : buttons) { array.put(but.toJASON()); } rv.put("buttons", array); array = new JSONArray(); for (CalculatorVariable.VariableData equ : equations) { array.put(equ.toJSON()); } rv.put("equations", array); array = new JSONArray(); for (CalculatorVariable.VariableData equ : freeVariables) { array.put(equ.toJSON()); } rv.put("freeVariables", array); rv.put("notes", notes); return rv; }

Target:
public JSONObject toJSON() throws JSONException { final JSONObject rv = new JSONObject(); rv.put("format", format.ordinal()); rv.put("plainLat", plainLat); rv.put("plainLon", plainLon); rv.put("latHemisphere", latHemisphere); rv.put("lonHemisphere", lonHemisphere); { final JSONArray array = new JSONArray(); for (final CalculateButton.ButtonData but : buttons) { array.put(but.toJASON()); } rv.put("buttons", array); } { final JSONArray array = new JSONArray(); for (final CalculatorVariable.VariableData equ : equations) { array.put(equ.toJSON()); } rv.put("equations", array); } { final JSONArray array = new JSONArray(); for (final CalculatorVariable.VariableData equ : freeVariables) { array.put(equ.toJSON()); } rv.put("freeVariables", array); } rv.put("notes", notes); return rv; }
Source:
private static void checkRfsSpecified(CassandraKeyValueServiceConfig config, Set<String> dcs, Map<String, String> strategyOptions) { for (String dataCenter : dcs) { if (strategyOptions.get(dataCenter) == null) { logErrorOrThrow("The datacenter for this cassandra cluster is invalid. " + " failed dc: " + dataCenter + " strategyOptions: " + strategyOptions, config.ignoreDatacenterConfigurationChecks()); } } }

Target:
private static void checkRfsSpecified(CassandraKeyValueServiceConfig config, Set<String> dcs, Map<String, String> strategyOptions) { for (String datacenter : dcs) { if (strategyOptions.get(datacenter) == null) { logErrorOrThrow("The datacenter for this cassandra cluster is invalid. " + " failed dc: " + datacenter + " strategyOptions: " + strategyOptions, config.ignoreDatacenterConfigurationChecks()); } } }
Source:
public static void showFeedbackEmailChooser(final Activity activity) { activity.startActivity(Intent.createChooser(getFeedbackEmailIntent(activity), "Choose an email provider:")); activity.overridePendingTransition(0, 0); }

Target:
public static void showFeedbackEmailChooser(final Activity activity) { if (ActivityStateUtil.isActivityValid(activity)) { activity.startActivity(Intent.createChooser(getFeedbackEmailIntent(activity), "Choose an email provider:")); activity.overridePendingTransition(0, 0); } }
Source:
private void handleParallelVersions(IAtsConfigTxVersion version, IOseeBranch... parallelVersions) { for (IOseeBranch parallelVer : parallelVersions) { boolean found = false; for (IAtsVersion teamDefVer : teamDef.getVersions()) { if (teamDefVer.getBaselineBranchId() != null && teamDefVer.getBaselineBranchId().equals( parallelVer.getId())) { changes.relate(version.getVersion(), AtsRelationTypes.ParallelVersion_Child, teamDefVer); found = true; } } if (!found) { throw new OseeArgumentException("No parallel version %s found for version %s", parallelVer.toStringWithId(), version.getVersion().toStringWithId()); } } }

Target:
private void handleParallelVersions(IAtsConfigTxVersion version, IOseeBranch... parallelVersions) { for (IOseeBranch parallelVer : parallelVersions) { boolean found = false; for (IAtsVersion teamDefVer : teamDef.getVersions()) { if (teamDefVer.getBaselineBranchId().isValid() && teamDefVer.getBaselineBranchId().equals( parallelVer.getId())) { changes.relate(version.getVersion(), AtsRelationTypes.ParallelVersion_Child, teamDefVer); found = true; } } if (!found) { throw new OseeArgumentException("No parallel version %s found for version %s", parallelVer.toStringWithId(), version.getVersion().toStringWithId()); } } }
Source:
protected boolean isTagSanitizationEnabled() { return !hasFeature(TAGS_BELONG_TO_DOCUMENT) || Framework.getService(ConfigurationService.class).getBoolean(TAG_SANITIZATION_PROP, true); }

Target:
protected boolean isTagSanitizationEnabled() { return !hasFeature(TAGS_BELONG_TO_DOCUMENT) || Framework.getService(ConfigurationService.class).isBooleanTrue(TAG_SANITIZATION_PROP); }
Source:
public String getDescription() { return "Compute a TIN from the geometry given in argument.\n " + "The first argument force the intersection of all input edges.\n" + "The second argument is used to delete flat triangles.\n" + "If the geometry contains polygon or ligne the triangulation\n " + "is enforced using a constraint method."; }

Target:
public String getDescription() { return "Compute a TIN (Triangular Irregular Network) from the geometry given in argument.\n " + "The first argument force the intersection of all input edges.\n" + "The second argument is used to delete flat triangles.\n" + "If the geometry contains polygon or ligne the triangulation\n " + "is enforced using a constraint method."; }
Source:
public Map<String, Map<String, ServiceAttributes>> getHostGroupBasedServiceAttributes() { Map<String, Set<ServiceComponent>> hgToNonGwServiceComponents = getNonGatewayServicesByHostGroup(); Map<String, Set<ServiceComponent>> hgToNonGwServiceComponentsWithYarnNMs = new HashMap<>(); for (Entry<String, Set<ServiceComponent>> entry : hgToNonGwServiceComponents.entrySet()) { for (ServiceComponent sc : entry.getValue()) { if (sc.getService().equalsIgnoreCase(YarnRoles.YARN) && sc.getComponent() .equalsIgnoreCase(YarnRoles.NODEMANAGER)) { hgToNonGwServiceComponentsWithYarnNMs.put(entry.getKey(), entry.getValue()); break; } } } Map<String, Set<String>> componentsByHostGroup = hgToNonGwServiceComponentsWithYarnNMs.entrySet() .stream().collect( toMap( Entry::getKey, e -> e.getValue().stream() .map(ServiceComponent::getComponent) .collect(Collectors.toUnmodifiableSet()) )); Set<String> computeHostGroups = getRecommendationByBlacklist(BlackListedLoadBasedAutoscaleRole.class, true, componentsByHostGroup); Map<String, Map<String, ServiceAttributes>> result = new HashMap<>(); for (String hg : componentsByHostGroup.keySet()) { Map<String, ServiceAttributes> m; if (computeHostGroups.contains(hg)) { m = Collections.singletonMap(YarnRoles.YARN, new ServiceAttributes(ServiceComponent.of(YarnRoles.YARN, YarnRoles.NODEMANAGER), Collections.singletonMap(YarnConstants.ATTRIBUTE_NAME_NODE_INSTANCE_TYPE, YarnConstants.ATTRIBUTE_NODE_INSTANCE_TYPE_COMPUTE))); } else { m = Collections.singletonMap(YarnRoles.YARN, new ServiceAttributes(ServiceComponent.of(YarnRoles.YARN, YarnRoles.NODEMANAGER), Collections.singletonMap(YarnConstants.ATTRIBUTE_NAME_NODE_INSTANCE_TYPE, YarnConstants.ATTRIBUTE_NODE_INSTANCE_TYPE_WORKER))); } result.put(hg, m); } LOGGER.debug("ServiceAttributes: {}", result); return result; }

Target:
public Map<String, Map<String, ServiceAttributes>> getHostGroupBasedServiceAttributes() { Map<String, Set<String>> componentsByHostGroup = collectComponentsByHostGroupWithYarnNMs(); Set<String> computeHostGroups = getRecommendationByBlacklist(BlackListedLoadBasedAutoscaleRole.class, true, componentsByHostGroup, List.of()); Map<String, Map<String, ServiceAttributes>> result = new HashMap<>(); for (String hg : componentsByHostGroup.keySet()) { String instanceType = computeHostGroups.contains(hg) ? YarnConstants.ATTRIBUTE_NODE_INSTANCE_TYPE_COMPUTE : YarnConstants.ATTRIBUTE_NODE_INSTANCE_TYPE_WORKER; result.put(hg, Collections.singletonMap(YarnRoles.YARN, new ServiceAttributes(ServiceComponent.of(YarnRoles.YARN, YarnRoles.NODEMANAGER), Collections.singletonMap(YarnConstants.ATTRIBUTE_NAME_NODE_INSTANCE_TYPE, instanceType)))); } LOGGER.debug("ServiceAttributes: {}", result); return result; }
Source:
public Object[] fetchChildren(Object o, IProgressMonitor monitor) throws TeamException { if (!(o instanceof ICVSRemoteFolder)) return new Object[0]; try { monitor = Policy.monitorFor(monitor); monitor.beginTask(NLS.bind( CVSUIMessages.RemoteFolderElement_fetchingRemoteChildren, new String[] { getLabel(o) }), 150); ICVSRemoteFolder folder = (ICVSRemoteFolder) o; ICVSRemoteResource[] cachedChildren = CVSUIPlugin .getPlugin() .getRepositoryManager() .getCachedChildrenForTag(folder.getRepository(), folder, folder.getTag(), Policy.subMonitorFor(monitor, 50)); if (cachedChildren.length > 0) { return cachedChildren; } return folder.members(Policy.subMonitorFor(monitor, 100)); } finally { monitor.done(); } }

Target:
public Object[] fetchChildren(Object o, IProgressMonitor monitor) throws TeamException { if (!(o instanceof ICVSRemoteFolder)) return new Object[0]; monitor = Policy.monitorFor(monitor); try { ICVSRemoteResource[] cachedChildren = getCachedChildren(o, monitor); if (cachedChildren.length > 0) { return cachedChildren; } return ((ICVSRemoteFolder) o).members(Policy.subMonitorFor(monitor, 50)); } finally { monitor.done(); } }
Source:
public boolean isDebugEnabled() { String logLevelStr = Configuration.getGlobalConfiguration().get(AZURE_LOG_LEVEL); LogLevel currentLogLevel = LogLevel.fromString(logLevelStr); return LogLevel.VERBOSE.getLogLevel() >= currentLogLevel.getLogLevel(); }

Target:
public boolean isDebugEnabled() { return isLogLevelEnabledFromEnv(LogLevel.VERBOSE); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.guide_conclusion, container, false); ((TextView) view.findViewById(R.id.guide_conclusion_text)).setText(Html.fromHtml(mGuide.getConclusion())); mButton = (Button) view.findViewById(R.id.guide_completed_button); mButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Api.call(getActivity(), ApiCall.completeGuide(mGuide.getGuideid())); mButton.setEnabled(false); mButton.setText(getString(R.string.completing)); } }); setCompletedStatus(mGuide.getCompleted()); if (mGuide.isTeardown()) mButton.setVisibility(View.GONE); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.guide_conclusion, container, false); ((TextView) view.findViewById(R.id.guide_conclusion_text)).setText(Html.fromHtml(mGuide.getConclusion())); mButton = (Button) view.findViewById(R.id.guide_completed_button); mButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Api.call(getActivity(), ApiCall.completeGuide(mGuide.getGuideid())); mButton.setEnabled(false); mButton.setText(R.string.completing); } }); setCompletedStatus(mGuide.getCompleted()); if (mGuide.isTeardown()) mButton.setVisibility(View.GONE); return view; }
Source:
protected void checkVdsClusterChangeSucceeded(final GuideModel guideModel, final String searchStr, final List<VdcActionParametersBase> changeVdsParameterList, final List<VdcActionParametersBase> activateVdsParameterList) { final Map<Guid, Guid> hostClusterIdMap = new HashMap<>(); for (VdcActionParametersBase param : changeVdsParameterList) { hostClusterIdMap.put(((ChangeVDSClusterParameters) param).getVdsId(), ((ChangeVDSClusterParameters) param).getClusterId()); } Frontend.getInstance().runQuery(VdcQueryType.Search, new SearchParameters(searchStr, SearchType.VDS), new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { ArrayList<VDS> hosts = ((VdcQueryReturnValue) returnValue).getReturnValue(); boolean succeeded = true; for (VDS host : hosts) { if (!host.getVdsGroupId().equals(hostClusterIdMap.get(host.getId()))) { succeeded = false; } } if (!succeeded) { guideModel.getWindow().stopProgress(); guideModel.cancel(); errorPopupManager.show(ConstantsManager.getInstance().getConstants().hostChangeClusterTimeOut()); } else { activateHostsAfterClusterChange(guideModel, searchStr, activateVdsParameterList); } } })); }

Target:
protected void checkVdsClusterChangeSucceeded(final GuideModel guideModel, final String searchStr, final List<VdcActionParametersBase> changeVdsParameterList, final List<VdcActionParametersBase> activateVdsParameterList) { final Map<Guid, Guid> hostClusterIdMap = new HashMap<>(); for (VdcActionParametersBase param : changeVdsParameterList) { hostClusterIdMap.put(((ChangeVDSClusterParameters) param).getVdsId(), ((ChangeVDSClusterParameters) param).getClusterId()); } Frontend.getInstance().runQuery(VdcQueryType.Search, new SearchParameters(searchStr, SearchType.VDS), new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { List<VDS> hosts = ((VdcQueryReturnValue) returnValue).getReturnValue(); boolean succeeded = true; for (VDS host : hosts) { if (!host.getVdsGroupId().equals(hostClusterIdMap.get(host.getId()))) { succeeded = false; } } if (!succeeded) { guideModel.getWindow().stopProgress(); guideModel.cancel(); errorPopupManager.show(ConstantsManager.getInstance().getConstants().hostChangeClusterTimeOut()); } else { activateHostsAfterClusterChange(guideModel, searchStr, activateVdsParameterList); } } })); }
Source:
public MessageView(Context context, AttributeSet attrs) { super(context, attrs); setOrientation(VERTICAL); }

Target:
public MessageView(Context context, AttributeSet attrs) { super(context, attrs); super.setOrientation(VERTICAL); }
Source:
public void get_notifications_when_passive_joins() throws Exception { put(0, "clients", "client1", "Mat"); voltron.getClusterControl().startOneServer(); voltron.getClusterControl().waitForRunningPassivesInStandby(); put(0, "clients", "client2", "Garfield"); assertThat(get(1, "clients", "client1"), equalTo("Mat")); Server active = nmsService.readTopology().serverStream().filter(Server::isActive).findFirst().get(); Server passive = nmsService.readTopology().serverStream().filter(server -> !server.isActive()).findFirst().get(); assertThat(active.getState(), equalTo(Server.State.ACTIVE)); assertThat(passive.getState(), equalTo(Server.State.PASSIVE)); List<ContextualNotification> collected = waitForAllNotifications("SERVER_JOINED", "SERVER_STATE_CHANGED", "SERVER_ENTITY_CREATED", "ENTITY_REGISTRY_AVAILABLE", "SERVER_STATE_CHANGED", "SYNC_END"); Set<String> states = collected.stream() .filter(contextualNotification -> contextualNotification.getType().equals("SERVER_STATE_CHANGED")) .map(contextualNotification -> contextualNotification.getAttributes().get("state")) .collect(Collectors.toSet()); assertThat(states, hasItems("SYNCHRONIZING", "PASSIVE")); ContextualNotification stateChanged = collected.stream().filter(n -> n.getType().equals("SERVER_STATE_CHANGED")).findFirst().get(); assertThat(stateChanged.getContext().get(Server.NAME_KEY), equalTo(passive.getServerName())); assertThat(states, hasItems("SYNCHRONIZING", "PASSIVE")); }

Target:
public void get_notifications_when_passive_joins() throws Exception { put(0, "clients", "client1", "Mat"); voltron.getClusterControl().startOneServer(); voltron.getClusterControl().waitForRunningPassivesInStandby(); put(0, "clients", "client2", "Garfield"); assertThat(get(1, "clients", "client1"), equalTo("Mat")); Server active = nmsService.readTopology().serverStream().filter(Server::isActive).findFirst().get(); Server passive = nmsService.readTopology().serverStream().filter(server -> !server.isActive()).findFirst().get(); assertThat(active.getState(), equalTo(Server.State.ACTIVE)); assertThat(passive.getState(), equalTo(Server.State.PASSIVE)); List<ContextualNotification> collected = waitForAllNotifications("SERVER_JOINED", "SERVER_STATE_CHANGED", "SERVER_ENTITY_CREATED", "ENTITY_REGISTRY_AVAILABLE", "SERVER_STATE_CHANGED", "SYNC_END"); Set<String> states = collected.stream() .filter(contextualNotification -> contextualNotification.getType().equals("SERVER_STATE_CHANGED")) .map(contextualNotification -> contextualNotification.getAttributes().get("state")) .collect(Collectors.toSet()); assertThat(states, hasItems("SYNCHRONIZING", "PASSIVE")); ContextualNotification stateChanged = collected.stream().filter(n -> n.getType().equals("SERVER_STATE_CHANGED")).findFirst().get(); assertThat(stateChanged.getContext().get(Server.NAME_KEY), equalTo(passive.getServerName())); }
Source:
public DataContext createDataContext(final JavaTypeFactory typeFactory, List<TypedValue> parameters) { class DruidDataContext implements DataContext { private final Map<String, Object> base_context = ImmutableMap.of( DataContext.Variable.UTC_TIMESTAMP.camelName, localNow.getMillis(), DataContext.Variable.CURRENT_TIMESTAMP.camelName, localNow.getMillis(), DataContext.Variable.LOCAL_TIMESTAMP.camelName, new Interval( new DateTime("1970-01-01T00:00:00.000", localNow.getZone()), localNow ).toDurationMillis(), DataContext.Variable.TIME_ZONE.camelName, localNow.getZone().toTimeZone().clone(), DATA_CTX_AUTHENTICATION_RESULT, authenticationResult ); private final Map<String, Object> context; DruidDataContext() { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.putAll(base_context); for (int i = 0; i < parameters.size(); i++) { builder.put("?" + i, parameters.get(i).value); } context = builder.build(); } @Override public SchemaPlus getRootSchema() { throw new UnsupportedOperationException(); } @Override public JavaTypeFactory getTypeFactory() { return typeFactory; } @Override public QueryProvider getQueryProvider() { throw new UnsupportedOperationException(); } @Override public Object get(final String name) { return context.get(name); } } return new DruidDataContext(); }

Target:
public DataContext createDataContext(final JavaTypeFactory typeFactory, List<TypedValue> parameters) { class DruidDataContext implements DataContext { private final Map<String, Object> base_context = ImmutableMap.of( DataContext.Variable.UTC_TIMESTAMP.camelName, localNow.getMillis(), DataContext.Variable.CURRENT_TIMESTAMP.camelName, localNow.getMillis(), DataContext.Variable.LOCAL_TIMESTAMP.camelName, new Interval( new DateTime("1970-01-01T00:00:00.000", localNow.getZone()), localNow ).toDurationMillis(), DataContext.Variable.TIME_ZONE.camelName, localNow.getZone().toTimeZone().clone(), DATA_CTX_AUTHENTICATION_RESULT, authenticationResult ); private final Map<String, Object> context; DruidDataContext() { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); builder.putAll(base_context); int i = 0; for (TypedValue parameter : parameters) { builder.put("?" + i, parameter.value); i++; } context = builder.build(); } @Override public SchemaPlus getRootSchema() { throw new UnsupportedOperationException(); } @Override public JavaTypeFactory getTypeFactory() { return typeFactory; } @Override public QueryProvider getQueryProvider() { throw new UnsupportedOperationException(); } @Override public Object get(final String name) { return context.get(name); } } return new DruidDataContext(); }
Source:
protected void makeMenuBar() { if (canUpdateProject()) { fileMenuBuilder .addSave(versionRecordManager.newSaveMenuItem(this::saveAction)) .addCopy(versionRecordManager.getCurrentPath(), getRenameValidator()) .addRename(getSaveAndRename()) .addDelete(versionRecordManager.getPathToLatest(), getRenameValidator()); } fileMenuBuilder .addNewTopLevelMenu(versionRecordManager.buildMenu()); }

Target:
protected void makeMenuBar() { if (canUpdateProject()) { fileMenuBuilder .addSave(versionRecordManager.newSaveMenuItem(this::saveAction)) .addCopy(versionRecordManager.getCurrentPath(), getRenameValidator()) .addRename(getSaveAndRename()) .addDelete(versionRecordManager.getPathToLatest(), assetUpdateValidator); } fileMenuBuilder .addNewTopLevelMenu(versionRecordManager.buildMenu()); }
Source:
CosmosBulkItemResponse(String eTag, double requestCharge, ObjectNode resourceObject, int statusCode, Duration retryAfter, int subStatusCode, Map<String, String> responseHeaders, CosmosDiagnostics cosmosDiagnostics) { checkNotNull(statusCode, "expected non-null statusCode"); checkNotNull(responseHeaders, "expected non-null responseHeaders"); this.eTag = eTag; this.requestCharge = requestCharge; this.resourceObject = resourceObject; this.statusCode = statusCode; this.retryAfter = retryAfter; this.subStatusCode = subStatusCode; this.responseHeaders = responseHeaders; this.cosmosDiagnostics = cosmosDiagnostics; }

Target:
CosmosBulkItemResponse(String eTag, double requestCharge, ObjectNode resourceObject, int statusCode, Duration retryAfter, int subStatusCode, Map<String, String> responseHeaders, CosmosDiagnostics cosmosDiagnostics) { checkNotNull(responseHeaders, "expected non-null responseHeaders"); this.eTag = eTag; this.requestCharge = requestCharge; this.resourceObject = resourceObject; this.statusCode = statusCode; this.retryAfter = retryAfter; this.subStatusCode = subStatusCode; this.responseHeaders = responseHeaders; this.cosmosDiagnostics = cosmosDiagnostics; }
Source:
public void removeRecording (Sid recordingSid) { RecordingsDao recordingsDao = daoManager.getRecordingsDao(); Recording recording = recordingsDao.getRecording(recordingSid); boolean isStoredAtS3 = recording.getS3Uri() != null; if (isStoredAtS3) { if (s3AccessTool != null) { s3AccessTool.removeS3Uri(recording.getS3Uri()); } } else { URI fileUri = recording.getFileUri(); if (fileUri.getScheme().equalsIgnoreCase("file")) { File recordingFile = new File(fileUri); if (recordingFile.exists()) { recordingFile.delete(); } } } recordingsDao.removeRecording(recordingSid); }

Target:
public void removeRecording (Sid recordingSid) { Recording recording = recordingsDao.getRecording(recordingSid); boolean isStoredAtS3 = recording.getS3Uri() != null; if (isStoredAtS3) { if (s3AccessTool != null) { s3AccessTool.removeS3Uri(recording.getS3Uri()); } } else { if (!recordingsPath.endsWith("/")) recordingsPath += "/"; URI recordingsUri = URI.create(recordingsPath+recordingSid+".wav"); File fileToDelete = new File(recordingsUri); if (fileToDelete.exists()) { fileToDelete.delete(); } } recordingsDao.removeRecording(recordingSid); }
Source:
public List<StoreKey> getKeys() { return keys; }

Target:
public List<StoreKey> getKeys() { return new AbstractList<StoreKey>() { @Override public StoreKey get(int index) { return chunkMetadataList.get(index).getStoreKey(); } @Override public int size() { return chunkMetadataList.size(); } }; }
Source:
public void initialize() { while ( true ) { if ( isMaster() || this.forceInitialization ) { if ( !isInitialized() ) { LOG.info( "Initializing " + getInitializationSubject() ); doInitialize(); LOG.info( getInitializationSubject() + " successfully initialized" ); } return; } else { for ( int i = 0; i < initializationCheckMaxCount; i++ ) { final boolean initialized = isInitialized(); if ( initialized ) { return; } try { LOG.info( "Waiting [" + ( initializationCheckPeriod / 1000 ) + "s] for " + getInitializationSubject() + " to be initialized" ); Thread.sleep( initializationCheckPeriod ); } catch ( InterruptedException e ) { throw new InitializationException( getInitializationSubject() + " initialization check thread interrupted", e ); } } } } }

Target:
public void initialize() { while ( true ) { if ( this.forceInitialization || isMaster() ) { if ( !isInitialized() ) { LOG.info( "Initializing " + getInitializationSubject() ); doInitialize(); LOG.info( getInitializationSubject() + " successfully initialized" ); } return; } else { for ( int i = 0; i < initializationCheckMaxCount; i++ ) { final boolean initialized = isInitialized(); if ( initialized ) { return; } try { LOG.info( "Waiting [" + ( initializationCheckPeriod / 1000 ) + "s] for " + getInitializationSubject() + " to be initialized" ); Thread.sleep( initializationCheckPeriod ); } catch ( InterruptedException e ) { throw new InitializationException( getInitializationSubject() + " initialization check thread interrupted", e ); } } } } }
Source:
int getMaxLimitForListMode() { return Activator.getDefault().getPreferenceStore() .getInt(UIPreferences.STAGING_VIEW_MAX_LIMIT_LIST_MODE); }

Target:
private int getMaxLimitForListMode() { return Activator.getDefault().getPreferenceStore() .getInt(UIPreferences.STAGING_VIEW_MAX_LIMIT_LIST_MODE); }
Source:
private void setAttribute() { ITmfStateSystemBuilder ss = (ITmfStateSystemBuilder) fContainer.getStateSystem(); int startingNodeQuark = fScenarioInfo.getQuark(); String subPath = ATTRIBUTE_PATH; int attributeQuark = ss.optQuarkRelative(startingNodeQuark, subPath); if (attributeQuark != ITmfStateSystem.INVALID_ATTRIBUTE) { fScenarioInfo.setScenarioAttribute(UUID.randomUUID().toString()); } else { ITmfStateValue sValue = ss.queryOngoingState(attributeQuark); fScenarioInfo.setScenarioAttribute(String.valueOf(sValue.unboxInt())); } }

Target:
private void setAttribute() { ITmfStateSystemBuilder ss = (ITmfStateSystemBuilder) fContainer.getStateSystem(); int startingNodeQuark = fScenarioInfo.getQuark(); String subPath = ATTRIBUTE_PATH; int attributeQuark = ss.optQuarkRelative(startingNodeQuark, subPath); if (attributeQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { fScenarioInfo.setScenarioAttribute(UUID.randomUUID().toString()); } else { ITmfStateValue value = ss.queryOngoingState(attributeQuark); fScenarioInfo.setScenarioAttribute(String.valueOf(value.unboxInt())); } }