auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Override public void load(Request request, int networkPolicy, Callback callback) { try { okhttp3.Request callRequest = createRequest(request, networkPolicy); Response response = callFactory.newCall(callRequest).execute(); if (!response.isSuccessful()) { callback.onError(new ResponseException(response.code(), request.networkPolicy)); } Picasso.LoadedFrom loadedFrom = response.cacheResponse() == null ? NETWORK : DISK; ResponseBody body = response.body(); if (loadedFrom == DISK && body.contentLength() == 0) { body.close(); callback.onError( new ContentLengthException("Received response with 0 content-length header.")); } if (loadedFrom == NETWORK && body.contentLength() > 0) { stats.dispatchDownloadFinished(body.contentLength()); } callback.onSuccess(new Result(body.source(), loadedFrom)); } catch (IOException e) { callback.onError(e); } }

Target:
@Override public void load(Request request, int networkPolicy, Callback callback) { boolean signaledCallback = false; try { okhttp3.Request callRequest = createRequest(request, networkPolicy); Response response = callFactory.newCall(callRequest).execute(); if (!response.isSuccessful()) { signaledCallback = true; callback.onError(new ResponseException(response.code(), request.networkPolicy)); return; } Picasso.LoadedFrom loadedFrom = response.cacheResponse() == null ? NETWORK : DISK; ResponseBody body = response.body(); if (loadedFrom == DISK && body.contentLength() == 0) { body.close(); signaledCallback = true; callback.onError( new ContentLengthException("Received response with 0 content-length header.")); return; } if (loadedFrom == NETWORK && body.contentLength() > 0) { stats.dispatchDownloadFinished(body.contentLength()); } signaledCallback = true; callback.onSuccess(new Result(body.source(), loadedFrom)); } catch (IOException e) { if (!signaledCallback) { callback.onError(e); } } }
Source:
private void setupBitmapLayout() { if (cuePosition == Cue.DIMEN_UNSET) { cuePosition = 0.5f; } if (cueLine == Cue.DIMEN_UNSET) { cueLineAnchor = Cue.ANCHOR_TYPE_MIDDLE; cueLine = 0.85f; } if (cueSize == Cue.DIMEN_UNSET) { cueSize = 0.5f; } int parentWidth = parentRight - parentLeft; int parentHeight = parentBottom - parentTop; float anchorX = parentLeft + (parentWidth * cuePosition); float anchorY = parentTop + (parentHeight * cueLine); int width = Math.round(parentWidth * cueSize); int height = cueBitmapHeight != Cue.DIMEN_UNSET ? Math.round(parentHeight * cueBitmapHeight) : Math.round(width * ((float) cueBitmap.getHeight() / cueBitmap.getWidth())); int x = Math.round(cueLineAnchor == Cue.ANCHOR_TYPE_END ? (anchorX - width) : cueLineAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorX - (width / 2)) : anchorX); int y = Math.round(cuePositionAnchor == Cue.ANCHOR_TYPE_END ? (anchorY - height) : cuePositionAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorY - (height / 2)) : anchorY); bitmapRect = new Rect(x, y, x + width, y + height); }

Target:
private void setupBitmapLayout() { int parentWidth = parentRight - parentLeft; int parentHeight = parentBottom - parentTop; float anchorX = parentLeft + (parentWidth * cuePosition); float anchorY = parentTop + (parentHeight * cueLine); int width = Math.round(parentWidth * cueSize); int height = cueBitmapHeight != Cue.DIMEN_UNSET ? Math.round(parentHeight * cueBitmapHeight) : Math.round(width * ((float) cueBitmap.getHeight() / cueBitmap.getWidth())); int x = Math.round(cueLineAnchor == Cue.ANCHOR_TYPE_END ? (anchorX - width) : cueLineAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorX - (width / 2)) : anchorX); int y = Math.round(cuePositionAnchor == Cue.ANCHOR_TYPE_END ? (anchorY - height) : cuePositionAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorY - (height / 2)) : anchorY); bitmapRect = new Rect(x, y, x + width, y + height); }
Source:
public Response intercept(Chain chain) throws IOException { Request request = chain.request(); if (authorizer != null) { if ((expiringSAMLAuth == null || threshold <= Instant.now().getEpochSecond()) && isCallbackExecuting.compareAndSet(false, true)) { authorizeCallback(); } } else if (renewer != null) { if (threshold <= Instant.now().getEpochSecond()) { RenewExpiry renewExpiry = new RenewExpiry(); if (isCallbackExecuting.compareAndSet(false, true)) Executors.defaultThreadFactory().newThread(renewExpiry).start(); } } String samlHeaderValue = RESTServices.AUTHORIZATION_TYPE_SAML + " " + RESTServices.AUTHORIZATION_PARAM_TOKEN + "=" + authorizationTokenValue; Request authenticatedRequest = request.newBuilder().header(RESTServices.HEADER_AUTHORIZATION, samlHeaderValue) .build(); return chain.proceed(authenticatedRequest); }

Target:
public Response intercept(Chain chain) throws IOException { Request request = chain.request(); if (authorizer != null) { if(expiringSAMLAuth == null) { authorizeCallbackWrapper(null); } else if(threshold<=Instant.now().getEpochSecond()){ authorizeCallbackWrapper(expiringSAMLAuth.getExpiry()); } } else if (renewer != null && threshold <= Instant.now().getEpochSecond() && isCallbackExecuting.compareAndSet(false, true)) { RenewCallbackWrapper renewCallbackWrapper = new RenewCallbackWrapper(expiringSAMLAuth); Executors.defaultThreadFactory().newThread(renewCallbackWrapper).start(); } String samlHeaderValue = RESTServices.AUTHORIZATION_TYPE_SAML + " " + RESTServices.AUTHORIZATION_PARAM_TOKEN + "=" + authorizationTokenValue; Request authenticatedRequest = request.newBuilder().header(RESTServices.HEADER_AUTHORIZATION, samlHeaderValue) .build(); return chain.proceed(authenticatedRequest); }
Source:
private void checkStatusMessage(){ switch (servertype.getStatus()){ case (1): if (testServerURL.startsWith("http")) onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_connection_established))); else onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_nossl_plain_ok_title))); break; case (2): onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_secure_connection))); break; case (3): onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_secure_connection))); break; case (4): onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_nossl_plain_ok_title))); break; default: break; } }

Target:
private void checkStatusMessage(){ switch (servertype){ case HTTP: if (testServerURL.startsWith("http")) onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_connection_established))); else onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_nossl_plain_ok_title))); break; case HTTPS_NON_SECURE: onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_secure_connection))); break; case HTTPS_SECURE: onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_secure_connection))); break; case REDIRECTED_NON_SECURE: onView(withId(R.id.server_status_text)).check(matches(withText(R.string.auth_nossl_plain_ok_title))); break; default: break; } }
Source:
public void init() { final GregorianCalendar gregorianCalendar = new GregorianCalendar(); try { this.xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar); } catch (final DatatypeConfigurationException e) { e.printStackTrace(); } }

Target:
public void init() { try { this.xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()); } catch (final DatatypeConfigurationException e) { e.printStackTrace(); } }
Source:
public static Long convertObjectToLong(Object valObj) { if (valObj == null) { return 0L; } if (valObj instanceof Long) { return (Long) valObj; } else if (valObj instanceof Number) { return ((Number) valObj).longValue(); } else if (valObj instanceof String) { Long parsedVal = DimensionHandlerUtils.getExactLongFromDecimalString((String) valObj); return parsedVal == null ? 0L : parsedVal; } else { throw new ParseException("Unknown type[%s]", valObj.getClass()); } }

Target:
public static Long convertObjectToLong(Object valObj) { if (valObj == null) { return LONG_ZERO; } if (valObj instanceof Long) { return (Long) valObj; } else if (valObj instanceof Number) { return ((Number) valObj).longValue(); } else if (valObj instanceof String) { Long parsedVal = DimensionHandlerUtils.getExactLongFromDecimalString((String) valObj); return parsedVal == null ? LONG_ZERO : parsedVal; } else { throw new ParseException("Unknown type[%s]", valObj.getClass()); } }
Source:
private void checkQualityGateDoesNotAlreadyExist(DbSession dbSession, OrganizationDto organizationDto, String name) { QualityGateDto existingQgate = dbClient.qualityGateDao().selectByOrganizationAndName(dbSession, organizationDto, name); if (existingQgate != null) { throw new IllegalArgumentException(format(IS_ALREADY_USED_MESSAGE, "Name")); } }

Target:
private void checkQualityGateDoesNotAlreadyExist(DbSession dbSession, OrganizationDto organizationDto, String name) { QualityGateDto existingQgate = dbClient.qualityGateDao().selectByOrganizationAndName(dbSession, organizationDto, name); checkArgument(existingQgate == null, IS_ALREADY_USED_MESSAGE, "Name"); }
Source:
public Map<Group, Object> getAllGroupsWithHierarchy(PerunSession sess, Vo vo) throws InternalErrorException, PrivilegeException, VoNotExistsException { Utils.checkPerunSession(sess); if (!AuthzResolver.authorizedInternal(sess, "", Collections.singletonList(vo))) { throw new PrivilegeException(sess, "getAllGroupsWithHierarchy"); } getPerunBl().getVosManagerBl().checkVoExists(sess, vo); Map<Group, Object> groups = getGroupsManagerBl().getAllGroupsWithHierarchy(sess, vo); groups.keySet().removeIf(group -> !AuthzResolver.authorizedInternal(sess, "filter-getAllGroupsWithHierarchy_Vo_policy", Collections.singletonList(group))); return groups; }

Target:
public Map<Group, Object> getAllGroupsWithHierarchy(PerunSession sess, Vo vo) throws InternalErrorException, PrivilegeException, VoNotExistsException { Utils.checkPerunSession(sess); getPerunBl().getVosManagerBl().checkVoExists(sess, vo); if (!AuthzResolver.authorizedInternal(sess, "getAllGroupsWithHierarchy_Vo_policy", Collections.singletonList(vo))) { throw new PrivilegeException(sess, "getAllGroupsWithHierarchy"); } Map<Group, Object> groups = getGroupsManagerBl().getAllGroupsWithHierarchy(sess, vo); groups.keySet().removeIf(group -> !AuthzResolver.authorizedInternal(sess, "filter-getAllGroupsWithHierarchy_Vo_policy", Collections.singletonList(group))); return groups; }
Source:
private Bucket mockBucket(final String name, final String exists) throws IOException { final TemporaryFolder folder = new TemporaryFolder(); folder.create(); final File bucket = new File(folder.getRoot(), name); assert bucket.mkdir(); assert new File(bucket, exists).createNewFile(); final File sub = new File(bucket, "sub"); assert sub.mkdir(); assert new File(sub, "test").createNewFile(); return new MkBucket(folder.getRoot(), name); }

Target:
private Bucket mockBucket(final String name, final String exists) throws IOException { final Path bucket = Files.createDirectories( Paths.get(this.folder.getRoot().getAbsolutePath(), name, name) ); Files.createFile(bucket.resolve(exists)); Files.createFile( Files.createDirectories(bucket.resolve("sub")).resolve("file") ); return new MkBucket(this.folder.getRoot(), name); }
Source:
public void testSetObjectFromJavaArray() throws SQLException { String[] strArray = new String[]{"a", "b", "c"}; Object[] objCopy = new Object[strArray.length]; System.arraycopy(strArray, 0, objCopy, 0, strArray.length); PreparedStatement pstmt = _conn.prepareStatement("INSERT INTO arrtest(strarr) VALUES (?)"); try { pstmt.setObject(1, objCopy, Types.ARRAY); pstmt.executeUpdate(); Assert.fail("setObject() with a Java array parameter and Types.ARRAY shouldn't succeed"); } catch (org.postgresql.util.PSQLException ex) { } try { pstmt.setObject(1, objCopy); pstmt.executeUpdate(); Assert.fail("setObject() with a Java array parameter and no Types argument shouldn't succeed"); } catch (org.postgresql.util.PSQLException ex) { } pstmt.setObject(1, strArray); pstmt.executeUpdate(); pstmt.setObject(1, strArray, Types.ARRAY); pstmt.executeUpdate(); Array sqlArray = _conn.createArrayOf("text", strArray); pstmt.setArray(1, sqlArray); pstmt.executeUpdate(); pstmt.close(); }

Target:
public void testSetObjectFromJavaArray() throws SQLException { String[] strArray = new String[]{"a", "b", "c"}; Object[] objCopy = Arrays.copyOf(strArray, strArray.length, Object[].class); PreparedStatement pstmt = _conn.prepareStatement("INSERT INTO arrtest(strarr) VALUES (?)"); try { pstmt.setObject(1, objCopy, Types.ARRAY); pstmt.executeUpdate(); Assert.fail("setObject() with a Java array parameter and Types.ARRAY shouldn't succeed"); } catch (org.postgresql.util.PSQLException ex) { } try { pstmt.setObject(1, objCopy); pstmt.executeUpdate(); Assert.fail("setObject() with a Java array parameter and no Types argument shouldn't succeed"); } catch (org.postgresql.util.PSQLException ex) { } pstmt.setObject(1, strArray); pstmt.executeUpdate(); pstmt.setObject(1, strArray, Types.ARRAY); pstmt.executeUpdate(); Array sqlArray = _conn.createArrayOf("text", strArray); pstmt.setArray(1, sqlArray); pstmt.executeUpdate(); pstmt.close(); }
Source:
public int getDefaultWaitInSeconds() { return (int) polygons.defaultData * 60; }

Target:
public int getDefaultWaitInSeconds() { return (int) (polygons.defaultData * 60); }
Source:
public static void setUpClass() { mongoStats = new BasicDBObject(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MAF_FIELD, 0.1); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MGF_FIELD, 0.01); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MAFALLELE_FIELD, "A"); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MGFGENOTYPE_FIELD, "A/A"); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MISSALLELE_FIELD, 10); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.MISSGENOTYPE_FIELD, 5); BasicDBObject genotypes = new BasicDBObject(); genotypes.append("0/0", 100); genotypes.append("0/1", 50); genotypes.append("1/1", 10); mongoStats.append(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantStatsConverter.NUMGT_FIELD, genotypes); stats = new VariantStats(null, -1, null, null, Variant.VariantType.SNV, 0.1f, 0.01f, "A", "A/A", 10, 5, -1, -1, -1, -1, -1); stats.addGenotype(new Genotype("0/0"), 100); stats.addGenotype(new Genotype("0/1"), 50); stats.addGenotype(new Genotype("1/1"), 10); }

Target:
public static void setUpClass() { mongoStats = new BasicDBObject(DBObjectToVariantStatsConverter.MAF_FIELD, 0.1); mongoStats.append(DBObjectToVariantStatsConverter.MGF_FIELD, 0.01); mongoStats.append(DBObjectToVariantStatsConverter.MAFALLELE_FIELD, "A"); mongoStats.append(DBObjectToVariantStatsConverter.MGFGENOTYPE_FIELD, "A/A"); mongoStats.append(DBObjectToVariantStatsConverter.MISSALLELE_FIELD, 10); mongoStats.append(DBObjectToVariantStatsConverter.MISSGENOTYPE_FIELD, 5); BasicDBObject genotypes = new BasicDBObject(); genotypes.append("0/0", 100); genotypes.append("0/1", 50); genotypes.append("1/1", 10); mongoStats.append(DBObjectToVariantStatsConverter.NUMGT_FIELD, genotypes); stats = new VariantStats(null, -1, null, null, Variant.VariantType.SNV, 0.1f, 0.01f, "A", "A/A", 10, 5, -1, -1, -1, -1, -1); stats.addGenotype(new Genotype("0/0"), 100); stats.addGenotype(new Genotype("0/1"), 50); stats.addGenotype(new Genotype("1/1"), 10); }
Source:
public static void setup() throws InterruptedException { zkServer = new EmbeddedZookeeper(); zkServer.setup(); System.out.println("zk port=" + zkServer.getPort()); }

Target:
public static void setup() throws InterruptedException { zkServer = new EmbeddedZookeeper(); zkServer.setup(); }
Source:
public <R> CompletableFuture<R> eval(K key, V value, BiFunction<V, ReadWriteEntryView<K, V>, R> f) { log.tracef("Invoked eval(k=%s, v=%s, %s)", key, value, params); Object keyEncoded = keyDataConversion.toStorage(key); ReadWriteKeyValueCommand cmd = fmap.commandsFactory.buildReadWriteKeyValueCommand(keyEncoded, value, (BiFunction) f, params, keyDataConversion, valueDataConversion); InvocationContext ctx = getInvocationContext(true, 1); if (ctx.getLockOwner() == null) { ctx.setLockOwner(cmd.getKeyLockOwner()); } return invokeAsync(ctx, cmd); }

Target:
public <R> CompletableFuture<R> eval(K key, V value, BiFunction<V, ReadWriteEntryView<K, V>, R> f) { log.tracef("Invoked eval(k=%s, v=%s, %s)", key, value, params); Object keyEncoded = keyDataConversion.toStorage(key); Object valueEncoded = valueDataConversion.toStorage(value); ReadWriteKeyValueCommand cmd = fmap.commandsFactory.buildReadWriteKeyValueCommand(keyEncoded, valueEncoded, (BiFunction) f, params, keyDataConversion, valueDataConversion); InvocationContext ctx = getInvocationContext(true, 1); if (ctx.getLockOwner() == null) { ctx.setLockOwner(cmd.getKeyLockOwner()); } return invokeAsync(ctx, cmd); }
Source:
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } if (source instanceof List) { List<?> sourceList = (List<?>) source; if (!sourceList.isEmpty() && sourceList.get(0) instanceof String) { return new ArrayList<String>((List<? extends String>) sourceList); } } if (source instanceof Collection) { Collection<String> results = new ArrayList<>(); for (Object object : ((Collection<?>) source)) { if (object != null) { results.add(object.toString()); } } return results; } return Collections.singletonList(source.toString()); }

Target:
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } if (source instanceof Collection) { Collection<String> results = new ArrayList<>(); for (Object object : ((Collection<?>) source)) { if (object != null) { results.add(object.toString()); } } return results; } return Collections.singletonList(source.toString()); }
Source:
public FactModelTuple retrieveFactModelTuple(Path path, String dmnPath) { DMNModel dmnModel = getDMNModel(path, dmnPath); SortedMap<String, FactModelTree> visibleFacts = new TreeMap<>(); SortedMap<String, FactModelTree> hiddenFacts = new TreeMap<>(); ErrorHolder errorHolder = new ErrorHolder(); for (InputDataNode input : dmnModel.getInputs()) { DMNType type = input.getType(); checkTypeSupport(type, errorHolder, input.getName()); try { visibleFacts.put(input.getName(), createTopLevelFactModelTree(input.getName(), type, hiddenFacts, FactModelTree.Type.INPUT)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } for (DecisionNode decision : dmnModel.getDecisions()) { DMNType type = decision.getResultType(); checkTypeSupport(type, errorHolder, decision.getName()); try { visibleFacts.put(decision.getName(), createTopLevelFactModelTree(decision.getName(), type, hiddenFacts, FactModelTree.Type.DECISION)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } FactModelTuple factModelTuple = new FactModelTuple(visibleFacts, hiddenFacts); errorHolder.getMultipleNestedCollection().forEach(factModelTuple::addMultipleNestedCollectionError); errorHolder.getMultipleNestedObject().forEach(factModelTuple::addMultipleNestedObjectError); return factModelTuple; }

Target:
public FactModelTuple retrieveFactModelTuple(Path path, String dmnPath) { DMNModel dmnModel = getDMNModel(path, dmnPath); SortedMap<String, FactModelTree> visibleFacts = new TreeMap<>(); SortedMap<String, FactModelTree> hiddenFacts = new TreeMap<>(); ErrorHolder errorHolder = new ErrorHolder(); for (InputDataNode input : dmnModel.getInputs()) { DMNType type = input.getType(); checkTypeSupport(type, false, errorHolder, input.getName()); try { visibleFacts.put(input.getName(), createTopLevelFactModelTree(input.getName(), type, hiddenFacts, FactModelTree.Type.INPUT)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } for (DecisionNode decision : dmnModel.getDecisions()) { DMNType type = decision.getResultType(); checkTypeSupport(type, false, errorHolder, decision.getName()); try { visibleFacts.put(decision.getName(), createTopLevelFactModelTree(decision.getName(), type, hiddenFacts, FactModelTree.Type.DECISION)); } catch (WrongDMNTypeException e) { throw ExceptionUtilities.handleException(e); } } FactModelTuple factModelTuple = new FactModelTuple(visibleFacts, hiddenFacts); errorHolder.getMultipleNestedCollection().forEach(factModelTuple::addMultipleNestedCollectionError); errorHolder.getMultipleNestedObject().forEach(factModelTuple::addMultipleNestedObjectError); return factModelTuple; }
Source:
public V execute() throws IOException { try { call = delegate.get(); Future<V> future = executor.submit(() -> { try (AutoCloseable nameReverter = updateThreadName(call.toString())) { return call.execute(); } }); V result = future.get(); limitListener.onSuccess(); return result; } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RejectedExecutionException) { limitListener.onDropped(); } else { limitListener.onIgnore(); } throw new ThrottleException(cause); } catch (RuntimeException e) { limitListener.onIgnore(); throw e; } catch (Exception e) { limitListener.onIgnore(); throw new ThrottleException(e); } }

Target:
@Override public V execute() throws IOException { try { delegate = supplier.get(); Future<V> future = executor.submit(() -> { String oldName = setCurrentThreadName(delegate.toString()); try { return delegate.execute(); } finally { setCurrentThreadName(oldName); } }); V result = future.get(); limitListener.onSuccess(); return result; } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RejectedExecutionException) { limitListener.onDropped(); } else { limitListener.onIgnore(); } if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else if (cause instanceof IOException) { throw (IOException) cause; } else { throw new RuntimeException("Issue while executing on a throttled call", cause); } } catch (InterruptedException e) { limitListener.onIgnore(); throw new RuntimeException("Interrupted while blocking on a throttled call", e); } catch (RuntimeException | Error e) { propagateIfFatal(e); limitListener.onIgnore(); throw e; } }
Source:
public AnsiLogger(Log log, boolean useColor, String verbose, boolean batchMode, String prefix) { this.log = log; this.isVerbose = checkBackwardVersionValues(verbose); if (isVerbose == null) { this.verboseModes = getVerboseModesFromStr(verbose); isVerbose = Boolean.TRUE; } else { this.verboseModes = Collections.singletonList(LogVerboseCategory.BUILD); } this.prefix = prefix; this.batchMode = batchMode; initializeColor(useColor); }

Target:
public AnsiLogger(Log log, boolean useColor, String verbose, boolean batchMode, String prefix) { this.log = log; this.prefix = prefix; this.batchMode = batchMode; checkVerboseLoggingEnabled(verbose); initializeColor(useColor); }
Source:
protected boolean isLightStreamer(Instrumentation instrumentation) { for (String name : System.getProperties().stringPropertyNames()) { if (name.contains("com.lightstreamer")) { return true; } } for (Class loadedClass : instrumentation.getAllLoadedClasses()) { if (loadedClass.getCanonicalName().contains("com.lightstreamer")) { return true; } } return false; }

Target:
protected boolean isLightStreamer(Instrumentation instrumentation) { Properties systemProperties = System.getProperties(); for (String expectedPropertyName : SYSTEM_PROERTY_NAMES) { if (systemProperties.containsKey(expectedPropertyName)) { return true; } } return false; }
Source:
private static String getString(LiteralTree literal) { Optional<String> string = literal.asConstant(String.class); if (string.isPresent()) { return string.get(); } else { throw new IllegalArgumentException("Only string literals allowed"); } }

Target:
private static String getString(LiteralTree literal) { return literal.asConstant(String.class) .orElseThrow(() -> new IllegalArgumentException("Only string literals allowed")); }
Source:
public ColumnMatchResult validate(Column column, ChecksumResult controlResult, ChecksumResult testResult) { String checksumColumnAlias = getChecksumColumnAlias(column); Object controlChecksum = controlResult.getChecksum(checksumColumnAlias); Object testChecksum = testResult.getChecksum(checksumColumnAlias); String cardinalityColumnAlias = getCardinalityColumnAlias(column); long controlCardinalitySum = (long) controlResult.getChecksum(cardinalityColumnAlias); long testCardinalitySum = (long) testResult.getChecksum(cardinalityColumnAlias); return new ColumnMatchResult( Objects.equals(controlChecksum, testChecksum) && controlCardinalitySum == testCardinalitySum, format("control(checksum: %s, cardinality: %s) test(checksum: %s, cardinality: %s)", controlChecksum, controlCardinalitySum, testChecksum, testCardinalitySum)); }

Target:
public ColumnMatchResult validate(Column column, ChecksumResult controlResult, ChecksumResult testResult) { String checksumColumnAlias = getChecksumColumnAlias(column); Object controlChecksum = controlResult.getChecksum(checksumColumnAlias); Object testChecksum = testResult.getChecksum(checksumColumnAlias); String cardinalitySumColumnAlias = getCardinalitySumColumnAlias(column); Object controlCardinalitySum = controlResult.getChecksum(cardinalitySumColumnAlias); Object testCardinalitySum = testResult.getChecksum(cardinalitySumColumnAlias); return new ColumnMatchResult( Objects.equals(controlChecksum, testChecksum) && Objects.equals(controlCardinalitySum, testCardinalitySum), format( "control(checksum: %s, cardinality_sum: %s) test(checksum: %s, cardinality_sum: %s)", controlChecksum, controlCardinalitySum, testChecksum, testCardinalitySum)); }
Source:
private void setupFocusHandling() { focusListener = new IWindowListener() { public void windowOpened(IWorkbenchWindow window) { } public void windowDeactivated(IWorkbenchWindow window) { } public void windowClosed(IWorkbenchWindow window) { } public void windowActivated(IWorkbenchWindow window) { if (rcs.doReschedule) rcs.schedule(); refreshJob.triggerRefresh(); } }; Job job = new Job(UIText.ConfigurationChecker_checkConfiguration) { @Override protected IStatus run(IProgressMonitor monitor) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().addWindowListener(focusListener); else schedule(1000L); return Status.OK_STATUS; } }; job.schedule(); }

Target:
private void setupFocusHandling() { focusListener = new IWindowListener() { public void windowOpened(IWorkbenchWindow window) { } public void windowDeactivated(IWorkbenchWindow window) { } public void windowClosed(IWorkbenchWindow window) { } public void windowActivated(IWorkbenchWindow window) { if (rcs.doReschedule) rcs.schedule(); refreshJob.triggerRefresh(); } }; Job job = new Job(UIText.Activator_setupFocusListener) { @Override protected IStatus run(IProgressMonitor monitor) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().addWindowListener(focusListener); else schedule(1000L); return Status.OK_STATUS; } }; job.schedule(); }
Source:
private void endCommandActions() { getBackend().endAction(getImagesActionType(), getParameters(), getContext().duplicate().resetCompensationContext().resetExecutionContext().resetLock()); setSucceeded(true); }

Target:
private void endCommandActions() { getBackend().endAction(getImagesActionType(), getParameters(), getContext().duplicate().withoutCompensationContext().withoutExecutionContext().withoutLock()); setSucceeded(true); }
Source:
public void testGetPreferredNameNullInput() { DoorsTableRowCollector dtc = new DoorsTableRowCollector(extractor); dtc.getPreferredName(null); Assert.fail(); }

Target:
public void testGetPreferredNameNullInput() { DoorsTableRowCollector dtc = new DoorsTableRowCollector(extractor); dtc.getPreferredName(null); }
Source:
private void scheduleHsErrCheck(LogListener logListener) { try { File installDir = getInstallDir().orNull(); if (installDir == null) { return; } Job job = new Job("Check hs_err_pid* files") { @Override protected IStatus run(IProgressMonitor monitor) { new EclipseCrashLogCheck(installDir, logListener).run(); return Status.OK_STATUS; } }; job.schedule(TimeUnit.SECONDS.toMillis(15)); } catch (Exception e) { Logs.log(LogMessages.ERROR_HS_ERR_CHECK_FAILED, e); } }

Target:
private void scheduleHsErrCheck(LogListener logListener) { try { File installDir = getInstallDir().orNull(); if (installDir == null) { return; } Job job = new JvmCrashLogCheck(installDir, logListener); job.setPriority(Job.DECORATE); job.schedule(TimeUnit.SECONDS.toMillis(15)); } catch (Exception e) { Logs.log(LogMessages.ERROR_HS_ERR_CHECK_FAILED, e); } }
Source:
public <X> GridValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) { return new BasicGridBinder<X>( javaTypeDescriptor, this ) { @Override protected void doBind(Tuple resultset, X value, String[] names, WrapperOptions options) { Proxy proxy = (Proxy) value; InvocationHandler handler = Proxy.getInvocationHandler( proxy ); log.info( "handler:" + handler ); BinaryStream stream = null; try { Method getUnderlyingStreamMethod = getUnderlyingStreamMethod(); stream = (BinaryStream) handler.invoke( proxy, getUnderlyingStreamMethod, new Object[0] ); } catch (Throwable th) { throw new HibernateError( "Cannot get input stream!", th ); } resultset.put( names[0], stream ); } }; }

Target:
public <X> GridValueBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) { return new BasicGridBinder<X>( javaTypeDescriptor, this ) { @Override protected void doBind(Tuple resultset, X value, String[] names, WrapperOptions options) { Proxy proxy = (Proxy) value; InvocationHandler handler = Proxy.getInvocationHandler( proxy ); BinaryStream stream = null; try { Method getUnderlyingStreamMethod = getUnderlyingStreamMethod(); stream = (BinaryStream) handler.invoke( proxy, getUnderlyingStreamMethod, new Object[0] ); } catch (Throwable th) { throw new HibernateException( "Cannot get input stream!", th ); } resultset.put( names[0], stream ); } }; }
Source:
public Response remove() { Provider provider = BackendExternalProviderHelper.getProvider(this, id); ProviderParameters parameters = new ProviderParameters(provider); parameters.setForce(isForce()); return performAction(ActionType.RemoveProvider, parameters); }

Target:
public Response remove() { Provider provider = BackendExternalProviderHelper.getProvider(this, id); ProviderParameters parameters = new ProviderParameters(provider, isForce()); return performAction(ActionType.RemoveProvider, parameters); }
Source:
private String getProcessName(String tid) { String execName = fProcessNameMap.get(tid); if (execName != null) { return execName; } ITmfTrace trace = getTrace(); if (trace == null) { return tid; } ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); if (kernelSs == null) { return tid; } int execNameQuark = kernelSs.optQuarkAbsolute(Attributes.THREADS, tid, Attributes.EXEC_NAME); if (execNameQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return tid; } Iterator<ITmfStateInterval> iterator = new StateSystemUtils.QuarkIterator(kernelSs, execNameQuark, getStartTime()); while (iterator.hasNext()) { ITmfStateInterval execNameInterval = iterator.next(); if (execNameInterval.getStartTime() > getEndTime()) { break; } if (execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) { execName = execNameInterval.getStateValue().unboxStr(); fProcessNameMap.put(tid, execName); return execName; } } return tid; }

Target:
private String getProcessName(String tid) { String execName = fProcessNameMap.get(tid); if (execName != null) { return execName; } ITmfTrace trace = getTrace(); if (trace == null) { return tid; } ITmfStateSystem kernelSs = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); if (kernelSs == null) { return tid; } int execNameQuark = kernelSs.optQuarkAbsolute(Attributes.THREADS, tid, Attributes.EXEC_NAME); if (execNameQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return tid; } Iterator<ITmfStateInterval> iterator = new StateSystemUtils.QuarkIterator(kernelSs, execNameQuark, getStartTime()); while (iterator.hasNext()) { ITmfStateInterval execNameInterval = iterator.next(); if (execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) { execName = execNameInterval.getStateValue().unboxStr(); fProcessNameMap.put(tid, execName); return execName; } } return tid; }
Source:
protected void testExecute() throws Exception { loginAsStudent(student1InCourse1.getGoogleId()); ______TS("Not enough parameters"); verifyHttpParameterFailure(); verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); ______TS("Typical success case, student"); String[] params = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), }; DeleteFeedbackResponseAction a = getAction(params); JsonResult r = getJsonResult(a); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertNull(logic.getFeedbackResponse(typicalResponse.getId())); ______TS("Typical success case, instructor"); loginAsInstructor(instructor1OfCourse1.getGoogleId()); params = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse3.getId(), }; a = getAction(params); r = getJsonResult(a); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertNull(logic.getFeedbackResponse(typicalResponse3.getId())); }

Target:
protected void testExecute() throws Exception { loginAsStudent(student1InCourse1.getGoogleId()); ______TS("Not enough parameters"); verifyHttpParameterFailure(); verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); ______TS("Typical success case, student"); String[] params = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), }; DeleteFeedbackResponseAction a = getAction(params); JsonResult r = getJsonResult(a); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertNull(logic.getFeedbackResponse(typicalResponse.getId())); a = getAction(params); DeleteFeedbackResponseAction finalAction = a; assertThrows(NullPointerException.class, () -> getJsonResult(finalAction)); ______TS("Typical success case, instructor"); loginAsInstructor(instructor1OfCourse1.getGoogleId()); params = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse3.getId(), }; a = getAction(params); r = getJsonResult(a); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertNull(logic.getFeedbackResponse(typicalResponse3.getId())); a = getAction(params); DeleteFeedbackResponseAction finalA = a; assertThrows(NullPointerException.class, () -> getJsonResult(finalA)); }
Source:
public void participantAdded(final ChatParticipant chatParticipant) { if (chatters == null) { return; } chatters.put(chatParticipant, ""); updateConnections(); chatMessageListeners.forEach( listener -> listener.addStatusMessage(chatParticipant.getPlayerName() + " has joined", true)); }

Target:
public void participantAdded(final ChatParticipant chatParticipant) { if (chatters == null) { return; } chatters.put(chatParticipant, ""); updateConnections(); chatMessageListeners.forEach( listener -> listener.playerJoined(chatParticipant.getPlayerName() + " has joined")); }
Source:
private static boolean evalExpression(Expression expression, Set<String> tags) { switch (expression.kind()) { case IDENTIFIER: Identifier ident = (Identifier) expression; return tags.contains(ident.getName()); case BINARY_OPERATOR: BinaryOperatorExpression boe = (BinaryOperatorExpression) expression; switch (boe.getOperator()) { case OR: return evalExpression(boe.getX(), tags) || evalExpression(boe.getY(), tags); case AND: return evalExpression(boe.getX(), tags) && evalExpression(boe.getY(), tags); default: throw new FilterEvaluationException( String.format("Got %s but expected 'and' or 'or'", boe.getOperator())); } case UNARY_OPERATOR: UnaryOperatorExpression uoe = (UnaryOperatorExpression) expression; if (uoe.getOperator() == TokenKind.NOT) { return !evalExpression(uoe.getX(), tags); } else { throw new FilterEvaluationException(String.format("Got %s but expected 'not'", uoe.getOperator())); } default: throw new FilterEvaluationException(String.format("Unsupported expression kind: %s", expression.kind())); } }

Target:
private static boolean evalExpression(Expression expression, Set<String> tags) { switch (expression.kind()) { case IDENTIFIER: Identifier ident = (Identifier) expression; return tags.contains(ident.getName()); case BINARY_OPERATOR: BinaryOperatorExpression boe = (BinaryOperatorExpression) expression; switch (boe.getOperator()) { case OR: return evalExpression(boe.getX(), tags) || evalExpression(boe.getY(), tags); case AND: return evalExpression(boe.getX(), tags) && evalExpression(boe.getY(), tags); default: throw new IllegalStateException( String.format("Got %s but expected 'and' or 'or'", boe.getOperator())); } case UNARY_OPERATOR: UnaryOperatorExpression uoe = (UnaryOperatorExpression) expression; if (uoe.getOperator() == TokenKind.NOT) { return !evalExpression(uoe.getX(), tags); } else { throw new IllegalStateException(String.format("Got %s but expected 'not'", uoe.getOperator())); } default: throw new IllegalStateException(String.format("Unsupported expression kind: %s", expression.kind())); } }
Source:
public void should_parse_modern_table() { AggregateParser parser = new AggregateParser(new DataTypeCqlNameParser(), context); AggregateMetadata aggregate = parser.parseAggregate(SUM_AND_TO_STRING_ROW_3_0, KEYSPACE_ID, Collections.emptyMap()); assertThat(aggregate.getKeyspace().asInternal()).isEqualTo("ks"); assertThat(aggregate.getSignature().getName().asInternal()).isEqualTo("sum_and_to_string"); assertThat(aggregate.getSignature().getParameterTypes()).containsExactly(DataTypes.INT); FunctionSignature stateFuncSignature = aggregate.getStateFuncSignature(); assertThat(stateFuncSignature.getName().asInternal()).isEqualTo("plus"); assertThat(stateFuncSignature.getParameterTypes()) .containsExactly(DataTypes.INT, DataTypes.INT); assertThat(aggregate.getStateType()).isEqualTo(DataTypes.INT); Optional<FunctionSignature> finalFuncSignature = aggregate.getFinalFuncSignature(); assertThat(finalFuncSignature).isPresent(); assertThat(finalFuncSignature.get().getName().asInternal()).isEqualTo("to_string"); assertThat(finalFuncSignature.get().getParameterTypes()).containsExactly(DataTypes.INT); assertThat(aggregate.getReturnType()).isEqualTo(DataTypes.TEXT); assertThat(aggregate.getInitCond().get()).isInstanceOf(Integer.class).isEqualTo(0); }

Target:
public void should_parse_modern_table() { AggregateParser parser = new AggregateParser(new DataTypeCqlNameParser(), context); AggregateMetadata aggregate = parser.parseAggregate(SUM_AND_TO_STRING_ROW_3_0, KEYSPACE_ID, Collections.emptyMap()); assertThat(aggregate.getKeyspace().asInternal()).isEqualTo("ks"); assertThat(aggregate.getSignature().getName().asInternal()).isEqualTo("sum_and_to_string"); assertThat(aggregate.getSignature().getParameterTypes()).containsExactly(DataTypes.INT); FunctionSignature stateFuncSignature = aggregate.getStateFuncSignature(); assertThat(stateFuncSignature.getName().asInternal()).isEqualTo("plus"); assertThat(stateFuncSignature.getParameterTypes()) .containsExactly(DataTypes.INT, DataTypes.INT); assertThat(aggregate.getStateType()).isEqualTo(DataTypes.INT); Optional<FunctionSignature> finalFuncSignature = aggregate.getFinalFuncSignature(); assertThat(finalFuncSignature).isPresent(); assertThat(finalFuncSignature) .hasValueSatisfying( signature -> { assertThat(signature.getName().asInternal()).isEqualTo("to_string"); assertThat(signature.getParameterTypes()).containsExactly(DataTypes.INT); }); assertThat(aggregate.getReturnType()).isEqualTo(DataTypes.TEXT); assertThat(aggregate.getInitCond().get()).isInstanceOf(Integer.class).isEqualTo(0); }
Source:
public boolean isNull() { boolean localIsNull = true; if (numElements > 1) { int i; for (i = 0; i < numElements; i++) { if (dvd[i] == null || dvd[i].isNull()) break; } if (i == numElements) localIsNull = false; } setIsNull(localIsNull); return localIsNull; }

Target:
public boolean isNull() { boolean localIsNull = true; int i; for (i = 0; i < numElements; i++) { if (dvd[i] == null || dvd[i].isNull()) break; } if (i == numElements) localIsNull = false; setIsNull(localIsNull); return localIsNull; }
Source:
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { try (final PrintFile printFile = getOutputFile(cl)) { final String tableName = OptUtil.getTableOpt(cl, shellState); if (cl.getArgList().isEmpty()) { throw new MissingArgumentException("No terms specified"); } final Class<? extends Formatter> formatter = getFormatter(cl, tableName, shellState); final ScanInterpreter interpeter = getInterpreter(cl, tableName, shellState); int numThreads = 20; if (cl.hasOption(numThreadsOpt.getOpt())) { numThreads = Integer.parseInt(cl.getOptionValue(numThreadsOpt.getOpt())); } boolean negate = false; if (cl.hasOption(negateOpt.getOpt())) { negate = true; } String profileName = ""; if (cl.hasOption(profileNameOpt.getOpt())) { profileName = cl.getOptionValue(profileNameOpt.getOpt()); } final Authorizations auths = getAuths(cl, shellState); final BatchScanner scanner = shellState.getAccumuloClient().createBatchScanner(tableName, auths, numThreads); scanner.setRanges(Collections.singletonList(getRange(cl, interpeter))); scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS); setupSampling(tableName, cl, shellState, scanner); for (int i = 0; i < cl.getArgs().length; i++) { setUpIterator(Integer.MAX_VALUE - cl.getArgs().length + i, "grep" + i, cl.getArgs()[i], scanner, cl, negate, shellState, profileName); } try { fetchColumns(cl, scanner, interpeter); final FormatterConfig config = new FormatterConfig(); config.setPrintTimestamps(cl.hasOption(timestampOpt.getOpt())); printRecords(cl, shellState, config, scanner, formatter, printFile); } finally { scanner.close(); } } return 0; }

Target:
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { try (final PrintFile printFile = getOutputFile(cl)) { final String tableName = OptUtil.getTableOpt(cl, shellState); if (cl.getArgList().isEmpty()) { throw new MissingArgumentException("No terms specified"); } final Class<? extends Formatter> formatter = getFormatter(cl, tableName, shellState); final ScanInterpreter interpeter = getInterpreter(cl, tableName, shellState); int numThreads = 20; if (cl.hasOption(numThreadsOpt.getOpt())) { numThreads = Integer.parseInt(cl.getOptionValue(numThreadsOpt.getOpt())); } boolean negate = false; if (cl.hasOption(negateOpt.getOpt())) { negate = true; } final Authorizations auths = getAuths(cl, shellState); final BatchScanner scanner = shellState.getAccumuloClient().createBatchScanner(tableName, auths, numThreads); scanner.setRanges(Collections.singletonList(getRange(cl, interpeter))); scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS); setupSampling(tableName, cl, shellState, scanner); addScanIterators(shellState, cl, scanner, ""); for (int i = 0; i < cl.getArgs().length; i++) { setUpIterator(Integer.MAX_VALUE - cl.getArgs().length + i, "grep" + i, cl.getArgs()[i], scanner, cl, negate); } try { fetchColumns(cl, scanner, interpeter); final FormatterConfig config = new FormatterConfig(); config.setPrintTimestamps(cl.hasOption(timestampOpt.getOpt())); printRecords(cl, shellState, config, scanner, formatter, printFile); } finally { scanner.close(); } } return 0; }
Source:
public static PeriodicSchedule of(Collection<SchedulePeriod> periods) { ArgChecker.notEmpty(periods, "periods"); ArrayList<SchedulePeriod> mutable = Lists.newArrayList(periods); mutable.sort(Comparator.naturalOrder()); return new PeriodicSchedule(mutable); }

Target:
public static PeriodicSchedule of(Collection<SchedulePeriod> periods) { ArgChecker.notEmpty(periods, "periods"); ImmutableList<SchedulePeriod> sorted = periods.stream() .sorted(Comparator.naturalOrder()) .collect(Guavate.toImmutableList()); return new PeriodicSchedule(sorted); }
Source:
public void close() throws IOException { closed = true; }

Target:
public void close() { closed = true; }
Source:
private static String findSecretFallback(String xml) { Matcher matcher = Pattern.compile(">\\{(.*)\\}<|>(.*)\\=<").matcher(xml); while(matcher.find()) { String secret = matcher.group(); if(secret.length() > 1) secret = secret.substring(1,secret.length()-1); if ((Secret.decrypt(secret)) != null || SecretBytes.isSecretBytes(secret)) { xml = StringUtils.replace(xml, secret, SECRET_MARKER); } } return xml; }

Target:
private static String findSecretFallback(String xml) { Matcher matcher = SECRET_PATTERN.matcher(xml); while(matcher.find()) { String secret = matcher.group(); if(secret.length() > 1) secret = secret.substring(1,secret.length()-1); if ((Secret.decrypt(secret)) != null || SecretBytes.isSecretBytes(secret)) { xml = StringUtils.replace(xml, secret, SECRET_MARKER); } } return xml; }
Source:
boolean isEmpty() { return (validIndexSegments.isEmpty()); }

Target:
boolean isEmpty() { return validIndexSegments.isEmpty(); }
Source:
public static List<String> getOtherSchemes() { return otherSchemes; }

Target:
private List<String> getOtherSchemes() { return otherSchemes; }
Source:
void emitError(Throwable t) { set(STATE_TERMINATED); if (!isUnsubscribed()) { try { if (!isUnsubscribed()) { subscriber.onError(t); } } catch (Throwable inner) { Exceptions.throwIfFatal(inner); CompositeException composite = new CompositeException(t, inner); RxJavaPlugins.getInstance().getErrorHandler().handleError(composite); } } }

Target:
void emitError(Throwable t) { set(STATE_TERMINATED); if (!isUnsubscribed()) { try { subscriber.onError(t); } catch (Throwable inner) { Exceptions.throwIfFatal(inner); CompositeException composite = new CompositeException(t, inner); RxJavaPlugins.getInstance().getErrorHandler().handleError(composite); } } }
Source:
private void buildStatisticsViewers(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; fTimeRange = timeRange; } else { updateJobs = fUpdateJobsPartial; fTimeRangePartial = timeRange; } for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { aTrace = checkNotNull(aTrace); if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(aTrace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new StatisticsUpdateJob("Statistics update", aTrace, isGlobal, statsMod, this); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }

Target:
private void buildStatisticsViewers(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; fTimeRange = timeRange; } else { updateJobs = fUpdateJobsPartial; fTimeRangePartial = timeRange; } for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { aTrace = checkNotNull(aTrace); if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(aTrace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new StatisticsUpdateJob(Messages.TmfStatisticsView_TmfStatisticsUpdateName, aTrace, isGlobal, statsMod, this); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }