auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Setter(final String fieldLocation, String into, final String fieldName, final String methodName, final String desc, final boolean methodStatic, final String fieldDesc) { this.fieldLocation = ASMUtils.getClass(fieldLocation); into = (into == null) ? fieldLocation : into; this.into = ASMUtils.getClass(into); this.field = ASMUtils.getField(this.fieldLocation, fieldName, fieldDesc); this.name = methodName; this.desc = (desc == null) && this.field != null ? this.field.desc : desc; this.methodStatic = methodStatic; }

Target:
public Setter(final String fieldLocation, String into, final String fieldName, final String methodName, final String desc, final boolean methodStatic, final String fieldDesc) { this.fieldLocation = ASMUtils.getClass(fieldLocation); into = (into == null) ? fieldLocation : into; this.into = ASMUtils.getClass(into); this.field = ASMUtils.getField(this.fieldLocation, fieldName, fieldDesc); this.name = methodName; this.desc = (desc == null && this.field != null) ? this.field.desc : desc; this.methodStatic = methodStatic; }
Source:
private boolean hasValidSignature(SignableSAMLObject samlObject, Saml2AuthenticationToken token) { if (!samlObject.isSigned()) { if (logger.isDebugEnabled()) { logger.debug("SAML object is not signed, no signatures found"); } return false; } final List<X509Certificate> verificationKeys = getVerificationCertificates(token); if (verificationKeys.isEmpty()) { return false; } for (X509Certificate certificate : verificationKeys) { final Credential credential = getVerificationCredential(certificate); try { SignatureValidator.validate(samlObject.getSignature(), credential); if (logger.isDebugEnabled()) { logger.debug("Valid signature found in SAML object:"+samlObject.getClass().getName()); } return true; } catch (SignatureException ignored) { if (logger.isTraceEnabled()) { logger.trace("Signature validation failed with cert:"+certificate.toString(), ignored); } else if (logger.isDebugEnabled()) { logger.debug("Signature validation failed with cert:"+certificate.toString()); } } } return false; }

Target:
private boolean hasValidSignature(SignableSAMLObject samlObject, Saml2AuthenticationToken token) { if (!samlObject.isSigned()) { if (logger.isDebugEnabled()) { logger.debug("SAML object is not signed, no signatures found"); } return false; } List<X509Certificate> verificationKeys = getVerificationCertificates(token); if (verificationKeys.isEmpty()) { return false; } for (X509Certificate certificate : verificationKeys) { Credential credential = getVerificationCredential(certificate); try { SignatureValidator.validate(samlObject.getSignature(), credential); if (logger.isDebugEnabled()) { logger.debug("Valid signature found in SAML object:"+samlObject.getClass().getName()); } return true; } catch (SignatureException ignored) { if (logger.isTraceEnabled()) { logger.trace("Signature validation failed with cert:"+certificate.toString(), ignored); } else if (logger.isDebugEnabled()) { logger.debug("Signature validation failed with cert:"+certificate.toString()); } } } return false; }
Source:
public GeneralEnvelope getOriginalEnvelope() { return GeneralEnvelope.toGeneralEnvelope(JTS.toEnvelope(roiGeom)); }

Target:
public GeneralEnvelope getOriginalEnvelope() { GeneralEnvelope originalEnvelope = super.getOriginalEnvelope(); try { Geometry envIntersection = roiGeom.intersection(JTS.toGeometry(originalEnvelope.toRectangle2D())); envIntersection.setSRID( CRS.lookupEpsgCode(originalEnvelope.getCoordinateReferenceSystem(), false)); return GeneralEnvelope.toGeneralEnvelope(JTS.toEnvelope(envIntersection)); } catch (Exception e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } return originalEnvelope; }
Source:
public BooleanWrapper configure(Object... policyParameters) { super.configure(policyParameters); if (policyParameters[2] == null) { throw new IllegalArgumentException("Scheduler url must be specified"); } schedulerUrl = policyParameters[2].toString(); if (policyParameters[3] == null) { throw new IllegalArgumentException("Credentials must be specified"); } credentials = (byte[]) policyParameters[3]; if (policyParameters[4] == null) { nodeSourceRecoveryTimeout = PAResourceManagerProperties.RM_NODESOURCE_RECOVERY_TIMEOUT.getValueAsInt(); } if (policyParameters[5] == null) { nodeSourceRecoveryTrialsNumber = PAResourceManagerProperties.RM_NODESOURCE_RECOVERY_TRIAL_NUMBER.getValueAsInt(); } return new BooleanWrapper(true); }

Target:
public BooleanWrapper configure(Object... policyParameters) { super.configure(policyParameters); if (policyParameters[2] == null) { throw new IllegalArgumentException("Scheduler url must be specified"); } schedulerUrl = policyParameters[2].toString(); if (policyParameters[3] == null) { throw new IllegalArgumentException("Credentials must be specified"); } credentials = (byte[]) policyParameters[3]; if (policyParameters[4] == null) { schedulerAwarePolicyNodeSourceRecoveryDelay = PAResourceManagerProperties.RM_SCHEDULER_AWARE_POLICY_NODESOURCE_RECOVERY_TIMEOUT.getValueAsLong(); } if (policyParameters[5] == null) { schedulerAwarePolicyNodeSourceRecoveryTrialsNumber = PAResourceManagerProperties.RM_SCHEDULER_AWARE_POLICY_NODESOURCE_RECOVERY_TRIAL_NUMBER.getValueAsInt(); } return new BooleanWrapper(true); }
Source:
public static MetricSet of(Cache cache, String name, String... names) { GuavaCacheMetric metrics = new GuavaCacheMetric(); metrics.putMetrics("averageLoadPenalty", () -> cache.stats().averageLoadPenalty(), name, names); metrics.putMetrics("evictionCount", () -> cache.stats().evictionCount(), name, names); metrics.putMetrics("hitCount", () -> cache.stats().hitCount(), name, names); metrics.putMetrics("hitRate", () -> cache.stats().hitRate(), name, names); metrics.putMetrics("loadCount", () -> cache.stats().loadCount(), name, names); metrics.putMetrics("loadExceptionCount", () -> cache.stats().loadExceptionCount(), name, names); metrics.putMetrics("loadExceptionRate", () -> cache.stats().loadExceptionRate(), name, names); metrics.putMetrics("loadSuccessCount", () -> cache.stats().loadSuccessCount(), name, names); metrics.putMetrics("missCount", () -> cache.stats().missCount(), name, names); metrics.putMetrics("missRate", () -> cache.stats().missRate(), name, names); metrics.putMetrics("requestCount", () -> cache.stats().requestCount(), name, names); metrics.putMetrics("totalLoadTime", () -> cache.stats().totalLoadTime(), name, names); return metrics; }

Target:
public static MetricSet of(Cache cache, String name, String... names) { String basicName = MetricRegistry.name(name, names); GuavaCacheMetric metrics = new GuavaCacheMetric(); metrics.putMetrics(() -> cache.stats().averageLoadPenalty(), basicName, "average", "load", "penalty"); metrics.putMetrics(() -> cache.stats().evictionCount(), basicName, "eviction", "count"); metrics.putMetrics(() -> cache.stats().hitCount(), basicName, "hit", "count"); metrics.putMetrics(() -> cache.stats().hitRate(), basicName, "hit", "rate"); metrics.putMetrics(() -> cache.stats().loadCount(), basicName, "load", "count"); metrics.putMetrics(() -> cache.stats().loadExceptionCount(), basicName, "load", "exception", "count"); metrics.putMetrics(() -> cache.stats().loadExceptionRate(), basicName, "load", "exception", "rate"); metrics.putMetrics(() -> cache.stats().loadSuccessCount(), basicName, "load", "success", "count"); metrics.putMetrics(() -> cache.stats().missCount(), basicName, "miss", "count"); metrics.putMetrics(() -> cache.stats().missRate(), basicName, "miss", "rate"); metrics.putMetrics(() -> cache.stats().requestCount(), basicName, "request", "count"); metrics.putMetrics(() -> cache.stats().totalLoadTime(), basicName, "total", "load", "time"); return metrics; }
Source:
private static ITmfStateValue getCpuStatus(ITmfStateSystemBuilder ssb, int cpuQuark) throws AttributeNotFoundException { int irqQuarks = ssb.getQuarkRelativeAndAdd(cpuQuark, Attributes.IRQS); List<Integer> irqs = ssb.getSubAttributes(irqQuarks, false); for (Integer quark : irqs) { final ITmfStateValue irqState = ssb.queryOngoingState(quark.intValue()); if (irqState.equals(StateValues.CPU_STATUS_IRQ_VALUE)) { return irqState; } } int softIrqQuarks = ssb.getQuarkRelativeAndAdd(cpuQuark, Attributes.SOFT_IRQS); List<Integer> softIrqs = ssb.getSubAttributes(softIrqQuarks, false); for (Integer quark : softIrqs) { final ITmfStateValue softIrqState = ssb.queryOngoingState(quark.intValue()); if (softIrqState.equals(StateValues.CPU_STATUS_SOFTIRQ_VALUE)) { return softIrqState; } } int currentThreadQuark = ssb.getQuarkRelativeAndAdd(cpuQuark, Attributes.CURRENT_THREAD); ITmfStateValue currentThreadState = ssb.queryOngoingState(currentThreadQuark); if (currentThreadState.isNull()) { return TmfStateValue.nullValue(); } int tid = currentThreadState.unboxInt(); if (tid == 0) { return StateValues.CPU_STATUS_IDLE_VALUE; } int threadSystemCallQuark = ssb.getQuarkAbsoluteAndAdd(Attributes.THREADS, Integer.toString(tid), Attributes.SYSTEM_CALL); return (ssb.queryOngoingState(threadSystemCallQuark).isNull() ? StateValues.CPU_STATUS_RUN_USERMODE_VALUE : StateValues.CPU_STATUS_RUN_SYSCALL_VALUE); }

Target:
private static ITmfStateValue getCpuStatus(ITmfStateSystemBuilder ssb, int cpuQuark) throws AttributeNotFoundException { int irqQuarks = ssb.getQuarkRelativeAndAdd(cpuQuark, Attributes.IRQS); List<Integer> irqs = ssb.getSubAttributes(irqQuarks, false); for (Integer quark : irqs) { final ITmfStateValue irqState = ssb.queryOngoingState(quark.intValue()); if (irqState.equals(StateValues.CPU_STATUS_IRQ_VALUE)) { return irqState; } } int softIrqQuarks = ssb.getQuarkRelativeAndAdd(cpuQuark, Attributes.SOFT_IRQS); List<Integer> softIrqs = ssb.getSubAttributes(softIrqQuarks, false); for (Integer quark : softIrqs) { final ITmfStateValue softIrqState = ssb.queryOngoingState(quark.intValue()); if ( 0 != (softIrqState.unboxInt()&StateValues.CPU_STATUS_SOFTIRQ)) { return softIrqState; } } int currentThreadQuark = ssb.getQuarkRelativeAndAdd(cpuQuark, Attributes.CURRENT_THREAD); ITmfStateValue currentThreadState = ssb.queryOngoingState(currentThreadQuark); if (currentThreadState.isNull()) { return TmfStateValue.nullValue(); } int tid = currentThreadState.unboxInt(); if (tid == 0) { return StateValues.CPU_STATUS_IDLE_VALUE; } int threadSystemCallQuark = ssb.getQuarkAbsoluteAndAdd(Attributes.THREADS, Integer.toString(tid), Attributes.SYSTEM_CALL); return (ssb.queryOngoingState(threadSystemCallQuark).isNull() ? StateValues.CPU_STATUS_RUN_USERMODE_VALUE : StateValues.CPU_STATUS_RUN_SYSCALL_VALUE); }
Source:
private final static double[] parseDeprecatedGLString(String GLString) { if ( !GLString.equals(VCFConstants.MISSING_VALUE_v4) ) { String[] strings = GLString.split(","); double[] likelihoodsAsVector = new double[strings.length]; for ( int i = 0; i < strings.length; i++ ) { if ( strings[i].equals(VCFConstants.MISSING_VALUE_v4) ) { return null; } else { likelihoodsAsVector[i] = Double.parseDouble(strings[i]); } } return likelihoodsAsVector; } return null; }

Target:
private final static double[] parseDeprecatedGLString(String GLString) { if ( !GLString.equals(VCFConstants.MISSING_VALUE_v4) ) { String[] strings = GLString.split(","); double[] likelihoodsAsVector = new double[strings.length]; int missing = 0; for ( int i = 0; i < strings.length; i++ ) { if (strings[i].equals(VCFConstants.MISSING_VALUE_v4)) { missing++; } else { likelihoodsAsVector[i] = Double.parseDouble(strings[i]); } } if (missing == 0) { return likelihoodsAsVector; } else if (likelihoodsAsVector.length == missing) { return null; } else { throw new TribbleException("partial missing values for GL field"); } } return null; }
Source:
public Repository openRepository(Project.NameKey name) throws RepositoryNotFoundException { if (isUnreasonableName(name)) { throw new RepositoryNotFoundException("Invalid name: " + name); } final FileKey loc = FileKey.lenient(gitDirOf(name), FS.DETECTED); if (!getProjectName(loc.getFile()).equals(name)) { System.out.println("getProjectName(loc.getFile()): " + getProjectName(loc.getFile())); System.out.println("loc.getFile() : " + loc.getFile()); System.out.println("name : " + name); throw new RepositoryNotFoundException(gitDirOf(name)); } try { return RepositoryCache.open(loc); } catch (IOException e1) { final RepositoryNotFoundException e2; e2 = new RepositoryNotFoundException("Cannot open repository " + name); e2.initCause(e1); throw e2; } }

Target:
public Repository openRepository(Project.NameKey name) throws RepositoryNotFoundException { if (isUnreasonableName(name)) { throw new RepositoryNotFoundException("Invalid name: " + name); } final FileKey loc = FileKey.lenient(gitDirOf(name), FS.DETECTED); if (!getProjectName(loc.getFile()).equals(name)) { throw new RepositoryNotFoundException(gitDirOf(name)); } try { return RepositoryCache.open(loc); } catch (IOException e1) { final RepositoryNotFoundException e2; e2 = new RepositoryNotFoundException("Cannot open repository " + name); e2.initCause(e1); throw e2; } }
Source:
private static HiveColumnStatistics createHiveColumnStatistics( ConnectorSession session, DateTimeZone timeZone, Map<ColumnStatisticType, Block> computedStatistics, Type columnType, long rowCount) { HiveColumnStatistics.Builder result = HiveColumnStatistics.builder(); if (computedStatistics.containsKey(MIN) && computedStatistics.containsKey(MAX)) { setMinMax(session, timeZone, columnType, computedStatistics.get(MIN), computedStatistics.get(MAX), result); } if (computedStatistics.containsKey(NUMBER_OF_DISTINCT_VALUES)) { result.setDistinctValuesCount(BIGINT.getLong(computedStatistics.get(NUMBER_OF_DISTINCT_VALUES), 0)); } if (computedStatistics.containsKey(MAX_VALUE_SIZE_IN_BYTES)) { result.setMaxColumnLength(BIGINT.getLong(computedStatistics.get(MAX_VALUE_SIZE_IN_BYTES), 0)); } if (computedStatistics.containsKey(AVERAGE_VALUE_SIZE_IN_BYTES)) { result.setAverageColumnLength(DOUBLE.getDouble(computedStatistics.get(AVERAGE_VALUE_SIZE_IN_BYTES), 0)); } if (computedStatistics.containsKey(NUMBER_OF_NON_NULL_VALUES)) { result.setNullsCount(rowCount - BIGINT.getLong(computedStatistics.get(NUMBER_OF_NON_NULL_VALUES), 0)); } if (computedStatistics.containsKey(NUMBER_OF_TRUE_VALUES) && computedStatistics.containsKey(NUMBER_OF_NON_NULL_VALUES)) { long numberOfTrue = BIGINT.getLong(computedStatistics.get(NUMBER_OF_TRUE_VALUES), 0); long numberOfNonNullValues = BIGINT.getLong(computedStatistics.get(NUMBER_OF_NON_NULL_VALUES), 0); result.setBooleanStatistics(new BooleanStatistics(OptionalLong.of(numberOfTrue), OptionalLong.of(numberOfNonNullValues - numberOfTrue))); } return result.build(); }

Target:
private static HiveColumnStatistics createHiveColumnStatistics( ConnectorSession session, DateTimeZone timeZone, Map<ColumnStatisticType, Block> computedStatistics, Type columnType, long rowCount) { HiveColumnStatistics.Builder result = HiveColumnStatistics.builder(); verify(computedStatistics.containsKey(MIN_VALUE) == computedStatistics.containsKey(MAX_VALUE)); if (computedStatistics.containsKey(MIN_VALUE)) { setMinMax(session, timeZone, columnType, computedStatistics.get(MIN_VALUE), computedStatistics.get(MAX_VALUE), result); } if (computedStatistics.containsKey(NUMBER_OF_DISTINCT_VALUES)) { result.setDistinctValuesCount(BIGINT.getLong(computedStatistics.get(NUMBER_OF_DISTINCT_VALUES), 0)); } if (computedStatistics.containsKey(NUMBER_OF_NON_NULL_VALUES)) { result.setNullsCount(rowCount - BIGINT.getLong(computedStatistics.get(NUMBER_OF_NON_NULL_VALUES), 0)); } if (computedStatistics.containsKey(NUMBER_OF_TRUE_VALUES) && computedStatistics.containsKey(NUMBER_OF_NON_NULL_VALUES)) { long numberOfTrue = BIGINT.getLong(computedStatistics.get(NUMBER_OF_TRUE_VALUES), 0); long numberOfNonNullValues = BIGINT.getLong(computedStatistics.get(NUMBER_OF_NON_NULL_VALUES), 0); result.setBooleanStatistics(new BooleanStatistics(OptionalLong.of(numberOfTrue), OptionalLong.of(numberOfNonNullValues - numberOfTrue))); } return result.build(); }
Source:
public VSizeIndexedWriter( IOPeon ioPeon, String filenameBase, int maxId ) { this.ioPeon = ioPeon; this.metaFileName = StringUtils.safeFormat("%s.meta", filenameBase); this.headerFileName = StringUtils.safeFormat("%s.header", filenameBase); this.valuesFileName = StringUtils.safeFormat("%s.values", filenameBase); this.maxId = maxId; }

Target:
public VSizeIndexedWriter( IOPeon ioPeon, String filenameBase, int maxId ) { this.ioPeon = ioPeon; this.metaFileName = StringUtils.format("%s.meta", filenameBase); this.headerFileName = StringUtils.format("%s.header", filenameBase); this.valuesFileName = StringUtils.format("%s.values", filenameBase); this.maxId = maxId; }
Source:
public List<RichGroup> convertGroupsToRichGroupsWithAttributes(PerunSession sess, List<Group> groups) throws InternalErrorException { List<RichGroup> richGroups = new ArrayList<>(); for(Group group: groups) richGroups.add(new RichGroup(group, this.getPerunBl().getAttributesManagerBl().getAttributes(sess, group))); return richGroups; }

Target:
public List<RichGroup> convertGroupsToRichGroupsWithAttributes(PerunSession sess, List<Group> groups) throws InternalErrorException { List<RichGroup> richGroups = new ArrayList<>(); for(Group group: groups) { richGroups.add(new RichGroup(group, this.getPerunBl().getAttributesManagerBl().getAttributes(sess, group))); } return richGroups; }
Source:
public String format(Object o) { Annotation anno = (Annotation) o; StringBuilder result = new StringBuilder(); result.append("@" + annotationDef.name); if (anno.fieldValues.size() == 1 && anno.fieldValues.containsKey("value")) { AnnotationFieldType fieldType = annotationDef.fieldTypes.get("value"); result.append('('); result.append(fieldType.format(anno.fieldValues.get(anno.fieldValues.get("value")))); result.append(')'); } else if (anno.fieldValues.size() > 0) { result.append('('); boolean notfirst = false; for (Entry<String, Object> field : anno.fieldValues.entrySet()) { if (notfirst) { result.append(", "); } else { notfirst = true; } result.append(field.getKey() + "="); AnnotationFieldType fieldType = annotationDef.fieldTypes.get(field.getKey()); result.append(fieldType.format(field.getValue())); } result.append(')'); } return result.toString(); }

Target:
public String format(Object o) { Annotation anno = (Annotation) o; return anno.toString(); }
Source:
void removeLogsDirectory() { String logsLocation = getLogsLocation(); logger.info("Removing logs " + logsLocation); while (!org.apache.commons.io.FileUtils.deleteQuietly(new File(logsLocation))) { logger.warn("Could not delete folder " + logsLocation + " retrying"); try { Thread.sleep(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }

Target:
void removeLogsDirectory() { String logsLocation = getLogsLocation(); logger.info("Removing logs " + logsLocation); FileUtils.removeDir(new File(logsLocation)); }
Source:
public int[] getAcceptableTokens() { return new int[] { TokenTypes.LAMBDA, }; }

Target:
public int[] getAcceptableTokens() { return getRequiredTokens(); }
Source:
public List<Annotation> getQualifiers() { return new ArrayList<Annotation>( Arrays.asList(new org.jboss.arquillian.warp.servlet.AfterServlet() { @Override public Class<? extends Annotation> annotationType () { return org.jboss.arquillian.warp.servlet.AfterServlet.class; } } ) ); }

Target:
public List<Annotation> getQualifiers() { return Arrays.asList((Annotation) new org.jboss.arquillian.warp.servlet.AfterServlet() { @Override public Class<? extends Annotation> annotationType () { return org.jboss.arquillian.warp.servlet.AfterServlet.class; } } ); }
Source:
public void assignConsumerForSubscription(Subscription subscription) { logger.info("Creating consumer for {}", subscription.getId()); try { Consumer consumer = consumerFactory.createConsumer(subscription); logger.info("Created consumer for {}", subscription.getId()); backgroundProcess.accept(Signal.of(Signal.SignalType.START, subscription.toSubscriptionName(), consumer)); if (subscription.getState() == PENDING) { subscriptionRepository.updateSubscriptionState(subscription.getTopicName(), subscription.getName(), ACTIVE); } logger.info("Consumer for was added for execution", subscription.getId()); } catch (Exception ex) { logger.warn("Failed to create consumer for subscription {}", subscription.getId(), ex); } }

Target:
public void assignConsumerForSubscription(Subscription subscription) { logger.info("Creating consumer for {}", subscription.getQualifiedName()); try { Consumer consumer = consumerFactory.createConsumer(subscription); logger.info("Created consumer for {}", subscription.getQualifiedName()); backgroundProcess.accept(Signal.of(Signal.SignalType.START, subscription.getQualifiedName(), consumer)); if (subscription.getState() == PENDING) { subscriptionRepository.updateSubscriptionState(subscription.getTopicName(), subscription.getName(), ACTIVE); } logger.info("Consumer for was added for execution", subscription.getQualifiedName()); } catch (Exception ex) { logger.error("Failed to create consumer for subscription {}", subscription.getQualifiedName(), ex); } }
Source:
public void init() { logger.info("initializing CallbackHandler: {}, content: ", _uid, getContent()); if (_batchModeEnabled) { CallbackProcessor callbackProcessorRef = _batchCallbackProcessor.get(); if (callbackProcessorRef != null) { callbackProcessorRef.resetEventQueue(); } else { callbackProcessorRef = new CallbackProcessor(this); if (_batchCallbackProcessor.compareAndSet(null, callbackProcessorRef)) { callbackProcessorRef.start(); } else { callbackProcessorRef.shutdown(); } } } updateNotificationTime(System.nanoTime()); try { NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.INIT); changeContext.setChangeType(_changeType); _ready = true; invoke(changeContext); } catch (Exception e) { String msg = "Exception while invoking init callback for listener:" + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }

Target:
public void init() { logger.info("initializing CallbackHandler: {}, content: ", _uid, getContent()); if (_batchModeEnabled) { CallbackProcessor callbackProcessor = _batchCallbackProcessorRef.get(); if (callbackProcessor != null) { callbackProcessor.resetEventQueue(); } else { callbackProcessor = new CallbackProcessor(this); callbackProcessor.start(); if (!_batchCallbackProcessorRef.compareAndSet(null, callbackProcessor)) { callbackProcessor.shutdown(); } } } updateNotificationTime(System.nanoTime()); try { NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.INIT); changeContext.setChangeType(_changeType); _ready = true; invoke(changeContext); } catch (Exception e) { String msg = "Exception while invoking init callback for listener:" + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }
Source:
protected void log() { final Transaction transaction = TransactionSupport.suspend(); try { try { auditLogDirector.log(this, getAuditLogTypeValue()); } catch (final RuntimeException ex) { log.error("Error during log command: {}. Exception {}", getClass().getName(), ex.getMessage()); log.debug("Exception", ex); } } finally { TransactionSupport.resume(transaction); } }

Target:
protected void log() { final Transaction transaction = TransactionSupport.suspend(); try { auditLogDirector.log(this, getAuditLogTypeValue()); } catch (final RuntimeException ex) { log.error("Error during log command: {}. Exception {}", getClass().getName(), ex.getMessage()); log.debug("Exception", ex); } finally { TransactionSupport.resume(transaction); } }
Source:
public List<WorkflowAction> findAvailableDefaultActionsByContentType(ContentType contentType, User user) throws DotDataException, DotSecurityException { DotPreconditions.isTrue(this.permissionAPI. doesUserHavePermission(contentType, PermissionAPI.PERMISSION_READ, user, true), () -> "User " + user + " cannot read content type " + contentType.name(), DotSecurityException.class); List<WorkflowScheme> schemes = findSchemesForContentType(contentType); if (!hasValidLicense()) { final WorkflowScheme systemWorkflow = schemes.stream() .filter(WorkflowScheme::isSystemWorkflowScheme).findFirst() .orElse(workFlowFactory.findSystemWorkflow()); schemes = new ImmutableList.Builder<WorkflowScheme>().add(systemWorkflow).build(); } return findAvailableDefaultActionsBySchemes(schemes, APILocator.getUserAPI().getSystemUser()); }

Target:
public List<WorkflowAction> findAvailableDefaultActionsByContentType(ContentType contentType, User user) throws DotDataException, DotSecurityException { DotPreconditions.isTrue(this.permissionAPI. doesUserHavePermission(contentType, PermissionAPI.PERMISSION_READ, user, true), () -> "User " + user + " cannot read content type " + contentType.name(), DotSecurityException.class); List<WorkflowScheme> schemes = findSchemesForContentType(contentType); if (!hasValidLicense()) { final WorkflowScheme systemWorkflow = schemes.stream() .filter(WorkflowScheme::isSystem).findFirst() .orElse(workFlowFactory.findSystemWorkflow()); schemes = new ImmutableList.Builder<WorkflowScheme>().add(systemWorkflow).build(); } return findAvailableDefaultActionsBySchemes(schemes, APILocator.getUserAPI().getSystemUser()); }
Source:
public void review(final CertifiedProductSearchDetails listing) { for (CertificationResult cert : listing.getCertificationResults()) { if (cert.isSuccess()) { if (cert.getTestToolsUsed() != null && cert.getTestToolsUsed().size() > 0) { Iterator<CertificationResultTestTool> testToolIter = cert.getTestToolsUsed().iterator(); while (testToolIter.hasNext()) { CertificationResultTestTool testTool = testToolIter.next(); if (!StringUtils.isEmpty(testTool.getTestToolName())) { if (StringUtils.isEmpty(testTool.getTestToolVersion())) { if (listing.getIcs() != null && listing.getIcs().getInherits() != null && listing.getIcs().getInherits().booleanValue()) { listing.getWarningMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getTestToolName(), cert.getNumber())); } else { listing.getErrorMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getTestToolName(), cert.getNumber())); } } } } } } } }

Target:
public void review(final CertifiedProductSearchDetails listing) { for (CertificationResult cert : listing.getCertificationResults()) { if (cert.isSuccess() && cert.getTestToolsUsed() != null && cert.getTestToolsUsed().size() > 0) { for (CertificationResultTestTool testTool : cert.getTestToolsUsed()) { if (!StringUtils.isEmpty(testTool.getTestToolName()) && StringUtils.isEmpty(testTool.getTestToolVersion())) { if (listing.getIcs() != null && listing.getIcs().getInherits() != null && listing.getIcs().getInherits().booleanValue()) { listing.getWarningMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getTestToolName(), cert.getNumber())); } else { listing.getErrorMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getTestToolName(), cert.getNumber())); } } } } } }
Source:
private boolean handleMethodInvocation(Instruction instruction) { boolean isStatic = instruction.opcode == Opcodes.INVOKESTATIC; int arity = isStatic ? instruction.arity() : (instruction.arity() + 1); ProgramState.Pop pop = programState.unstackValue(arity); Preconditions.checkState(pop.values.size() == arity, "Arguments mismatch for INVOKE"); SymbolicValue returnSV = constraintManager.createSymbolicValue(instruction); if (isStatic) { String signature = instruction.fieldOrMethod.completeSignature(); MethodBehavior methodInvokedBehavior = behaviorCache.get(signature); if (methodInvokedBehavior != null && methodInvokedBehavior.isComplete()) { methodInvokedBehavior .happyPathYields() .forEach(yield -> yield.statesAfterInvocation(Lists.reverse(pop.values), Collections.emptyList(), pop.state, () -> returnSV).forEach(ps -> { checkerDispatcher.methodYield = yield; checkerDispatcher.addTransition(ps); checkerDispatcher.methodYield = null; })); methodInvokedBehavior .exceptionalPathYields() .forEach(yield -> yield.statesAfterInvocation( Lists.reverse(pop.values), Collections.emptyList(), pop.state, () -> constraintManager.createExceptionalSymbolicValue(yield.exceptionType())).forEach(ps -> { ps.storeExitValue(); enqueue(new ProgramPoint(exitBlock), ps); })); return true; } } if (instruction.hasReturnValue()) { programState = pop.state; } else { programState = pop.state.stackValue(returnSV); } return false; }

Target:
private boolean handleMethodInvocation(Instruction instruction) { boolean isStatic = instruction.opcode == Opcodes.INVOKESTATIC; int arity = isStatic ? instruction.arity() : (instruction.arity() + 1); ProgramState.Pop pop = programState.unstackValue(arity); Preconditions.checkState(pop.values.size() == arity, "Arguments mismatch for INVOKE"); SymbolicValue returnSV = constraintManager.createSymbolicValue(instruction); if (isStatic) { String signature = instruction.fieldOrMethod.completeSignature(); MethodBehavior methodInvokedBehavior = behaviorCache.get(signature); if (methodInvokedBehavior != null && methodInvokedBehavior.isComplete()) { methodInvokedBehavior .happyPathYields() .forEach(yield -> yield.statesAfterInvocation(Lists.reverse(pop.values), Collections.emptyList(), pop.state, () -> returnSV).forEach(ps -> { checkerDispatcher.methodYield = yield; checkerDispatcher.addTransition(ps); checkerDispatcher.methodYield = null; })); methodInvokedBehavior .exceptionalPathYields() .forEach(yield -> yield.statesAfterInvocation( Lists.reverse(pop.values), Collections.emptyList(), pop.state, () -> constraintManager.createExceptionalSymbolicValue(yield.exceptionType())).forEach(ps -> { ps.storeExitValue(); enqueue(new ProgramPoint(exitBlock), ps); })); return true; } } programState = pop.state; if (instruction.hasReturnValue()) { programState = programState.stackValue(returnSV); } return false; }
Source:
public static <RT> ErrorHandler<RT> get(Logger logger) { return new WarningErrorHandler<RT>(logger); }

Target:
public static <RT> ErrorHandler<RT> get(Logger logger) { return new ExceptionLogHandler<RT>(logger); }
Source:
public static void testComparator() { final LogEntry logEntry1 = new LogEntry(100, LogType.FOUND_IT, "logEntry1 is older than logEntry2"); final LogEntry logEntry2 = new LogEntry(200, LogType.FOUND_IT, "logEntry2 is more recent than logEntry1"); final List<LogEntry> logList = new ArrayList<>(2); logList.add(logEntry1); logList.add(logEntry2); Collections.sort(logList, LogEntry.DESCENDING_DATE_COMPARATOR); assertThat(logList).hasSize(2); assertThat(logList.get(0)).isEqualTo(logEntry2); assertThat(logList.get(1)).isEqualTo(logEntry1); }

Target:
public static void testComparator() { final LogEntry logEntry1 = new LogEntry(100, LogType.FOUND_IT, "logEntry1 is older than logEntry2"); final LogEntry logEntry2 = new LogEntry(200, LogType.FOUND_IT, "logEntry2 is more recent than logEntry1"); final List<LogEntry> logList = new ArrayList<>(2); logList.add(logEntry1); logList.add(logEntry2); Collections.sort(logList, LogEntry.DESCENDING_DATE_COMPARATOR); assertThat(logList).containsExactly(logEntry2, logEntry1); }
Source:
public void testfromSerialized() { TestProperties props = (TestProperties) new TestProperties("test") { @Override public boolean postDeserialize(int version, boolean persistent) { date.setTaggedValue("foo", "bar" + version); return false; } }; props.init(); String s = props.toSerialized(); assertNotEquals("bar", props.date.getTaggedValue("foo")); TestProperties desProp = Properties.Helper.fromSerialized(s, TestProperties.class).object; assertEquals("bar0", desProp.date.getTaggedValue("foo")); }

Target:
public void testfromSerialized() { TestProperties props = (TestProperties) new TestProperties("test") { @Override public boolean postDeserialize(int version, PostDeserializeSetup setup, boolean persistent) { date.setTaggedValue("foo", "bar" + version); return super.postDeserialize(version, setup, persistent); } }; props.init(); String s = props.toSerialized(); assertNull(props.date.getTaggedValue("foo")); TestProperties desProp = Properties.Helper.fromSerializedPersistent(s, TestProperties.class).object; assertEquals("bar0", desProp.date.getTaggedValue("foo")); }
Source:
public void onBecomeStandbyFromLeader(Message message, NotificationContext context) { logger.info("++Becoming STANDBY from LEADER"); }

Target:
public void onBecomeStandbyFromLeader(Message message, NotificationContext context) { logger.info("Becoming STANDBY from LEADER"); }
Source:
public String getUrlForWiki(String wikiName, String language, boolean addWWW, EnvType envType) { final String wikiaName = getWikiaGlobalName(wikiName); String www = ""; if (addWWW) { www = "www."; } String host; HttpUrl.Builder urlBuilder = new HttpUrl.Builder(); switch (envType) { case DEV: { String devBoxOwner = this.env.split("-")[1]; host = String.join(".", www + wikiaName, devBoxOwner, envType.getWikiaDomain()); break; } case PROD: { host = String.join(".", www + wikiaName, envType.getWikiaDomain()); break; } case STAGING: { host = String.join(".", www + wikiaName, envType.getWikiaDomain()); break; } case SANDBOX: { host = String.join(".", www + wikiaName, this.env, envType.getWikiaDomain()); break; } default: throw new WebDriverException("Unknown environment type"); } urlBuilder.scheme(getUrlProtocol()).host(host); if (language != null && !("en").equals(language)) { urlBuilder.addPathSegments(language); } return urlBuilder.build().toString(); }

Target:
public String getUrlForWiki(String wikiName, String language, boolean addWWW, EnvType envType) { final String wikiaName = getWikiaGlobalName(wikiName); if (language == null || wikiName == null) throw new NullPointerException("Wikia name and language are required"); HttpUrl.Builder urlBuilder = new HttpUrl.Builder(); String www = addWWW ? "www." : ""; String host = getFormattedWikiHost(www, wikiaName, envType, language); if (!("en").equals(language) && forceLanguageInPath) { urlBuilder.addEncodedPathSegments(language); } return urlBuilder.scheme(getUrlProtocol()).host(host).build().toString().replaceFirst("/$",""); }
Source:
public void actionPerformed(ActionEvent e) { eventLogger.log(this); final Map<String, String> parameters = e.getParameters(); if (parameters != null && !parameters.isEmpty()) { final ProjectConfigDto dataObject = dtoFactory.createDto(ProjectConfigDto.class); if (parameters.containsKey("projectName")) { dataObject.setName(parameters.get("projectName")); } if (parameters.containsKey("projectType")) { dataObject.setType(parameters.get("projectType")); } else { dataObject.setType("blank"); } wizard.show(dataObject, CREATE); } else { wizard.show(); } }

Target:
public void actionPerformed(ActionEvent e) { eventLogger.log(this); final Map<String, String> parameters = e.getParameters(); if (parameters != null && !parameters.isEmpty()) { final ProjectConfigDto dataObject = dtoFactory.createDto(ProjectConfigDto.class); if (parameters.containsKey("projectName")) { dataObject.setName(parameters.get("projectName")); } if (parameters.containsKey("projectType")) { dataObject.setType(parameters.get("projectType")); } else { dataObject.setType(BLANK_ID); } wizard.show(dataObject, CREATE); } else { wizard.show(); } }
Source:
public void init(FilterConfig filterConfig) throws ServletException { controller = new Controller(); Framework.getRuntime().getComponentManager().addListener(new ComponentManager.LifeCycleHandler() { @Override public void beforeStop(ComponentManager mgr, boolean isStandby) { controller.onStandby(); } @Override public void afterStart(ComponentManager mgr, boolean isResume) { controller.onResumed(); } }); }

Target:
public void init(FilterConfig filterConfig) throws ServletException { controller = new Controller(); new ComponentManager.LifeCycleHandler() { @Override public void beforeStop(ComponentManager mgr, boolean isStandby) { controller.onStandby(); } @Override public void afterStart(ComponentManager mgr, boolean isResume) { controller.onResumed(); } }.install(); }
Source:
public GaussianDistribution asGaussian() { GaussianDistribution gaussian = new GaussianDistribution(this.mean,this.sigma,this.alpha,this.beta,GaussianDistribution.DistributionModel.from_value(this.model_type)); return gaussian; }

Target:
public GaussianDistribution asGaussian() { return new GaussianDistribution(this.mean,this.sigma,this.alpha,this.beta,this.kappa,this.modelType); }
Source:
public static ValueAttributesInfo fromMap(Map<String, String> attributes, Optional<ObjectMapper> mapper) { return mapper.orElseGet(() -> new ObjectMapper()).convertValue(attributes, ValueAttributesInfo.class); }

Target:
public static ValueAttributesInfo fromMap(Map<String, String> attributes, Optional<ObjectMapper> mapper) { return mapper.orElseGet(ObjectMapper::new).convertValue(attributes, ValueAttributesInfo.class); }
Source:
public static String asEqualsPattern(String string) { return StringUtils.isNotEmpty(string) ? String.format("%s", string) : ""; }

Target:
public static String asEqualsPattern(String string) { return StringUtils.defaultString(string); }
Source:
public CreateResponse create(CreateRequest createRequest) throws IngestException, SourceUnavailableException { INGEST_LOGGER.info("Resource ingest has started."); CreateResponse createResponse = doCreate(createRequest); createResponse = doPostIngest(createResponse); INGEST_LOGGER.info("Resource ingest has completed."); return createResponse; }

Target:
public CreateResponse create(CreateRequest createRequest) throws IngestException, SourceUnavailableException { CreateResponse createResponse = doCreate(createRequest); createResponse = doPostIngest(createResponse); return createResponse; }
Source:
private void addOutliers() throws IOException { Configuration conf = new Configuration(); for (Entry<Object, Object> pair : props.entrySet()) { String key = (String) pair.getKey(); conf.set(key, (String) pair.getValue()); } for (Properties jobProps : planner.getOutlierProperties()) { this.executorService.submit(new OutlierCollectorRunner(jobProps, FileSystem.get(conf))); } }

Target:
private void addOutliers() throws IOException { createExecutorService(); List<Future<?>> futures = new ArrayList<Future<?>>(); for (Properties jobProps : planner.getOutlierProperties()) { futures.add(this.executorService.submit(new OutlierCollectorRunner(jobProps, FileSystem.get(getConf())))); } this.executorService.shutdown(); for (Future<?> future : futures) { try { future.get(); } catch (ExecutionException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } } }
Source:
private void assertResultSerializable(Result result) throws IOException, ClassNotFoundException { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); ObjectOutputStream objectoutputstream = new ObjectOutputStream(byteArrayOutputStream); objectoutputstream.writeObject(result); objectoutputstream.flush(); byte[] bytes = byteArrayOutputStream.toByteArray(); ObjectInputStream objectInputStream = new ObjectInputStream(new ByteArrayInputStream(bytes)); Result fromStream = (Result) objectInputStream.readObject(); assertSerializedCorrectly(result, fromStream); InputStream resource = getClass().getResourceAsStream(getName()); assertNotNull("Could not read resource " + getName(), resource); objectInputStream = new ObjectInputStream(resource); fromStream = (Result) objectInputStream.readObject(); assertSerializedCorrectly(new ResultWithFixedRunTime(result), fromStream); }

Target:
private void assertResultSerializable(Result result) throws IOException, ClassNotFoundException { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream); objectOutputStream.writeObject(result); objectOutputStream.flush(); byte[] bytes = byteArrayOutputStream.toByteArray(); ObjectInputStream objectInputStream = new ObjectInputStream(new ByteArrayInputStream(bytes)); Result fromStream = (Result) objectInputStream.readObject(); assertSerializedCorrectly(result, fromStream); InputStream resource = getClass().getResourceAsStream(getName()); assertNotNull("Could not read resource " + getName(), resource); objectInputStream = new ObjectInputStream(resource); fromStream = (Result) objectInputStream.readObject(); assertSerializedCorrectly(new ResultWithFixedRunTime(result), fromStream); }
Source:
private Pool getDevPool(Consumer consumer, String sku) { PoolFilterBuilder poolFilters = new PoolFilterBuilder(); poolFilters.addAttributeFilter(Pool.REQUIRES_CONSUMER_ATTRIBUTE, consumer.getUuid()); Page<List<Pool>> poolsPage = poolManager.listAvailableEntitlementPools(consumer, null, consumer.getOwner(), null, null, true, true, poolFilters, null); if (poolsPage != null && poolsPage.getPageData() != null && poolsPage.getPageData().size() == 1) { return poolsPage.getPageData().get(0); } else { return null; } }

Target:
private Pool getDevPool(Consumer consumer, String sku) { PoolFilterBuilder poolFilters = new PoolFilterBuilder(); poolFilters.addAttributeFilter(Pool.REQUIRES_CONSUMER_ATTRIBUTE, consumer.getUuid()); poolFilters.addAttributeFilter(Pool.DEVELOPMENT_POOL_ATTRIBUTE, "true"); Page<List<Pool>> poolsPage = poolManager.listAvailableEntitlementPools(consumer, null, consumer.getOwner(), null, null, true, true, poolFilters, null); if (poolsPage != null && poolsPage.getPageData() != null && poolsPage.getPageData().size() == 1) { return poolsPage.getPageData().get(0); } else { return null; } }
Source:
public void can_compare_after_writes() { interval = IntervalPersisterTest.createRandomInterval(); interval.close(); persister.save(interval); WatchDogItem savedItem = new ArrayList<>(persister.readItems()) .get(0); assertTrue(savedItem instanceof IntervalBase); IntervalBase savedInterval = (IntervalBase) savedItem; assertEquals(interval.getType(), savedInterval.getType()); assertEquals(interval.getStart(), savedInterval.getStart()); assertEquals(interval.getEnd(), savedInterval.getEnd()); assertEquals(interval.getDuration(), savedInterval.getDuration()); assertEquals(interval.isClosed(), savedInterval.isClosed()); assertEquals(savedInterval.getType(), savedInterval.getType()); assertEquals(savedInterval.getStart(), savedInterval.getStart()); assertEquals(savedInterval.getEnd(), savedInterval.getEnd()); assertEquals(interval.getDuration(), savedInterval.getDuration()); assertEquals(interval.isClosed(), savedInterval.isClosed()); }

Target:
public void can_compare_after_writes() { IntervalBase interval = IntervalPersisterTest.createRandomInterval(); interval.close(); persister.save(interval); WatchDogItem savedItem = new ArrayList<>(persister.readItems()) .get(0); assertTrue(savedItem instanceof IntervalBase); IntervalBase savedInterval = (IntervalBase) savedItem; assertEquals(interval.getType(), savedInterval.getType()); assertEquals(interval.getStart(), savedInterval.getStart()); assertEquals(interval.getEnd(), savedInterval.getEnd()); assertEquals(interval.getDuration(), savedInterval.getDuration()); assertEquals(interval.isClosed(), savedInterval.isClosed()); }
Source:
public static OnmsTopologyVertex create(String id, String label, String address, String iconKey) { return new OnmsTopologyVertex(Objects.requireNonNull(id, "id is null, cannot create vertex"), label, address, iconKey); }

Target:
public static OnmsTopologyVertex create(String id, String label, String address, String iconKey) { Objects.requireNonNull(id, "id is null, cannot create vertex"); return new OnmsTopologyVertex(id, label, address, iconKey); }
Source:
private void firePropertyChange(final PropertyChangeEvent event) { Object[] allListeners = listeners.getListeners(); for (Object allListener : allListeners) { final IPropertyChangeListener listener = (IPropertyChangeListener) allListener; SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { listener.propertyChange(event); } @Override public void handleException(Throwable exception) { } }); } }

Target:
private void firePropertyChange(final PropertyChangeEvent event) { Object[] allListeners = listeners.getListeners(); for (Object l : allListeners) { final IPropertyChangeListener listener = (IPropertyChangeListener)l; SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { listener.propertyChange(event); } @Override public void handleException(Throwable exception) { } }); } }
Source:
public boolean fetch() throws IOException { if (currentOffset >= lastOffset) { return false; } long tempTime = System.currentTimeMillis(); TopicAndPartition topicAndPartition = new TopicAndPartition(kafkaRequest.getTopic(), kafkaRequest.getPartition()); log.debug("\nAsking for offset : " + (currentOffset)); PartitionFetchInfo partitionFetchInfo = new PartitionFetchInfo(currentOffset, fetchBufferSize); HashMap<TopicAndPartition, PartitionFetchInfo> fetchInfo = new HashMap<TopicAndPartition, PartitionFetchInfo>(); fetchInfo.put(topicAndPartition, partitionFetchInfo); FetchRequest fetchRequest = new FetchRequest(CamusJob.getKafkaFetchRequestCorrelationId(context), CamusJob.getKafkaClientName(context), CamusJob.getKafkaFetchRequestMaxWait(context), CamusJob.getKafkaFetchRequestMinBytes(context), fetchInfo); FetchResponse fetchResponse = null; try { fetchResponse = simpleConsumer.fetch(fetchRequest); if (fetchResponse.hasError()) { throw new RuntimeException(); } return processFetchResponse(fetchResponse, tempTime); } catch (Exception e) { log.info("Exception generated during fetch for topic " + kafkaRequest.getTopic() + ". Will refresh topic metadata and retry."); return refreshTopicMetadataAndRetryFetch(fetchRequest, tempTime); } }

Target:
public boolean fetch() throws IOException { if (currentOffset >= lastOffset) { return false; } long tempTime = System.currentTimeMillis(); TopicAndPartition topicAndPartition = new TopicAndPartition(kafkaRequest.getTopic(), kafkaRequest.getPartition()); log.debug("\nAsking for offset : " + (currentOffset)); PartitionFetchInfo partitionFetchInfo = new PartitionFetchInfo(currentOffset, fetchBufferSize); HashMap<TopicAndPartition, PartitionFetchInfo> fetchInfo = new HashMap<TopicAndPartition, PartitionFetchInfo>(); fetchInfo.put(topicAndPartition, partitionFetchInfo); FetchRequest fetchRequest = new FetchRequest(CamusJob.getKafkaFetchRequestCorrelationId(context), CamusJob.getKafkaClientName(context), CamusJob.getKafkaFetchRequestMaxWait(context), CamusJob.getKafkaFetchRequestMinBytes(context), fetchInfo); FetchResponse fetchResponse = null; try { fetchResponse = simpleConsumer.fetch(fetchRequest); if (fetchResponse.hasError()) { String message = "Error Code generated : " + fetchResponse.errorCode(kafkaRequest.getTopic(), kafkaRequest.getPartition()) + "\n"; throw new RuntimeException(message); } return processFetchResponse(fetchResponse, tempTime); } catch (Exception e) { log.info("Exception generated during fetch for topic " + kafkaRequest.getTopic() + ": " + e.getMessage() + ". Will refresh topic metadata and retry."); return refreshTopicMetadataAndRetryFetch(fetchRequest, tempTime); } }
Source:
protected ProcessBuilder createProcessBuilder(String homeDirectory) { ProcessBuilder pb = new ProcessBuilder(homeDirectory + "/bin/storm","logviewer"); File log = new File(homeDirectory + "/logs/logviewer-startup.log"); pb.redirectErrorStream(true); pb.redirectOutput(Redirect.appendTo(log)); return pb; }

Target:
protected ProcessBuilder createProcessBuilder(String homeDirectory) { ProcessBuilder pb = new ProcessBuilder(Paths.get(homeDirectory, "/bin/storm").toString(), "logviewer"); File log = Paths.get(homeDirectory, "/logs/logviewer-startup.log").toFile(); pb.redirectErrorStream(true); pb.redirectOutput(Redirect.appendTo(log)); return pb; }