auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public T getHelper() { if (mHelper == null) { Log.w(LOG_TAG, "Helper not created."); } return mHelper; }

Target:
public T getHelper() { if (mHelper == null) { throw new TestHelperException("Helper not created"); } return mHelper; }
Source:
public static VpnProfile decode(String key, byte[] value) { try { if (key == null) { return null; } String[] values = new String(value, StandardCharsets.UTF_8).split("\0", -1); if (values.length < 14 || values.length > 19) { return null; } VpnProfile profile = new VpnProfile(key); profile.name = values[0]; profile.type = Integer.parseInt(values[1]); if (profile.type < 0 || profile.type > TYPE_MAX) { return null; } profile.server = values[2]; profile.username = values[3]; profile.password = values[4]; profile.dnsServers = values[5]; profile.searchDomains = values[6]; profile.routes = values[7]; profile.mppe = Boolean.parseBoolean(values[8]); profile.l2tpSecret = values[9]; profile.ipsecIdentifier = values[10]; profile.ipsecSecret = values[11]; profile.ipsecUserCert = values[12]; profile.ipsecCaCert = values[13]; profile.ipsecServerCert = (values.length > 14) ? values[14] : ""; String host = (values.length > 15) ? values[15] : ""; String port = (values.length > 16) ? values[16] : ""; String exclList = (values.length > 17) ? values[17] : ""; String pacFileUrl = (values.length > 18) ? values[18] : ""; if (pacFileUrl.isEmpty()) { profile.proxy = new ProxyInfo(host, port.isEmpty() ? 0 : Integer.parseInt(port), exclList); } else { profile.proxy = new ProxyInfo(pacFileUrl); } profile.saveLogin = !profile.username.isEmpty() || !profile.password.isEmpty(); return profile; } catch (Exception e) { } return null; }

Target:
public static VpnProfile decode(String key, byte[] value) { try { if (key == null) { return null; } String[] values = new String(value, StandardCharsets.UTF_8).split("\0", -1); if (values.length < 14 || values.length > 19) { return null; } VpnProfile profile = new VpnProfile(key); profile.name = values[0]; profile.type = Integer.parseInt(values[1]); if (profile.type < 0 || profile.type > TYPE_MAX) { return null; } profile.server = values[2]; profile.username = values[3]; profile.password = values[4]; profile.dnsServers = values[5]; profile.searchDomains = values[6]; profile.routes = values[7]; profile.mppe = Boolean.parseBoolean(values[8]); profile.l2tpSecret = values[9]; profile.ipsecIdentifier = values[10]; profile.ipsecSecret = values[11]; profile.ipsecUserCert = values[12]; profile.ipsecCaCert = values[13]; profile.ipsecServerCert = (values.length > 14) ? values[14] : ""; if (values.length > 15) { String host = (values.length > 15) ? values[15] : ""; String port = (values.length > 16) ? values[16] : ""; String exclList = (values.length > 17) ? values[17] : ""; String pacFileUrl = (values.length > 18) ? values[18] : ""; if (pacFileUrl.isEmpty()) { profile.proxy = new ProxyInfo(host, port.isEmpty() ? 0 : Integer.parseInt(port), exclList); } else { profile.proxy = new ProxyInfo(pacFileUrl); } } profile.saveLogin = !profile.username.isEmpty() || !profile.password.isEmpty(); return profile; } catch (Exception e) { } return null; }
Source:
static Result compile(Iterable<? extends Processor> processors, Iterable<? extends JavaFileObject> sources) { JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); if(compiler == null) throw new CompilerNotFoundException(); DiagnosticCollector<JavaFileObject> diagnosticCollector = new DiagnosticCollector<JavaFileObject>(); InMemoryJavaFileManager fileManager = new InMemoryJavaFileManager( compiler.getStandardFileManager(diagnosticCollector, Locale.getDefault(), UTF_8)); CompilationTask task = compiler.getTask( null, fileManager, diagnosticCollector, ImmutableSet.<String>of(), ImmutableSet.<String>of(), sources); task.setProcessors(processors); boolean successful = task.call(); return new Result(successful, sortDiagnosticsByKind(diagnosticCollector.getDiagnostics()), fileManager.getOutputFiles()); }

Target:
static Result compile(Iterable<? extends Processor> processors, Iterable<? extends JavaFileObject> sources) { JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); if (compiler == null) { throw new IllegalStateException("Java Compiler is not present. " + "May be, you need to include tools.jar on your dependency list."); } DiagnosticCollector<JavaFileObject> diagnosticCollector = new DiagnosticCollector<JavaFileObject>(); InMemoryJavaFileManager fileManager = new InMemoryJavaFileManager( compiler.getStandardFileManager(diagnosticCollector, Locale.getDefault(), UTF_8)); CompilationTask task = compiler.getTask( null, fileManager, diagnosticCollector, ImmutableSet.<String>of(), ImmutableSet.<String>of(), sources); task.setProcessors(processors); boolean successful = task.call(); return new Result(successful, sortDiagnosticsByKind(diagnosticCollector.getDiagnostics()), fileManager.getOutputFiles()); }
Source:
public void testIsOpenFalseWhenTransportClosed() throws Exception { when(mockTrans.isOpen()).thenReturn(false); assertFalse(muxTransport.isOpen()); }

Target:
public void testIsOpenFalseWhenTransportClosed() throws Exception { when(mockTrans.isOpen()).thenReturn(false); registry = new FClientRegistry(); muxTransport.setRegistry(registry); assertFalse(muxTransport.isOpen()); }
Source:
private void testGetWithAtleastOneNonExistentBlob(List<BlobId> blobIds) { try { store.get(blobIds, EnumSet.noneOf(StoreGetOptions.class)); assertTrue("get with any non existent id should fail", false); } catch (StoreException e) { assertTrue("get with any non existent blob id should throw exception with " + StoreErrorCodes.ID_Not_Found + " error code.", e.getErrorCode().equals(StoreErrorCodes.ID_Not_Found)); } }

Target:
private void testGetWithAtleastOneNonExistentBlob(List<BlobId> blobIds) { try { store.get(blobIds, EnumSet.noneOf(StoreGetOptions.class)); fail("get with any non existent id should fail"); } catch (StoreException e) { assertEquals("get with any non existent blob id should throw exception with " + StoreErrorCodes.ID_Not_Found + " error code.", e.getErrorCode(), StoreErrorCodes.ID_Not_Found); } }
Source:
private static FormDef deserializeFormDef(Context context, File formDefFile) { FileInputStream fis = null; DataInputStream dis = null; FormDef fd; try { fd = new FormDef(DeveloperPreferences.useExpressionCachingInForms()); fis = new FileInputStream(formDefFile); dis = new DataInputStream(new BufferedInputStream(fis)); fd.readExternal(dis, CommCareApplication.instance().getPrototypeFactory(context)); dis.close(); } catch (Throwable e) { e.printStackTrace(); fd = null; } finally { StreamsUtil.closeStream(fis); StreamsUtil.closeStream(dis); } return fd; }

Target:
private static FormDef deserializeFormDef(Context context, File formDefFile) { FileInputStream fis = null; DataInputStream dis = null; FormDef fd; try { fd = new FormDef(DeveloperPreferences.useExpressionCachingInForms()); fis = new FileInputStream(formDefFile); dis = new DataInputStream(new BufferedInputStream(fis)); fd.readExternal(dis, CommCareApplication.instance().getPrototypeFactory(context)); } catch (Throwable e) { e.printStackTrace(); fd = null; } finally { StreamsUtil.closeStream(fis); StreamsUtil.closeStream(dis); } return fd; }
Source:
public static boolean fixAppDataPermissions(Context context) { if (!Shell.SU.available()) { Log.e(TAG,"Root is not available. Cannot fix permssions "); return false; } try { ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(),0); Log.d(TAG,"Uid of '" + context.getPackageName() + "' is " + appInfo.uid); Process fixPerm = Runtime.getRuntime().exec("su"); DataOutputStream fixPermOut = new DataOutputStream(fixPerm.getOutputStream()); String dir = context.getFilesDir().getAbsolutePath(); String cmd = "chown -R " + appInfo.uid + ":" + appInfo.uid + " " + dir + "\n"; Log.d(TAG,"Running: '" + cmd); fixPermOut.writeBytes(cmd); cmd = "restorecon -R " + dir + "\n"; Log.d(TAG,"Running: '" + cmd); fixPermOut.writeBytes(cmd); fixPermOut.writeBytes("sleep 2\n"); fixPermOut.writeBytes("exit\n"); fixPermOut.flush(); if (fixPerm.waitFor() == 0) { Log.i(TAG,"Successfully changed the owner, the group and the SELinux context of '" + dir + "'."); return true; } else { return false; } } catch (IOException | InterruptedException e) { Log.w(TAG,"Cannot chown data directory",e); } catch (NameNotFoundException e) { Log.w(TAG,"This should not happen",e); } return false; }

Target:
public static boolean fixAppDataPermissions(Context context) { if (!Shell.SU.available()) { Log.e(TAG, "Root is not available. Cannot fix permssions."); return false; } try { ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0); Log.d(TAG, "Uid of '" + context.getPackageName() + "' is " + appInfo.uid); Process fixPerm = Runtime.getRuntime().exec("su"); DataOutputStream fixPermOut = new DataOutputStream(fixPerm.getOutputStream()); String dir = context.getFilesDir().getAbsolutePath(); String cmd = "chown -R " + appInfo.uid + ":" + appInfo.uid + " " + dir + "\n"; Log.d(TAG, "Running: '" + cmd); fixPermOut.writeBytes(cmd); cmd = "restorecon -R " + dir + "\n"; Log.d(TAG, "Running: '" + cmd); fixPermOut.writeBytes(cmd); fixPermOut.flush(); fixPermOut.close(); int ret = fixPerm.waitFor(); Log.i(TAG, "Changed the owner, the group and the SELinux context of '" + dir + "'. Result: " + ret); return ret == 0; } catch (IOException | InterruptedException e) { Log.w(TAG, "Cannot chown data directory", e); } catch (NameNotFoundException e) { Log.w(TAG, "This should not happen", e); } return false; }
Source:
public void setAttributes(Map<String, Object> attrs) { this.attrs = U.sealMap(attrs); Object id = this.attrs.get("CLUSTER_REGION_ID"); if (id == null) regionId = null; else if (id instanceof Integer) regionId = ((Integer)id).longValue(); else if (id instanceof Long) regionId = (Long)id; else if (id instanceof String) try { regionId = Long.valueOf((String)id); } catch (NumberFormatException ignored) { regionId = null; } else regionId = null; }

Target:
public void setAttributes(Map<String, Object> attrs) { this.attrs = U.sealMap(attrs); }
Source:
public int getContentHeight() { return getFont().getHeight(); }

Target:
public int getContentHeight() { System.out.println("warning: TextEditor::getContentHeight needs a more correct implementation"); return getFont().getHeight(); }
Source:
public String getId() { return this.id; }

Target:
String getId() { return this.id; }
Source:
public Object instantiate(final Target<?> target, Parameters parameters) { Function<Parameter, Parameter> INDEXED_PARAMETERS = new Function<Parameter, Parameter>() { int i = 0; @Override public Parameter apply(Parameter parameter) { if (target.getName().equals(parameter.getName())) { return new Parameter(parameter.getName() + "[" + i++ + "]", parameter.getValue()); } return parameter; } }; List<Parameter> fixed = FluentIterable.from(parameters.forTarget(target)) .transform(INDEXED_PARAMETERS).toList(); return delegate.instantiate(target, new Parameters(fixed)); }

Target:
public Object instantiate(final Target<?> target, Parameters parameters) { List<Parameter> fixed = FluentIterable.from(parameters.forTarget(target)) .transform(indexedParameters(target)).toList(); return delegate.instantiate(target, new Parameters(fixed)); }
Source:
private void setDialogPaneContent(TurboIssue issue) { try { createMainLayout(); setTitleLabel(issue); getDialogPane().setContent(mainLayout); } catch (IOException e) { e.printStackTrace(); } }

Target:
private void setDialogPaneContent(TurboIssue issue) { createMainLayout(); setTitleLabel(issue); getDialogPane().setContent(mainLayout); }
Source:
protected void waitForServerBlocked(TerracottaServer server) { waitUntil(() -> isServerBlocked(server), is(true), ASSERT_TIMEOUT); }

Target:
protected void waitForServerBlocked(TerracottaServer server) { waitUntil(() -> isServerBlocked(server), is(true)); }
Source:
public Connection connect(URI uri, Properties properties) throws ConnectionException { URI keyURI = createKey(uri); ServerDescriptor serverDescriptor = servers.get(keyURI); if (serverDescriptor == null) { throw new IllegalArgumentException("No server available for " + uri); } Connection connection = serverDescriptor.server.connectNewClient(); serverDescriptor.add(connection, properties); LOGGER.info("Client opened to PassthroughServer at {}", formatConnectionId(connection), keyURI); return (Connection) Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[] { Connection.class }, new ConnectionInvocationHandler(serverDescriptor, connection)); }

Target:
public Connection connect(URI uri, Properties properties) throws ConnectionException { checkURI(uri); ServerDescriptor serverDescriptor = SERVERS.get(uri); if (serverDescriptor == null) { throw new IllegalArgumentException("No server available for " + uri); } Connection connection = serverDescriptor.server.connectNewClient(); serverDescriptor.add(connection, properties); LOGGER.info("Client opened to PassthroughServer at {}", formatConnectionId(connection), uri); return (Connection) Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[] { Connection.class }, new ConnectionInvocationHandler(serverDescriptor, connection)); }
Source:
@Test public void customSampler() throws Exception { String path = "/foo"; close(); SamplerFunction<HttpRequest> sampler = (HttpRuleSampler.newBuilder() .putRule(pathStartsWith(path), Sampler.NEVER_SAMPLE) .build()); httpTracing = httpTracing.toBuilder().clientSampler(sampler).build(); client = newClient(server.getPort()); server.enqueue(new MockResponse()); get(client, path); RecordedRequest request = takeRequest(); assertThat(request.getHeaders().toMultimap()) .containsEntry("x-b3-sampled", asList("0")); }

Target:
@Test public void customSampler() throws Exception { String path = "/foo"; close(); SamplerFunction<HttpRequest> sampler = HttpRuleSampler.newBuilder() .putRule(pathStartsWith(path), Sampler.NEVER_SAMPLE) .build(); httpTracing = httpTracing.toBuilder().clientSampler(sampler).build(); client = newClient(server.getPort()); server.enqueue(new MockResponse()); get(client, path); RecordedRequest request = takeRequest(); assertThat(request.getHeaders().toMultimap()) .containsEntry("x-b3-sampled", asList("0")); }
Source:
public void whenNoChangesDetectedButSchemaIsDifferent() throws Exception { final EventTypeTestBuilder builder = EventTypeTestBuilder.builder(); final EventType oldEventType = builder.schema("{}").build(); final EventType newEventType = builder.schema("{\"example\":\"something\"}").build(); Mockito.doReturn(Optional.empty()).when(evolutionConstraint).validate(oldEventType, newEventType); Mockito.doReturn(NO_CHANGES).when(compatibleChanges).get(any()); Mockito.doReturn(Lists.newArrayList(new SchemaChange(TITLE_CHANGED, "#/"))).when(schemaDiff) .collectChanges(any(), any()); final EventType eventType = service.evolve(oldEventType, newEventType); }

Target:
public void whenNoChangesDetectedButSchemaIsDifferent() throws Exception { final EventTypeTestBuilder builder = EventTypeTestBuilder.builder(); final EventType oldEventType = builder.schema("{}").build(); final EventType newEventType = builder.schema("{\"example\":\"something\"}").build(); Mockito.doReturn(Optional.empty()).when(evolutionConstraint).validate(oldEventType, newEventType); Mockito.doReturn(NO_CHANGES).when(compatibleChanges).get(any()); Mockito.doReturn(Lists.newArrayList(new SchemaChange(TITLE_CHANGED, "#/"))).when(schemaDiff) .collectChanges(any(), any()); service.evolve(oldEventType, newEventType); }
Source:
private void commitFile(String encodedPartition) { if (!startOffsets.containsKey(encodedPartition)) { return; } long startOffset = startOffsets.get(encodedPartition); long endOffset = offsets.get(encodedPartition); String tempFile = tempFiles.get(encodedPartition); String directory = getDirectory(encodedPartition); String committedFile = FileUtils.committedFileName( url, topicsDir, directory, tp, startOffset, endOffset, extension, zeroPadOffsetFormat ); String directoryName = FileUtils.directoryName(url, topicsDir, directory); if (!storage.exists(directoryName)) { storage.create(directoryName); } storage.commit(tempFile, committedFile); startOffsets.remove(encodedPartition); offsets.remove(encodedPartition); offset = offset + recordCounter; committedOffset = offset; recordCounter = 0; log.info("Committed for {}", committedFile, tp); }

Target:
private void commitFile(String encodedPartition) { log.debug("Committing file for partition {}", encodedPartition); if (!startOffsets.containsKey(encodedPartition)) { return; } long startOffset = startOffsets.get(encodedPartition); long endOffset = offsets.get(encodedPartition); String tempFile = tempFiles.get(encodedPartition); String directory = getDirectory(encodedPartition); String committedFile = FileUtils.committedFileName( url, topicsDir, directory, tp, startOffset, endOffset, extension, zeroPadOffsetFormat ); String directoryName = FileUtils.directoryName(url, topicsDir, directory); if (!storage.exists(directoryName)) { storage.create(directoryName); } storage.commit(tempFile, committedFile); startOffsets.remove(encodedPartition); offsets.remove(encodedPartition); offset = offset + recordCounter; committedOffset = offset - 1; recordCounter = 0; log.info("Committed for {}", committedFile, tp); }
Source:
File get(String bsn, Version version, Map<String, String> properties, DownloadListener... listeners) throws Exception { Resource resource = getBridge().get(bsn, version); if (resource == null) return null; ContentCapability contentCapability = ResourceUtils.getContentCapability(resource); if (contentCapability == null) return null; URI url = contentCapability.url(); boolean packed = url.getPath() .endsWith(Unpack200.PACKED_SUFFIX); final File link = new File(location, bsn + "-" + version + ".jar"); Promise<File> go = client.build() .useCache(MAX_STALE) .async(url.toURL()); if (listeners.length == 0) { return handleDownloadResult(packed, link, go); } new DownloadListenerPromise(reporter, name + ": get " + bsn + ";" + version + " " + url, go, listeners); return handleDownloadResult(packed, link, go); }

Target:
File get(String bsn, Version version, Map<String, String> properties, DownloadListener... listeners) throws Exception { Resource resource = getBridge().get(bsn, version); if (resource == null) return null; ContentCapability contentCapability = ResourceUtils.getContentCapability(resource); if (contentCapability == null) return null; URI url = contentCapability.url(); final File source = client.getCacheFileFor(url); final File link = new File(location, bsn + "-" + version + ".jar"); IO.createSymbolicLinkOrCopy(link, source); Promise<File> go = client.build() .useCache(MAX_STALE) .asTag() .async(url.toURL()) .map(tag -> processor.unpackAndLinkIfNeeded(tag, link)); if (listeners.length == 0) return go.getValue(); new DownloadListenerPromise(reporter, name + ": get " + bsn + ";" + version + " " + url, go, listeners); return link; }
Source:
private void validateSecuritySchemeReferences(Model model, AbstractNode node, Set<SwaggerError> errors) { if (node.getPointerString().matches(".*/security/\\d+")) { AbstractNode securitySchemes = model.find(securityPointer); if (node.isObject()) { for (String field : node.asObject().fieldNames()) { AbstractNode securityScheme = securitySchemes.get(field); if (securityScheme == null) { errors.add( error(node.get(field), IMarker.SEVERITY_ERROR, Messages.error_invalid_reference_type)); } else { validateSecuritySchemScopes(node, field, securityScheme, errors); } } } } }

Target:
private void validateSecuritySchemeReferences(Model model, AbstractNode node, Set<SwaggerError> errors) { if (node.getPointerString().matches(".*/security/\\d+")) { AbstractNode securitySchemes = model.find(securityPointer); if (node.isObject()) { for (String field : node.asObject().fieldNames()) { AbstractNode securityScheme = securitySchemes.get(field); if (securityScheme == null) { String message = Messages.error_invalid_reference_type + " It should be a valid security scheme."; errors.add(error(node.get(field), IMarker.SEVERITY_ERROR, message)); } else { validateSecuritySchemeScopes(node, field, securityScheme, errors); } } } } }
Source:
protected Subject createSubjectFromToken(JWT token) { String principal = token.getSubject(); String claimvalue = null; if (expectedPrincipalClaim != null) { claimvalue = token.getClaim(expectedPrincipalClaim); } if (claimvalue != null) { principal = claimvalue.toLowerCase(Locale.ENGLISH); } @SuppressWarnings("rawtypes") HashSet emptySet = new HashSet(); Set<Principal> principals = new HashSet<>(); Principal p = new PrimaryPrincipal(principal); principals.add(p); return new Subject(true, principals, emptySet, emptySet); }

Target:
protected Subject createSubjectFromToken(JWT token) { String principal = token.getSubject(); String claimvalue = null; if (expectedPrincipalClaim != null) { claimvalue = token.getClaim(expectedPrincipalClaim); } if (claimvalue != null) { principal = claimvalue.toLowerCase(Locale.ROOT); } @SuppressWarnings("rawtypes") HashSet emptySet = new HashSet(); Set<Principal> principals = new HashSet<>(); Principal p = new PrimaryPrincipal(principal); principals.add(p); return new Subject(true, principals, emptySet, emptySet); }
Source:
static List<TrackableInventoryEntry> getTrackableInventory() { final List<TrackableInventoryEntry> trackableInventoryEntries = new ArrayList<>(); int skip = 0; TrackableInventoryEntry[] entries = null; while (entries == null || entries.length == MAX_TAKE) { entries = getAPI("/trackables?inCollection=false&take=" + MAX_TAKE + "&skip=" + skip, TrackableInventoryEntry[].class).blockingGet(); trackableInventoryEntries.addAll(Arrays.asList(entries)); skip += MAX_TAKE; } return trackableInventoryEntries; }

Target:
static List<TrackableInventoryEntry> getTrackableInventory() { final List<TrackableInventoryEntry> trackableInventoryEntries = new ArrayList<>(); int skip = 0; TrackableInventoryEntry[] entries; do { entries = getAPI("/trackables?inCollection=false&take=" + MAX_TAKE + "&skip=" + skip, TrackableInventoryEntry[].class).blockingGet(); trackableInventoryEntries.addAll(Arrays.asList(entries)); skip += MAX_TAKE; } while (entries.length == MAX_TAKE); return trackableInventoryEntries; }
Source:
public void testChangingCurrentFrameCLINotification() throws Throwable { ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fMultiRunControl.getSession(), MIStoppedEvent.class); SyncUtil.addBreakpoint(SOURCE_NAME + ":" + getLineForTag("LINE_MAIN_ALL_THREADS_STARTED"), false); SyncUtil.addBreakpoint("36", false); SyncUtil.resumeAll(); eventWaitor.waitForEvent(2000); eventWaitor.waitForEvent(2000); eventWaitor.waitForEvent(2000); eventWaitor.waitForEvent(2000); eventWaitor.waitForEvent(2000); assertEquals("2",switchThreadAndCaptureThreadSwitchedEvent("2")); for (int i = 0; i < 2; i++) { assertEquals("1",switchFrameAndCaptureStackFrameSwitchedEvent("1")); assertEquals("0",switchFrameAndCaptureStackFrameSwitchedEvent("0")); } }

Target:
public void testChangingCurrentFrameCLINotification() throws Throwable { ServiceEventWaitor<MIStoppedEvent> eventWaitor = new ServiceEventWaitor<MIStoppedEvent>(fMultiRunControl.getSession(), MIStoppedEvent.class); SyncUtil.addBreakpoint(SOURCE_NAME + ":" + getLineForTag("LINE_MAIN_ALL_THREADS_STARTED"), false); SyncUtil.addBreakpoint("36", false); SyncUtil.resumeAll(); eventWaitor.waitForEvent(TestsPlugin.massageTimeout(2000)); eventWaitor.waitForEvent(TestsPlugin.massageTimeout(2000)); eventWaitor.waitForEvent(TestsPlugin.massageTimeout(2000)); eventWaitor.waitForEvent(TestsPlugin.massageTimeout(2000)); eventWaitor.waitForEvent(TestsPlugin.massageTimeout(2000)); assertEquals("2",switchThreadAndCaptureThreadSwitchedEvent("2")); for (int i = 0; i < 2; i++) { assertEquals("1",switchFrameAndCaptureStackFrameSwitchedEvent("1")); assertEquals("0",switchFrameAndCaptureStackFrameSwitchedEvent("0")); } }
Source:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_LIST) .setSince("6.6") .setDescription("List the branches of a project.<br/>" + "Requires 'Browse on the project' or 'Execute analysis' rights on the specified project.") .setResponseExample(Resources.getResource(getClass(), "list-example.json")) .setHandler(this); addProjectParam(action); }

Target:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_LIST) .setSince("6.6") .setDescription("List the branches of a project.<br/>" + "Requires 'Browse' or 'Execute analysis' rights on the specified project.") .setResponseExample(Resources.getResource(getClass(), "list-example.json")) .setHandler(this); addProjectParam(action); }
Source:
public String[] getFinalizedUptoPartitions(List<Message> lastMessages, List<Message> committedMessages) throws Exception { if (lastMessages == null || committedMessages == null) { LOG.error("Either: and is null", lastMessages, committedMessages); return null; } assert lastMessages.size() == committedMessages.size(); long minMillis = Long.MAX_VALUE; for (int i = 0; i < lastMessages.size(); i++) { long millis = getFinalizedTimestampMillis(lastMessages.get(i), committedMessages.get(i)); if (millis < minMillis) { minMillis = millis; } } if (minMillis == Long.MAX_VALUE) { LOG.error("No valid timestamps among messages: and {}", lastMessages, committedMessages); return null; } minMillis -= 3600L * 1000L; LOG.info("adjusted millis {}", minMillis); return generatePartitions(minMillis, mUsingHourly, mUsingMinutely); }

Target:
public String[] getFinalizedUptoPartitions(List<Message> lastMessages, List<Message> committedMessages) throws Exception { if (lastMessages == null || committedMessages == null) { LOG.error("Either: and is null", lastMessages, committedMessages); return null; } assert lastMessages.size() == committedMessages.size(); long minMillis = Long.MAX_VALUE; for (int i = 0; i < lastMessages.size(); i++) { long millis = getFinalizedTimestampMillis(lastMessages.get(i), committedMessages.get(i)); if (millis < minMillis) { LOG.info("partition {}, time {}", i, millis); minMillis = millis; } } if (minMillis == Long.MAX_VALUE) { LOG.error("No valid timestamps among messages: and {}", lastMessages, committedMessages); return null; } minMillis -= mFinalizerDelaySeconds * 1000L; LOG.info("adjusted millis {}", minMillis); return generatePartitions(minMillis, mUsingHourly); }
Source:
public void testTransformNoTimeout() throws Exception { Exchange mockExchange = mock(Exchange.class); when(mockExchange.getIn()).thenReturn(message); when(mockExchange.getOut()).thenReturn(message); when(mockExchange.getOut()).thenReturn(message); when(mockExchange.getIn().getHeader("timeoutMilliseconds")).thenReturn(1000L); inputTransformerProducer.process(mockExchange); }

Target:
public void testTransformNoTimeout() throws Exception { Exchange mockExchange = mock(Exchange.class); when(mockExchange.getIn()).thenReturn(message); when(mockExchange.getOut()).thenReturn(message); when(mockExchange.getOut()).thenReturn(message); when(mockExchange.getIn().getHeader("timeoutMilliseconds")).thenReturn(1000L); inputTransformerProducer.process(mockExchange); verify(message).setBody(any(Metacard.class)); }
Source:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_VIRT); attr.setFriendlyName("loa"); attr.setDisplayName("Level of assurance"); attr.setType(Integer.class.getName()); attr.setDescription("The highest value of LoA from all user's userExtSources."); return attr; }

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_VIRT); attr.setFriendlyName("loa"); attr.setDisplayName("Level of assurance"); attr.setType(String.class.getName()); attr.setDescription("The highest value of LoA from all user's userExtSources."); return attr; }
Source:
public static IChatComponent newChatWithLinks(String string) { final Pattern pattern = Pattern.compile("((?:(?:https?)://)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[\u00A7 \\n]|$))))", Pattern.CASE_INSENSITIVE); IChatComponent ichat = new ChatComponentText(""); String[] array = string.split(" "); for (int i = 0; i < array.length; i++) { IChatComponent link = new ChatComponentText(array[i]); if (pattern.matcher(array[i]).matches()) { String url = array[i].toLowerCase(); if (!url.startsWith("http://") && !url.startsWith("https://")) { url = "http://" + url; } ClickEvent click = new ClickEvent(ClickEvent.Action.OPEN_URL, url); ichat.getChatStyle().setChatClickEvent(click); } ichat.appendSibling(link); } return ichat; }

Target:
public static IChatComponent newChatWithLinks(String string) { final Pattern pattern = Pattern.compile("((?:(?:https?)://)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[\u00A7 \\n]|$))))", Pattern.CASE_INSENSITIVE); IChatComponent ichat = new ChatComponentText(""); String[] array = string.split(" "); for (int i = 0; i < array.length; i++) { IChatComponent link = new ChatComponentText(array[i]); if (pattern.matcher(array[i]).matches()) { String url = array[i].toLowerCase(); if (!url.startsWith("http://") && !url.startsWith("https://")) { url = "http://" + url; } ClickEvent click = new ClickEvent(ClickEvent.Action.OPEN_URL, url); link.getChatStyle().setChatClickEvent(click); } ichat.appendSibling(link); } return ichat; }
Source:
public CloseableIterator<InputRow> read() throws IOException { return new CloseableIterator<InputRow>() { final Firehose firehose = firehoseFactory.connect(inputRowParser, temporaryDirectory); @Override public boolean hasNext() { try { return firehose.hasMore(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public InputRow next() { try { return firehose.nextRow(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public void close() throws IOException { firehose.close(); } }; }

Target:
public CloseableIterator<InputRow> read() throws IOException { return new CloseableIterator<InputRow>() { final Firehose firehose = firehoseFactory.connect(inputRowParser, temporaryDirectory); @Override public boolean hasNext() { try { return firehose.hasMore(); } catch (IOException e) { throw new UncheckedIOException(e); } } @Override public InputRow next() { try { return firehose.nextRow(); } catch (IOException e) { throw new UncheckedIOException(e); } } @Override public void close() throws IOException { firehose.close(); } }; }
Source:
public CourseComponent(BlockModel blockModel, CourseComponent parent){ this(blockModel, parent, false); }

Target:
public CourseComponent(BlockModel blockModel, CourseComponent parent){ this.id = blockModel.id; this.type = blockModel.type; this.name = blockModel.displayName; this.graded = blockModel.graded; this.blockUrl = blockModel.blockUrl; this.webUrl = blockModel.webUrl; this.responsiveUI = blockModel.responsiveUI; this.format = blockModel.format; this.blockCount = blockModel.blockCount == null ? new BlockCount() : blockModel.blockCount; this.parent = parent; if ( parent == null){ this.root = this; } else { parent.getChildren().add(this); this.root = (CourseComponent)parent.getRoot(); } }
Source:
private static boolean loadXmlFile(File file, boolean addFile) { IStatus status = XmlUtils.xmlValidate(file); if (status.isOK()) { deleteSupplementaryFile(file.getName()); if (addFile) { status = XmlUtils.addXmlFile(file); } if (status.isOK()) { File xmlFile = XmlUtils.getXmlFilesPath().addTrailingSeparator().append(file.getName()).toFile(); XmlUtils.preloadXmlAnalysesOutput(xmlFile); XmlAnalysisModuleSource.notifyModuleChange(); refreshProject(); return true; } Activator.logError(Messages.ManageXMLAnalysisDialog_ImportFileFailed); TraceUtils.displayErrorMsg(Messages.ManageXMLAnalysisDialog_ImportFileFailed, status.getMessage()); } else { Activator.logError(Messages.ManageXMLAnalysisDialog_ImportFileFailed); TraceUtils.displayErrorMsg(Messages.ManageXMLAnalysisDialog_ImportFileFailed, status.getMessage()); } return false; }

Target:
private static boolean loadXmlFile(File file, boolean addFile) { IStatus status = XmlUtils.xmlValidate(file); if (status.isOK()) { deleteSupplementaryFile(file.getName()); if (addFile) { status = XmlUtils.addXmlFile(file); } else { XmlUtils.updateXmlFile(file); } if (status.isOK()) { XmlAnalysisModuleSource.notifyModuleChange(); refreshProject(); return true; } Activator.logError(Messages.ManageXMLAnalysisDialog_ImportFileFailed); TraceUtils.displayErrorMsg(Messages.ManageXMLAnalysisDialog_ImportFileFailed, status.getMessage()); } else { Activator.logError(Messages.ManageXMLAnalysisDialog_ImportFileFailed); TraceUtils.displayErrorMsg(Messages.ManageXMLAnalysisDialog_ImportFileFailed, status.getMessage()); } return false; }
Source:
public void dispose() { for (String fboName : fboNames) { frameBuffersManager.removeUsage(fboName); } }

Target:
public void dispose() { for (Map.Entry<ResourceUrn, BaseFBOsManager> entry : fboUsages.entrySet()) { ResourceUrn fboName = entry.getKey(); BaseFBOsManager baseFBOsManager = entry.getValue(); baseFBOsManager.release(fboName); } fboUsages.clear(); }
Source:
public @NonNull TmfModelResponse<@NonNull List<@NonNull ITimeGraphRowModel>> fetchRowModel(@NonNull SelectionTimeQueryFilter filter, @Nullable IProgressMonitor monitor) { IGraphWorker graphWorker = getCurrent(); if (graphWorker == null) { return new TmfModelResponse<>(null, Status.COMPLETED, CommonStatusMessage.COMPLETED); } Pair<HorizontalLinksVisitor, VerticalLinksVisitor> visitors = fHorizontalVisitorCache.getIfPresent(graphWorker); if (visitors == null) { return new TmfModelResponse<>(null, Status.COMPLETED, CommonStatusMessage.COMPLETED); } HorizontalLinksVisitor visitor = visitors.getFirst(); List<@NonNull ITimeGraphRowModel> rowModels = new ArrayList<>(); for (Long id : filter.getSelectedItems()) { Collection<ITimeGraphState> states = visitor.fStates.asMap().get(id); if (states != null) { List<ITimeGraphState> filteredStates = new ArrayList<>(); for (ITimeGraphState state : states) { if (overlaps(state.getStartTime(), state.getDuration(), filter.getTimesRequested())) { filteredStates.add(state); } } rowModels.add(new TimeGraphRowModel(id, filteredStates)); } } return new TmfModelResponse<>(rowModels, Status.COMPLETED, CommonStatusMessage.COMPLETED); }

Target:
public @NonNull TmfModelResponse<@NonNull List<@NonNull ITimeGraphRowModel>> fetchRowModel(@NonNull SelectionTimeQueryFilter filter, @Nullable IProgressMonitor monitor) { IGraphWorker graphWorker = getCurrent(); if (graphWorker == null) { return new TmfModelResponse<>(null, Status.COMPLETED, CommonStatusMessage.COMPLETED); } CriticalPathVisitor visitor = fHorizontalVisitorCache.getIfPresent(graphWorker); if (visitor == null) { return new TmfModelResponse<>(null, Status.COMPLETED, CommonStatusMessage.COMPLETED); } List<@NonNull ITimeGraphRowModel> rowModels = new ArrayList<>(); for (Long id : filter.getSelectedItems()) { Collection<ITimeGraphState> states = visitor.fStates.asMap().get(id); if (states != null) { List<ITimeGraphState> filteredStates = new ArrayList<>(); for (ITimeGraphState state : states) { if (overlaps(state.getStartTime(), state.getDuration(), filter.getTimesRequested())) { filteredStates.add(state); } } rowModels.add(new TimeGraphRowModel(id, filteredStates)); } } return new TmfModelResponse<>(rowModels, Status.COMPLETED, CommonStatusMessage.COMPLETED); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Point point = (Point) o; if (Double.compare(point.x, x) != 0) return false; return Double.compare(point.y, y) == 0; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Point)) { return false; } Point other = (Point) o; return (Double.compare(other.x, x) == 0 && Double.compare(other.y, y) == 0); }
Source:
public void stop() throws MuleException { LinkedList<Service> servicesWithSpecialStoppingOrder = new LinkedList<>(); for (Service service : services) { if (service.getName().equals(SCHEDULER_SERVICE_ARTIFACT_ID)) { servicesWithSpecialStoppingOrder.addLast(service); } else if (service.getName().contains(HTTP_SERVICE_ARTIFACT_PREFIX)) { servicesWithSpecialStoppingOrder.addFirst(service); } else { doStopService(service); } } for (Service service : servicesWithSpecialStoppingOrder) { doStopService(service); } }

Target:
public void stop() throws MuleException { Service schedulerService = null, httpService = null; for (Service service : services) { if (service.getName().equals(SCHEDULER_SERVICE_ARTIFACT_ID)) { schedulerService = service; } else if (service.getName().contains(HTTP_SERVICE_ARTIFACT_PREFIX)) { httpService = service; } else { doStopService(service); } } if (httpService != null) { doStopService(httpService); } if (schedulerService != null) { doStopService(schedulerService); } }
Source:
public static synchronized String getUniqueId(String name) { return getUniqueId(name, 256); }

Target:
public static String getUniqueId(String name) { return getUniqueId(name, 256); }
Source:
public void filterResponse(HttpResponse response, HttpMessageContents contents, HttpMessageInfo messageInfo) { if (!active) return; responses.add(new Response(messageInfo.getUrl(), response.getStatus().code(), response.getStatus().reasonPhrase(), toMap(response.headers()), contents.getContentType(), contents.getTextContents() )); if (response.getStatus().code() < 200 || response.getStatus().code() >= 300) return; String fileName = getFileName(response); if (fileName == null) return; File file = downloader.prepareTargetFile(config, fileName); try { FileUtils.writeByteArrayToFile(file, contents.getBinaryContents()); downloadedFiles.add(file); } catch (IOException e) { log.error("Failed to save downloaded file to " + file.getAbsolutePath() + " for url " + messageInfo.getUrl(), e); } }

Target:
public void filterResponse(HttpResponse response, HttpMessageContents contents, HttpMessageInfo messageInfo) { if (!active) return; responses.add(new Response(messageInfo.getUrl(), response.getStatus().code(), response.getStatus().reasonPhrase(), toMap(response.headers()), contents.getContentType(), contents.getTextContents() )); if (response.getStatus().code() < 200 || response.getStatus().code() >= 300) return; String fileName = getFileName(response); if (fileName == null) return; File file = downloader.prepareTargetFile(config, fileName); try { FileUtils.writeByteArrayToFile(file, contents.getBinaryContents()); downloadedFiles.add(file); } catch (IOException e) { log.error("Failed to save downloaded file to for url {}", file.getAbsolutePath(), messageInfo.getUrl(), e); } }
Source:
private String createWFSTMessage(JSONObject jsonPayload) throws ActionException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { Feature feature = getFeature(jsonPayload); FeatureWFSTRequestBuilder.insertFeature(baos, feature); } catch (XMLStreamException e) { LOG.error(e, "Failed to create WFS-T request"); throw new ActionException("Failed to create WFS-T request", e); } catch (JSONException e) { LOG.error(e, "JSON processing error"); throw new ActionException("JSON processing error", e); } catch (FactoryException e) { LOG.error(e, "Failed to create WFS-T request (crs)"); throw new ActionException("Failed to create WFS-T request (crs)", e); } return baos.toString(); }

Target:
private String createWFSTMessage(JSONObject jsonPayload) throws ActionException { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); Feature feature = getFeature(jsonPayload); FeatureWFSTRequestBuilder.insertFeature(baos, feature); return baos.toString(); } catch (XMLStreamException e) { LOG.error(e, "Failed to create WFS-T request"); throw new ActionException("Failed to create WFS-T request", e); } catch (JSONException e) { LOG.error(e, "JSON processing error"); throw new ActionException("JSON processing error", e); } catch (FactoryException e) { LOG.error(e, "Failed to create WFS-T request (crs)"); throw new ActionException("Failed to create WFS-T request (crs)", e); } }
Source:
public static java.nio.file.Path createMavenRepo() throws Exception { java.nio.file.Path mavenRepoPathsitory = java.nio.file.Paths.get(System.getProperty("user.home"), ".m2/repository"); if (!java.nio.file.Files.exists(mavenRepoPathsitory)) { logger.info("Creating a m2_repo into " + mavenRepoPathsitory); if (!java.nio.file.Files.exists(java.nio.file.Files.createDirectories(mavenRepoPathsitory))) { logger.error("Folder not writable to create Maven repo{}", mavenRepoPathsitory); throw new Exception("Folder not writable to create Maven repo:" + mavenRepoPathsitory); } } return mavenRepoPathsitory; }

Target:
public static java.nio.file.Path createMavenRepo() throws Exception { java.nio.file.Path mavenRepoPath = java.nio.file.Paths.get(System.getProperty("user.home"), ".m2/repository"); if (!java.nio.file.Files.exists(mavenRepoPath)) { logger.info("Creating a m2_repo into " + mavenRepoPath); if (!java.nio.file.Files.exists(java.nio.file.Files.createDirectories(mavenRepoPath))) { logger.error("Folder not writable to create Maven repo{}", mavenRepoPath); throw new Exception("Folder not writable to create Maven repo:" + mavenRepoPath); } } return mavenRepoPath; }
Source:
public List<String> getTags(String prefix) throws FeedbackException { String query = "{\n" + " \"size\": 0,\n" + " \"aggs\": {\n" + " \"terms\": {\n" + " \"terms\": {\n" + " \"field\": \"tags\",\n" + " \"include\": \"" + prefix + ".*\"\n" + " }\n" + " }\n" + " }\n" + "}"; Search.Builder builder = new Search.Builder(query).addType(TYPE); Search search = builder.build(); SearchResult result; try { result = client.execute(search); } catch (IOException e) { throw new FeedbackException("Failed to execute Tags search", e); } if (result == null) { return Collections.emptyList(); } final MetricAggregation aggregations = result.getAggregations(); if (aggregations == null) { return Collections.emptyList(); } final TermsAggregation terms = aggregations.getTermsAggregation("terms"); if (terms == null) { return Collections.emptyList(); } return terms.getBuckets().stream().map(TermsAggregation.Entry::getKey).collect(Collectors.toList()); }

Target:
public List<String> getTags(String prefix) throws FeedbackException { String query = "{\n" + " \"size\": 0,\n" + " \"aggs\": {\n" + " \"terms\": {\n" + " \"terms\": {\n" + " \"field\": \"tags\",\n" + " \"include\": \"" + gson.toJson(prefix) + ".*\"\n" + " }\n" + " }\n" + " }\n" + "}"; Search.Builder builder = new Search.Builder(query).addType(TYPE); Search search = builder.build(); SearchResult result; try { result = client.execute(search); } catch (IOException e) { throw new FeedbackException("Failed to execute Tags search", e); } if (result == null) { return Collections.emptyList(); } final MetricAggregation aggregations = result.getAggregations(); if (aggregations == null) { return Collections.emptyList(); } final TermsAggregation terms = aggregations.getTermsAggregation("terms"); if (terms == null) { return Collections.emptyList(); } return terms.getBuckets().stream().map(TermsAggregation.Entry::getKey).collect(Collectors.toList()); }
Source:
void insert(GroupInfo info) { Comparator<GroupInfo> c = new Comparator<GroupInfo>() { @Override public int compare(GroupInfo a, GroupInfo b) { int cmp = nullToEmpty(a.name()).compareTo(nullToEmpty(b.name())); if (cmp != 0) { return cmp; } return a.getGroupUUID().compareTo(b.getGroupUUID()); } public String nullToEmpty(String str) { return str == null ? "" : str; } }; int insertPosition = table.getRowCount(); for (int row = 1; row < table.getRowCount(); row++) { final GroupInfo i = getRowItem(row); if (i != null) { if (c.compare(info, i) == 0) { return; } if (c.compare(info, i) < 0) { insertPosition = row; break; } } } table.insertRow(insertPosition); applyDataRowStyle(insertPosition); populate(insertPosition, info); }

Target:
void insert(GroupInfo info) { Comparator<GroupInfo> c = new Comparator<GroupInfo>() { @Override public int compare(GroupInfo a, GroupInfo b) { int cmp = nullToEmpty(a.name()).compareTo(nullToEmpty(b.name())); if (cmp != 0) { return cmp; } return a.getGroupUUID().compareTo(b.getGroupUUID()); } public String nullToEmpty(String str) { return str == null ? "" : str; } }; int insertPosition; for (insertPosition = 1; insertPosition < table.getRowCount(); insertPosition++) { final GroupInfo i = getRowItem(insertPosition); if (i != null) { if (c.compare(info, i) == 0) { return; } if (c.compare(info, i) < 0) { break; } } } table.insertRow(insertPosition); applyDataRowStyle(insertPosition); populate(insertPosition, info); }
Source:
protected String buildValidationErrorMessageForSingleError(ErrorMessage errorMessage) { String errorMessageString = configurationService.getPropertyValueAsString(errorMessage.getErrorKey()); if (StringUtils.isBlank(errorMessageString)) { throw new RuntimeException("Cannot find error message for key: " + errorMessage.getErrorKey()); } Object[] messageParameters = (Object[]) errorMessage.getMessageParameters(); if (messageParameters != null && messageParameters.length > 0) { return MessageFormat.format(errorMessageString, messageParameters); } else { return errorMessageString; } }

Target:
protected String buildValidationErrorMessageForSingleError(ErrorMessage errorMessage) { String errorMessageString = configurationService.getPropertyValueAsString(errorMessage.getErrorKey()); if (StringUtils.isBlank(errorMessageString)) { throw new RuntimeException("Cannot find error message for key: " + errorMessage.getErrorKey()); } String[] messageParameters = errorMessage.getMessageParameters(); if (ArrayUtils.isNotEmpty(messageParameters)) { return MessageFormat.format(errorMessageString, messageParameters); } else { return errorMessageString; } }
Source:
public void connect() { if (fState == TargetNodeState.DISCONNECTED) { try { setTargetNodeState(TargetNodeState.CONNECTING); Thread th= new Thread() { @Override public void run() { try { fRemoteProxy.connect(new NullProgressMonitor()); handleConnected(); } catch (Exception e) { Activator.getDefault().logError(Messages.TraceControl_ConnectionFailure + " (" + getName() + "). \n", e); handleDisconnected(); } } }; th.start(); } catch (Exception e) { setTargetNodeState(TargetNodeState.DISCONNECTED); Activator.getDefault().logError(Messages.TraceControl_ConnectionFailure + " (" + getName() + "). \n", e); } } }

Target:
public void connect() { if (fState == TargetNodeState.DISCONNECTED) { try { setTargetNodeState(TargetNodeState.CONNECTING); Job job = new Job(format(Messages.TraceControl_OpenConnectionTo, getName())) { @Override protected IStatus run(IProgressMonitor monitor) { try { fRemoteProxy.connect(monitor); return Status.OK_STATUS; } catch (Exception e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ConnectionFailure, e); } } }; job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { IStatus status = event.getResult(); if (status.isOK()) { handleConnected(); } else { handleDisconnected(); if (status.getSeverity() != IStatus.CANCEL) { Activator.getDefault().getLog().log(status); } } } }); job.schedule(); } catch (Exception e) { setTargetNodeState(TargetNodeState.DISCONNECTED); Activator.getDefault().logError(Messages.TraceControl_ConnectionFailure + " (" + getName() + "). \n", e); } } }
Source:
public boolean isActive() { long diff = this.state.startTime - System.currentTimeMillis(); boolean isActive = this.state.isActive && (!this.state.isPaused) && (diff <= 0); if (!isActive) { LOGGER.info("[Ramp Is Isolated] (isActive = {}, isPause = {}, timeDiff = {}", this.state.isActive, this.state.isPaused, diff); } return isActive; }

Target:
public boolean isActive() { long timeDiff = this.state.startTime - System.currentTimeMillis(); boolean isActive = this.state.isActive && (!this.state.isPaused) && (timeDiff <= 0); if (!isActive) { LOGGER.info("[Ramp Is Isolated] (isActive = {}, isPause = {}, timeDiff = {}", this.state.isActive, this.state.isPaused, timeDiff); } return isActive; }