auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean validateSnapshotDisksArePlugged() { Map<Guid, Disk> vmDisks = diskDao.getAllForVm(getVmId()) .stream() .collect(Collectors.toMap(Disk::getId, Function.identity())); String unpluggedDisks = getSourceImages() .stream() .map(DiskImage::getId) .map(vmDiskId -> vmDisks.getOrDefault(vmDiskId, diskDao.get(vmDiskId))) .filter(disk -> !disk.getPlugged()) .map(Disk::getDiskAlias) .collect(Collectors.joining("\n")); if (!unpluggedDisks.isEmpty()) { return validate(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_UNPLUGGED_OR_UNATTACHED_DISKS, String.format("$diskAliases %s", unpluggedDisks))); } return true; }

Target:
private boolean validateSnapshotDisksArePlugged() { Map<Guid, Disk> vmDisks = diskDao.getAllForVm(getVmId()) .stream() .collect(Collectors.toMap(Disk::getId, Function.identity())); String unpluggedDisks = getSourceImages() .stream() .map(DiskImage::getId) .map(vmDiskId -> vmDisks.getOrDefault(vmDiskId, diskDao.get(vmDiskId))) .filter(disk -> !disk.getPlugged()) .map(Disk::getDiskAlias) .collect(Collectors.joining(System.lineSeparator())); if (!unpluggedDisks.isEmpty()) { return validate(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_UNPLUGGED_OR_UNATTACHED_DISKS, String.format("$diskAliases %s", unpluggedDisks))); } return true; }
Source:
public UUID importSingleCellExperiment(String experimentAccession, boolean isPrivate) throws IOException { checkNotNull(experimentAccession); Optional<String> accessKey = fetchExperimentAccessKey(experimentAccession); CondensedSdrfParserOutput condensedSdrfParserOutput = condensedSdrfParser.parse(experimentAccession, ExperimentType.SINGLE_CELL_RNASEQ_MRNA_BASELINE); IdfParserOutput idfParserOutput = idfParser.newParse(experimentAccession); ExperimentDTO experimentDTO = ExperimentDTO.create( condensedSdrfParserOutput.getExperimentAccession(), ExperimentType.SINGLE_CELL_RNASEQ_MRNA_BASELINE, "homo sapiens", idfParserOutput.getPublications().keySet(), idfParserOutput.getTitle(), isPrivate ); if (accessKey.isPresent()) { deleteExperiment(experimentAccession); } analyticsLoaderFactory .getLoader(ExperimentType.SINGLE_CELL_RNASEQ_MRNA_BASELINE) .loadAnalytics(experimentAccession); UUID accessKeyUuid = accessKey.map(UUID::fromString).orElseGet(UUID::randomUUID); experimentDao.addExperiment(experimentDTO, accessKeyUuid); updateWithNewExperimentDesign(condensedSdrfParserOutput.getExperimentDesign(), experimentDTO); return accessKeyUuid; }

Target:
public UUID importSingleCellExperiment(String experimentAccession, boolean isPrivate) throws IOException { checkNotNull(experimentAccession); Optional<String> accessKey = fetchExperimentAccessKey(experimentAccession); CondensedSdrfParserOutput condensedSdrfParserOutput = condensedSdrfParser.parse(experimentAccession, ExperimentType.SINGLE_CELL_RNASEQ_MRNA_BASELINE); IdfParserOutput idfParserOutput = idfParser.parse(experimentAccession); ExperimentDTO experimentDTO = ExperimentDTO.create( condensedSdrfParserOutput, idfParserOutput, condensedSdrfParserOutput.getSpecies(), isPrivate ); if (accessKey.isPresent()) { deleteExperiment(experimentAccession); } analyticsLoaderFactory .getLoader(ExperimentType.SINGLE_CELL_RNASEQ_MRNA_BASELINE) .loadAnalytics(experimentAccession); UUID accessKeyUuid = accessKey.map(UUID::fromString).orElseGet(UUID::randomUUID); experimentDao.addExperiment(experimentDTO, accessKeyUuid); updateWithNewExperimentDesign(condensedSdrfParserOutput.getExperimentDesign(), experimentDTO); return accessKeyUuid; }
Source:
protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; if (buf.readShort() != HEADER_KEY) { Log.warning(new IllegalArgumentException("Invalid Header")); return null; } int type = buf.readUnsignedByte(); short length = buf.readShort(); if (buf.readableBytes() != length) { Log.warning(new IllegalArgumentException("Packet length error")); return null; } index = buf.readUnsignedShort(); if (type == MSG_LOGIN) { DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, ChannelBuffers.hexDump(buf.readBytes(8)).substring(1)); if (deviceSession != null) { sendAck(channel, type, index); } return null; } else { DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); if (deviceSession == null) { return null; } Position position = decodeInit(deviceSession, buf, type, index); if (type == MSG_GPS || type == MSG_ALARM || type == MSG_STATE || type == MSG_SMS) { return decodeOld(deviceSession, buf, channel, position, type, index); } else if (type == MSG_DOWNLINK) { return decodeDownlink(deviceSession, buf, channel, position, type, index); } else if (type >= MSG_NORMAL && type <= MSG_OBD_CODE) { return decodeNew(deviceSession, buf, position, type, index); } else if (type == MSG_HEARTBEAT && buf.readableBytes() >= 2) { getLastLocation(position, null); decodeStatus(position, buf.readUnsignedShort()); sendAck(channel, type, index); return position; } else { Log.warning(new UnsupportedOperationException()); sendAck(channel, type, index); } } return null; }

Target:
protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; buf.skipBytes(2); int type = buf.readUnsignedByte(); buf.readShort(); int index = buf.readUnsignedShort(); if (type != MSG_GPS && type != MSG_DATA) { sendResponse(channel, type, index); } if (type == MSG_LOGIN) { getDeviceSession(channel, remoteAddress, ChannelBuffers.hexDump(buf.readBytes(8)).substring(1)); } else { DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); if (deviceSession == null) { return null; } if (type == MSG_GPS || type == MSG_ALARM || type == MSG_STATE || type == MSG_SMS) { return decodeOld(deviceSession, buf, type, index); } else if (type >= MSG_NORMAL && type <= MSG_OBD_CODE) { return decodeNew(deviceSession, buf, index); } else if (type == MSG_HEARTBEAT && buf.readableBytes() >= 2) { Position position = new Position(); position.setDeviceId(deviceSession.getDeviceId()); position.setProtocol(getProtocolName()); getLastLocation(position, null); decodeStatus(position, buf.readUnsignedShort()); return position; } } return null; }
Source:
private Query buildAssignedToMeQuery() { boolean hasStatus = false; List<TaskStatus> statuses = queryCriteria.getStatuses(); if (statuses != null && !statuses.isEmpty()) { hasStatus = true; } boolean hasTaskName = false; if (!StringUtils.isEmpty(queryCriteria.getTaskName())) { hasTaskName = true; } Query assignedToMeQuery = em.createQuery(SELECT_DISTINCT_TASKS + JOIN_HUMAN_ROLES_JOIN_ORG_ENTITIES + "LOWER(oe.name) = :name " + AND + HR_TYPE_ROLE_TYPE + AND + T_TENANT_ID_TENANT_ID + AND + T_TYPE_TASK_TYPE + (hasTaskName ? AND + FILTER_BY_TASKNAME : "") + AND + T_STATUS_IN_TASK_STATUSES + generateOrderedByQuery()).setMaxResults(queryCriteria.getPageSize()).setFirstResult(queryCriteria .getPageSize() * queryCriteria.getPageNumber()); assignedToMeQuery.setParameter(TENANT_ID, queryCriteria.getCallerTenantId()); assignedToMeQuery.setParameter("name", queryCriteria.getCaller().toLowerCase()); assignedToMeQuery.setParameter(TASK_TYPE, TaskType.TASK); assignedToMeQuery.setParameter(ROLE_TYPE, GenericHumanRoleDAO.GenericHumanRoleType.ACTUAL_OWNER); if (hasStatus) { assignedToMeQuery.setParameter(TASK_STATUSES, statuses); } else { List<TaskStatus> statusList = Arrays.asList(TaskStatus.RESERVED, TaskStatus.IN_PROGRESS, TaskStatus.SUSPENDED); assignedToMeQuery.setParameter(TASK_STATUSES, statusList); } if (hasTaskName) { assignedToMeQuery.setParameter(TASK_NAME, queryCriteria.getTaskName()); } return assignedToMeQuery; }

Target:
private Query buildAssignedToMeQuery() { boolean hasStatus = false; List<TaskStatus> statuses = queryCriteria.getStatuses(); if (statuses != null && !statuses.isEmpty()) { hasStatus = true; } boolean hasTaskName = false; if (!StringUtils.isEmpty(queryCriteria.getTaskName())) { hasTaskName = true; } Query assignedToMeQuery = em.createQuery(SELECT_DISTINCT_TASKS + JOIN_HUMAN_ROLES_JOIN_ORG_ENTITIES + "LOWER(oe.name) = LOWER(:name) " + AND + HR_TYPE_ROLE_TYPE + AND + T_TENANT_ID_TENANT_ID + AND + T_TYPE_TASK_TYPE + (hasTaskName ? AND + FILTER_BY_TASKNAME : "") + AND + T_STATUS_IN_TASK_STATUSES + generateOrderedByQuery()).setMaxResults(queryCriteria.getPageSize()).setFirstResult(queryCriteria .getPageSize() * queryCriteria.getPageNumber()); assignedToMeQuery.setParameter(TENANT_ID, queryCriteria.getCallerTenantId()); assignedToMeQuery.setParameter("name", queryCriteria.getCaller()); assignedToMeQuery.setParameter(TASK_TYPE, TaskType.TASK); assignedToMeQuery.setParameter(ROLE_TYPE, GenericHumanRoleDAO.GenericHumanRoleType.ACTUAL_OWNER); if (hasStatus) { assignedToMeQuery.setParameter(TASK_STATUSES, statuses); } else { List<TaskStatus> statusList = Arrays.asList(TaskStatus.RESERVED, TaskStatus.IN_PROGRESS, TaskStatus.SUSPENDED); assignedToMeQuery.setParameter(TASK_STATUSES, statusList); } if (hasTaskName) { assignedToMeQuery.setParameter(TASK_NAME, queryCriteria.getTaskName()); } return assignedToMeQuery; }
Source:
private void verifyForbiddenRequest() { final ArgumentCaptor<Response> responseCaptor = ArgumentCaptor.forClass(Response.class); verify(containerRequestContext).abortWith(responseCaptor.capture()); final Response response = responseCaptor.getValue(); assertThat(response.getStatus(), is(Status.UNAUTHORIZED.getStatusCode())); assertThat( response.getStatusInfo().getReasonPhrase(), StringContains.containsString("5 minutes")); assertThat(response.getStatusInfo().getReasonPhrase(), StringContains.containsString(BAN_ID)); }

Target:
private void verifyForbiddenRequest() { final ArgumentCaptor<Response> responseCaptor = ArgumentCaptor.forClass(Response.class); verify(containerRequestContext).abortWith(responseCaptor.capture()); final Response response = responseCaptor.getValue(); assertThat(response.getStatus(), is(Status.UNAUTHORIZED.getStatusCode())); assertThat(response.getStatusInfo().getReasonPhrase(), containsString("5 minutes")); assertThat(response.getStatusInfo().getReasonPhrase(), containsString(BAN_ID)); }
Source:
public static TaskTimer getTimer(IConfiguration config) throws Exception { TaskTimer timer = CronTimer.getCronTimer(JOBNAME, config.getBackupCronExpression()); if (timer == null) { Set<Path> backupPaths = AbstractBackup.getBackupDirectories(config, SNAPSHOT_FOLDER); for (Path backupDirPath : backupPaths) try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(backupDirPath, path -> Files.isDirectory(path))) { for (Path backupDir : directoryStream) { if (isValidBackupDir(backupDir)) { FileUtils.cleanDirectory(backupDir.toFile()); } } } } return timer; }

Target:
public static TaskTimer getTimer(IConfiguration config) throws Exception { TaskTimer timer = CronTimer.getCronTimer(JOBNAME, config.getBackupCronExpression()); if (timer == null) { cleanOldBackups(config); } return timer; }
Source:
public void testFormat() { DecimalType dt1 = new DecimalType("87"); assertEquals("87", dt1.format("%d")); DecimalType dt2 = new DecimalType("87"); assertEquals(" 87", dt2.format("%3d")); DecimalType dt3 = new DecimalType("87"); assertEquals("0x57", dt3.format("%#x")); DecimalType dt4 = new DecimalType("87.5"); try { dt4.format("%x"); fail(); } catch (Exception e) { } DecimalType dt5 = new DecimalType("11.123"); dt5.format("%.1f"); DecimalType dt6 = new DecimalType("11"); dt6.format("%.1f"); }

Target:
public void testFormat() { DecimalType dt1 = new DecimalType("87"); assertEquals("87", dt1.format("%d")); DecimalType dt2 = new DecimalType("87"); assertEquals(" 87", dt2.format("%3d")); DecimalType dt3 = new DecimalType("87"); assertEquals("0x57", dt3.format("%#x")); DecimalType dt4 = new DecimalType("87.5"); try { dt4.format("%x"); fail(); } catch (Exception e) { } final char sep = (new DecimalFormatSymbols().getDecimalSeparator()); DecimalType dt5 = new DecimalType("11.123"); assertEquals("11" + sep + "1", dt5.format("%.1f")); DecimalType dt6 = new DecimalType("11"); assertEquals("11" + sep + "0", dt6.format("%.1f")); }
Source:
private byte[] decrypt(final byte[] bytes) throws IOException { try { final Cipher cipher = Cipher.getInstance(ALGORITHM); final AlgorithmParameterSpec spec = new IvParameterSpec(this.ivbytes); cipher.init(Cipher.DECRYPT_MODE, this.secret, spec); return cipher.doFinal(bytes); } catch (final InvalidKeyException ike) { throw new IOException(ike); } catch (final NoSuchAlgorithmException nse) { throw new IOException(nse); } catch (final NoSuchPaddingException nspe) { throw new IOException(nspe); } catch (final InvalidAlgorithmParameterException iape) { throw new IOException(iape); } catch (final IllegalBlockSizeException ibse) { throw new IOException(ibse); } catch (final BadPaddingException bpe) { throw new IOException(bpe); } }

Target:
private byte[] decrypt(final byte[] bytes) throws IOException { try { return this.dec.doFinal(bytes); } catch (final GeneralSecurityException gse) { throw new IOException(gse); } }
Source:
public void testCallsiteAnalysis() { CallsiteAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(fTrace, CallsiteAnalysis.class, CallsiteAnalysis.ID); assertNotNull(module); assertTrue(module.schedule().isOK()); assertTrue(module.waitForCompletion()); String uuid = String.valueOf(fTrace.getUUID()); List<@NonNull ITmfCallsite> cs = module.getCallsites(uuid, "0", 42); assertEquals(EXPECTED, cs); assertEquals(Collections.emptyList(), module.getCallsites("Hello", "0", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, "1", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, "0", 12)); assertEquals(EXPECTED, module.getCallsites(uuid, "0", 55)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, "..", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, "..", 42)); }

Target:
public void testCallsiteAnalysis() { TmfXmlKernelTraceStub trace = fTrace; assertNotNull(trace); CallsiteAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallsiteAnalysis.class, CallsiteAnalysis.ID); assertNotNull(module); assertTrue(module.schedule().isOK()); assertTrue(module.waitForCompletion()); String uuid = String.valueOf(fTrace.getUUID()); List<@NonNull ITmfCallsite> cs = module.getCallsites(uuid, "0", 42); assertEquals(EXPECTED, cs); assertEquals(Collections.emptyList(), module.getCallsites("Hello", "0", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, "1", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, "0", 12)); assertEquals(EXPECTED, module.getCallsites(uuid, "0", 55)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, "..", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, "..", 42)); }
Source:
public void throwsExceptionForNameLength() throws Exception { final String alias = "bill1"; final Aliases aliases = new DyBase().user(new URN("urn:test:840919")).aliases(); aliases.add(alias); final Inbox inbox = aliases.iterate().iterator().next().inbox(); final Bout bout = inbox.bout(inbox.start()); final Attachments attachments = bout.attachments(); final String name = "a"; try { attachments.create(name); } catch (final Attachments.InvalidNameException ex) { MatcherAssert.assertThat( ex.getMessage(), Matchers.equalTo( String.format( "invalid attachment name length \"%s\". %s%s", name, "The length of the attachment name must be ", "between 3-100 characters" ) ) ); } }

Target:
public void throwsExceptionForNameLength() throws Exception { final String alias = "bill1"; final Aliases aliases = new DyBase().user(new URN("urn:test:840919")).aliases(); aliases.add(alias); final Inbox inbox = aliases.iterate().iterator().next().inbox(); final Bout bout = inbox.bout(inbox.start()); final Attachments attachments = bout.attachments(); final String name = "a"; try { attachments.create(name); Assert.fail("The character length exeption was not thrown"); } catch (final Attachments.InvalidNameException ex) { MatcherAssert.assertThat( ex.getMessage(), Matchers.equalTo( String.format( "invalid attachment name length \"%s\". %s%s", name, "The length of the attachment name must be ", "between 3-100 characters" ) ) ); } }
Source:
public String getIdentificationString() { return "feedbackResponseId" + "createdAt" + "giverEmail"; }

Target:
public String getIdentificationString() { return feedbackResponseId + "/" + createdAt + ":" + commentGiver; }
Source:
private static int convertAvroLogicialType(LogicalType logicalType) { int sqlType = Types.NULL; if(logicalType == LogicalTypes.timestampMillis()){ sqlType = Types.TIMESTAMP; } else if (logicalType instanceof LogicalTypes.Decimal){ sqlType = Types.DOUBLE; } else if (logicalType == LogicalTypes.date()){ sqlType = Types.DATE; } else if(logicalType == LogicalTypes.uuid()){ sqlType = Types.VARCHAR; } else if(logicalType == LogicalTypes.timestampMicros()){ sqlType = Types.TIMESTAMP; } else if(logicalType == LogicalTypes.timeMillis()){ sqlType = Types.NUMERIC; } else if(logicalType == LogicalTypes.timeMicros()){ sqlType = Types.NUMERIC; } else{ throw new UnsupportedOperationException("Logicial type "+logicalType+" not supported"); } return sqlType; }

Target:
private int convertAvroLogicialType(LogicalType logicalType) { Integer sqlType = this.config.CONVERT_LOGICALTYPE_TO_SQLTYPE.get(logicalType); if(sqlType != null){ return sqlType; } if (logicalType == LogicalTypes.timestampMillis()) { sqlType = Types.TIMESTAMP; } else if (logicalType instanceof LogicalTypes.Decimal) { sqlType = Types.DOUBLE; } else if (logicalType == LogicalTypes.date()) { sqlType = Types.DATE; } else if (logicalType == LogicalTypes.uuid()) { sqlType = Types.VARCHAR; } else if (logicalType == LogicalTypes.timestampMicros()) { sqlType = Types.TIMESTAMP; } else if (logicalType == LogicalTypes.timeMillis()) { sqlType = Types.NUMERIC; } else if (logicalType == LogicalTypes.timeMicros()) { sqlType = Types.NUMERIC; } else { throw new UnsupportedOperationException("Logicial type " + logicalType + " not supported"); } return sqlType; }
Source:
private void testUpdateCourse() throws Exception { ______TS("Invalid time zone"); CourseAttributes c = CourseAttributes .builder("Computing101-getthis", "Basic Computing Getting", ZoneId.of("UTC")) .build(); coursesDb.createEntity(c); String invalidTimeZone = "Invalid Timezone"; try { coursesLogic.updateCourse(c.getId(), c.getName(), invalidTimeZone); signalFailureToDetectException(); } catch (InvalidParametersException e) { String expectedErrorMessage = getPopulatedErrorMessage( FieldValidator.COURSE_TIME_ZONE_ERROR_MESSAGE, invalidTimeZone, FieldValidator.COURSE_TIME_ZONE_FIELD_NAME, FieldValidator.REASON_UNAVAILABLE_AS_CHOICE); assertEquals(expectedErrorMessage, e.getMessage()); } }

Target:
private void testUpdateCourse() throws Exception { CourseAttributes c = CourseAttributes .builder("Computing101-getthis", "Basic Computing Getting", ZoneId.of("UTC")) .build(); coursesDb.createEntity(c); ______TS("Typical case"); String newName = "New Course Name"; String validTimeZone = "Asia/Singapore"; coursesLogic.updateCourse(c.getId(), newName, validTimeZone); c.setName(newName); c.setTimeZone(ZoneId.of(validTimeZone)); verifyPresentInDatastore(c); ______TS("Invalid time zone and name"); String emptyName = ""; String invalidTimeZone = "Invalid Timezone"; try { coursesLogic.updateCourse(c.getId(), emptyName, invalidTimeZone); signalFailureToDetectException(); } catch (InvalidParametersException e) { String expectedErrorMessage = getPopulatedEmptyStringErrorMessage( FieldValidator.SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE_EMPTY_STRING, FieldValidator.COURSE_NAME_FIELD_NAME, FieldValidator.COURSE_NAME_MAX_LENGTH) + System.lineSeparator() + getPopulatedErrorMessage( FieldValidator.COURSE_TIME_ZONE_ERROR_MESSAGE, invalidTimeZone, FieldValidator.COURSE_TIME_ZONE_FIELD_NAME, FieldValidator.REASON_UNAVAILABLE_AS_CHOICE); assertEquals(expectedErrorMessage, e.getMessage()); verifyPresentInDatastore(c); } }
Source:
public int getPid() { ITmfEventField pidContext = this.getContent().getField("context._pid"); if (null != pidContext) { return ((Integer) pidContext.getValue()).intValue(); } ITmfStateSystem ss = getTrace().getStateSystem(CtfKernelTrace.STATE_ID); int retVal = -1; try { int threadNode = ss.getQuarkAbsolute(Attributes.CPUS, String.valueOf(getCPU()), Attributes.CURRENT_THREAD); ITmfStateValue sv = ss.querySingleState(this.getTimestamp().getValue(), threadNode).getStateValue(); retVal = Math.max(0, sv.unboxInt()); } catch (AttributeNotFoundException e) { } catch (TimeRangeException e) { e.printStackTrace(); } catch (StateSystemDisposedException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } return retVal; }

Target:
public int getPid() { ITmfEventField pidContext = this.getContent().getField("context._pid"); if (null != pidContext) { return ((Integer) pidContext.getValue()).intValue(); } ITmfStateSystem ss = getTrace().getStateSystem(CtfKernelTrace.STATE_ID); int retVal = -1; try { int threadNode = ss.getQuarkAbsolute(Attributes.CPUS, String.valueOf(getCPU()), Attributes.CURRENT_THREAD); ITmfStateValue sv = ss.querySingleState(this.getTimestamp().getValue(), threadNode).getStateValue(); retVal = Math.max(0, sv.unboxInt()); } catch (AttributeNotFoundException e) { } catch (TimeRangeException e) { } catch (StateSystemDisposedException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } return retVal; }
Source:
private void changeServerState(String host, String server, ServerState serverState, boolean serverShouldBeVisible, boolean buttonShouldBeVisible) throws Exception { boolean buttonVisibility = true; boolean serverVisibility = true; FinderNavigation navigation = new FinderNavigation(browser, DomainRuntimeEntryPoint.class, 100) .addAddress(FinderNames.BROWSE_DOMAIN_BY, FinderNames.HOSTS) .addAddress(FinderNames.HOST, host) .addAddress(FinderNames.SERVER, server); try { navigation.selectRow().invoke(serverState.splitButtonOption); Console.withBrowser(browser).openedWindow(ConfirmationWindow.class).confirm().assertClosed(); Console.withBrowser(browser).waitUntilLoaded(); } catch (NoSuchElementException ex) { buttonVisibility = false; } catch (TimeoutException ex) { serverVisibility = false; } assertEquals("Server '" + server + "' of host '" + host + "' visibility was '" + serverVisibility + "' but should be '" + serverShouldBeVisible + "'.", serverShouldBeVisible, serverVisibility); if (serverShouldBeVisible) { assertEquals("Missing " + serverState.splitButtonOption + " option for server '" + server + "' of host '" + host + "'.", buttonShouldBeVisible, buttonVisibility); if (buttonShouldBeVisible) { Address address = ops.getServerAddress(host, server); new ResourceVerifier(address, client, 4000).verifyAttribute("server-state", serverState.attrValue); } } }

Target:
private void changeServerState(String host, String server, ServerState serverState, boolean serverShouldBeVisible, boolean buttonShouldBeVisible) throws Exception { boolean buttonVisibility = true; boolean serverVisibility = true; FinderNavigation navigation = new FinderNavigation(browser, DomainRuntimeEntryPoint.class, 100) .addAddress(FinderNames.BROWSE_DOMAIN_BY, FinderNames.HOSTS) .addAddress(FinderNames.HOST, host) .addAddress(FinderNames.SERVER, server); try { navigation.selectRow().invoke(serverState.uiOption); Console.withBrowser(browser).openedWindow(ConfirmationWindow.class).confirm().assertClosed(); Console.withBrowser(browser).waitUntilLoaded(); } catch (NoSuchElementException ex) { buttonVisibility = false; } catch (TimeoutException ex) { serverVisibility = false; } assertEquals("Server '" + server + "' of host '" + host + "' visibility was '" + serverVisibility + "' but should be '" + serverShouldBeVisible + "'.", serverShouldBeVisible, serverVisibility); if (serverShouldBeVisible) { assertEquals("Missing " + serverState.uiOption + " option for server '" + server + "' of host '" + host + "'.", buttonShouldBeVisible, buttonVisibility); if (buttonShouldBeVisible) { Address address = ops.getServerAddress(host, server); new ResourceVerifier(address, client, ResourceVerifier.LONG_TIMEOUT) .verifyAttribute(Constants.SERVER_STATE, serverState.dmrAttrValue); } } }
Source:
private Object handleJoinPoint(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.bulkhead.Bulkhead bulkhead, String methodName) throws Throwable { BulkheadUtils.isCallPermitted(bulkhead); try { return proceedingJoinPoint.proceed(); } catch (Throwable throwable) { if (logger.isDebugEnabled()) { logger.debug("Invocation of method '" + methodName + "' failed!", throwable); } throw throwable; } finally { bulkhead.onComplete(); } }

Target:
private Object handleJoinPoint(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.bulkhead.Bulkhead bulkhead, String methodName) throws Throwable { if (logger.isDebugEnabled()) { logger.debug("bulkhead method invocation for method {}", methodName); } return bulkhead.executeCheckedSupplier(proceedingJoinPoint::proceed); }
Source:
public Object getUserId() { return eventData.get("user_id"); }

Target:
public String getUserId() { return (String)eventData.get("user_id"); }
Source:
public static Sessions map(org.ovirt.engine.core.common.businessentities.VM vm, Sessions sessions) { if (sessions == null) { sessions = new Sessions(); } mapConsoleSession(vm, sessions); mapGusetSessions(vm, sessions); return sessions; }

Target:
public static Sessions map(org.ovirt.engine.core.common.businessentities.VM vm, Sessions sessions) { if (sessions == null) { sessions = new Sessions(); } mapConsoleSession(vm, sessions); mapGuestSessions(vm, sessions); return sessions; }
Source:
public T setFillGradient(final Type type, final String startColor, final String endColor) { this.fillGradientType = type; this.fillGradientStartColor = startColor; this.fillGradientEndColor = endColor; if (null != getShape()) { final BoundingBox bb = getShape().getBoundingBox(); textViewDecorator.setTextBoundaries(bb); final double width = bb.getWidth(); final double height = bb.getHeight(); updateFillGradient(width, height); } return cast(); }

Target:
public T setFillGradient(final Type type, final String startColor, final String endColor) { this.fillGradientType = type; this.fillGradientStartColor = startColor; this.fillGradientEndColor = endColor; if (null != getShape()) { final BoundingBox bb = getShape().getBoundingBox(); final double width = bb.getWidth(); final double height = bb.getHeight(); updateFillGradient(width, height); } return cast(); }
Source:
private static int methodDeclarationLine(ExplodedGraph.Node methodInvocationNode) { return ((MethodInvocationTree) methodInvocationNode.programPoint.syntaxTree()).symbol().declaration().firstToken().line(); }

Target:
private static int methodDeclarationLine(ExplodedGraph.Node methodInvocationNode) { MethodTree method = (MethodTree) ((MethodInvocationTree) methodInvocationNode.programPoint.syntaxTree()).symbol().declaration(); return method.simpleName().identifierToken().line(); }
Source:
public String toString() { return "Proguard File"; }

Target:
public String toString() { return "ProGuard File"; }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("_id", _id) .add("_type", _type) .add("_address", _address) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", _id) .add("type", _type) .add("address", _address) .toString(); }
Source:
public static boolean downloadUpdatedBlob(Map<String, Object> conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos) throws TTransportException { ClientBlobStore remoteBlobStore; InputStreamWithMeta in; AtomicOutputStream out; boolean isSuccess = false; LOG.debug("Download blob NimbusInfos {}", nimbusInfos); for (NimbusInfo nimbusInfo : nimbusInfos) { if (isSuccess) { break; } try (NimbusClient client = new NimbusClient(conf, nimbusInfo.getHost(), nimbusInfo.getPort(), null)) { remoteBlobStore = new NimbusBlobStore(); remoteBlobStore.setClient(conf, client); in = remoteBlobStore.getBlob(key); out = blobStore.updateBlob(key, getNimbusSubject()); byte[] buffer = new byte[2048]; int len = 0; while ((len = in.read(buffer)) > 0) { out.write(buffer, 0, len); } if (out != null) { out.close(); } isSuccess = true; } catch(FileNotFoundException fnf) { LOG.warn("FileNotFoundException", fnf); } catch (IOException | AuthorizationException exception) { throw new RuntimeException(exception); } catch (KeyNotFoundException knf) { LOG.info("KeyNotFoundException", knf); } catch (Exception exp) { LOG.error("Exception", exp); } } if (!isSuccess) { LOG.error("Could not update the blob with key: {}", key); } return isSuccess; }

Target:
public static boolean downloadUpdatedBlob(Map<String, Object> conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos) throws TTransportException { ClientBlobStore remoteBlobStore; InputStreamWithMeta in; AtomicOutputStream out; boolean isSuccess = false; LOG.debug("Download blob NimbusInfos {}", nimbusInfos); for (NimbusInfo nimbusInfo : nimbusInfos) { if (isSuccess) { break; } try (NimbusClient client = new NimbusClient(conf, nimbusInfo.getHost(), nimbusInfo.getPort(), null)) { remoteBlobStore = new NimbusBlobStore(); remoteBlobStore.setClient(conf, client); in = remoteBlobStore.getBlob(key); out = blobStore.updateBlob(key, getNimbusSubject()); byte[] buffer = new byte[2048]; int len = 0; while ((len = in.read(buffer)) > 0) { out.write(buffer, 0, len); } if (out != null) { out.close(); } isSuccess = true; } catch(FileNotFoundException fnf) { LOG.warn("Blobstore file for key '{}' does not exist or got deleted before it could be downloaded.", key, fnf); } catch (IOException | AuthorizationException exception) { throw new RuntimeException(exception); } catch (KeyNotFoundException knf) { LOG.info("KeyNotFoundException", knf); } catch (Exception exp) { LOG.error("Exception", exp); } } if (!isSuccess) { LOG.error("Could not update the blob with key: {}", key); } return isSuccess; }
Source:
public void start(Duration monitoringInterval) { sequencerBootstrap(serverContext); detectionTasksScheduler.scheduleAtFixedRate( this::runDetectionTasks, 0, monitoringInterval.toMillis(), TimeUnit.MILLISECONDS ); }

Target:
public void start(Duration monitoringInterval) { sequencerBootstrap(serverContext); detectionTasksScheduler.scheduleAtFixedRate( () -> LambdaUtils.runSansThrow(this::runDetectionTasks), 0, monitoringInterval.toMillis(), TimeUnit.MILLISECONDS ); }
Source:
private void exerciseVisitor( Function<Object, DbStructureVisitor> visitor ) { visitor.apply( null ).visitLabel( 0, "Person" ); visitor.apply( null ).visitLabel( 1, "Party" ); visitor.apply( null ).visitPropertyKey( 0, "name" ); visitor.apply( null ).visitPropertyKey( 1, "age" ); visitor.apply( null ).visitRelationshipType( 0, "ACCEPTS" ); visitor.apply( null ).visitRelationshipType( 1, "REJECTS" ); visitor.apply( null ).visitIndex( NewIndexDescriptorFactory.forLabel( 0, 1 ), ":Person(age)", 0.5d, 1L ); visitor.apply( null ).visitUniqueIndex( NewIndexDescriptorFactory.forLabel( 0, 0 ), ":Person(name)", 0.5d, 1L ); final int[] propertyKeyIds = new int[]{0}; visitor.apply( null ).visitUniqueConstraint( new UniquenessConstraint( SchemaDescriptorFactory.forLabel( 1, propertyKeyIds ) ), ":Party(name)" ); visitor.apply( null ).visitAllNodesCount( 55 ); visitor.apply( null ).visitNodeCount( 0, "Person", 50 ); visitor.apply( null ).visitNodeCount( 0, "Party", 5 ); visitor.apply( null ).visitRelCount( 0, 1, -1, "MATCH (:Person)-[:REJECTS]->() RETURN count(*)", 5 ); }

Target:
private void exerciseVisitor( Function<Object, DbStructureVisitor> visitor ) { visitor.apply( null ).visitLabel( 0, "Person" ); visitor.apply( null ).visitLabel( 1, "Party" ); visitor.apply( null ).visitPropertyKey( 0, "name" ); visitor.apply( null ).visitPropertyKey( 1, "age" ); visitor.apply( null ).visitRelationshipType( 0, "ACCEPTS" ); visitor.apply( null ).visitRelationshipType( 1, "REJECTS" ); visitor.apply( null ).visitIndex( NewIndexDescriptorFactory.forLabel( 0, 1 ), ":Person(age)", 0.5d, 1L ); visitor.apply( null ).visitUniqueIndex( NewIndexDescriptorFactory.forLabel( 0, 0 ), ":Person(name)", 0.5d, 1L ); visitor.apply( null ).visitUniqueConstraint( new UniquenessConstraint( SchemaDescriptorFactory.forLabel( 1, 0 ) ), ":Party(name)" ); visitor.apply( null ).visitAllNodesCount( 55 ); visitor.apply( null ).visitNodeCount( 0, "Person", 50 ); visitor.apply( null ).visitNodeCount( 0, "Party", 5 ); visitor.apply( null ).visitRelCount( 0, 1, -1, "MATCH (:Person)-[:REJECTS]->() RETURN count(*)", 5 ); }
Source:
public void addWaypoint(Waypoint waypoint) { waypoints.add(waypoint); System.out.println("ADDED WAYPOINT"); }

Target:
public void addWaypoint(Waypoint waypoint) { waypoints.add(waypoint); }
Source:
public String toString() { StringBuilder ret = new StringBuilder("all_nodes: "); for (String s : all_nodes) { ret.append(s + ","); } ret.append(" cluster_nodes: "); for (String s : cluster_nodes) { ret.append(s + ","); } return ret.toString(); }

Target:
public String toString() { StringBuilder ret = new StringBuilder("all_nodes: "); for (String s : all_nodes) { ret.append(s + ","); } ret.append(" cluster_nodes: "); for (String s : cluster_nodes) { ret.append(s); ret.append(","); } return ret.toString(); }
Source:
public boolean checkFormIdForImport(String formId, String configName) { LOGGER.info("Checking form with id [config: {}]", formId, configName); try { CommcareForm form = formService.retrieveForm(formId, configName); LOGGER.info("Form with id exists", form.getId()); return true; } catch (NullPointerException e) { LOGGER.info("Form with id doesnot exist", formId); return false; } }

Target:
public boolean checkFormIdForImport(String formId, String configName) { LOGGER.info("Checking form with id [config: {}]", formId, configName); CommcareForm form = formService.retrieveForm(formId, configName); if (form.getId() != null) { LOGGER.info("Form with id exists", form.getId()); return true; } else { LOGGER.info("Form with id doesnot exist", formId); return false; } }
Source:
public static List<Float> parseFloatList(String option) throws ParseException { String[] f = option.split(","); List<Float> rv = new ArrayList<>(); try { for (int i = 0; i < f.length; i++) { final String element = f[i]; if (element.startsWith("%")) { rv.add(Float.parseFloat(element)); } else { rv.add(Float.parseFloat(element)); } } return rv; } catch (NumberFormatException e) { throw new ParseException("Wrong number syntax"); } }

Target:
public static List<Float> parseFloatList(String option) throws ParseException { String[] f = option.split(","); List<Float> rv = new ArrayList<>(); try { for (final String element : f) { rv.add(Float.parseFloat(element)); } return rv; } catch (NumberFormatException e) { throw new ParseException("Wrong number syntax"); } }
Source:
public List<String> getPossibleRecipients(FeedbackQuestionAttributes fqa) { FeedbackParticipantType recipientType = fqa.recipientType; List<String> possibleRecipients = null; if (fqa.recipientType == FeedbackParticipantType.SELF) { recipientType = fqa.giverType; } switch(recipientType) { case STUDENTS: case OWN_TEAM_MEMBERS: case OWN_TEAM_MEMBERS_INCLUDING_SELF: possibleRecipients = getSortedListOfStudentEmails(); break; case INSTRUCTORS: possibleRecipients = getSortedListOfInstructorEmails(); break; case TEAMS: case OWN_TEAM: possibleRecipients = getSortedListOfTeams(); break; case NONE: possibleRecipients = new ArrayList<String>(); possibleRecipients.add(Const.USER_NOBODY_TEXT); break; default: break; } return possibleRecipients; }

Target:
public List<String> getPossibleRecipients(FeedbackQuestionAttributes fqa) { FeedbackParticipantType recipientType = fqa.recipientType; List<String> possibleRecipients = null; if (fqa.recipientType == FeedbackParticipantType.SELF) { recipientType = fqa.giverType; } switch(recipientType) { case STUDENTS: case OWN_TEAM_MEMBERS: case OWN_TEAM_MEMBERS_INCLUDING_SELF: possibleRecipients = getSortedListOfStudentEmails(); break; case INSTRUCTORS: possibleRecipients = getSortedListOfInstructorEmails(); break; case TEAMS: case OWN_TEAM: possibleRecipients = getSortedListOfTeams(); break; case NONE: possibleRecipients = new ArrayList<String>(); possibleRecipients.add(Const.USER_NOBODY_TEXT); break; default: log.severe("Invalid recipient type specified"); break; } return possibleRecipients; }
Source:
protected void configureServlets() { getServletContext().addListener(new org.everrest.websockets.WSConnectionTracker()); final Map<String, String> corsFilterParams = new HashMap<>(); corsFilterParams.put("cors.allowed.origins", "*"); corsFilterParams.put("cors.allowed.methods", "GET," + "POST," + "HEAD," + "OPTIONS," + "PUT," + "DELETE"); corsFilterParams.put("cors.allowed.headers", "Content-Type," + "X-Requested-With," + "accept," + "Origin," + "Access-Control-Request-Method," + "Access-Control-Request-Headers"); corsFilterParams.put("cors.support.credentials", "true"); corsFilterParams.put("cors.preflight.maxage", "10"); bind(CorsFilter.class).in(Singleton.class); filter("/*").through(CorsFilter.class, corsFilterParams); filter("/api/*").through(org.eclipse.che.api.local.filters.EnvironmentInitializationFilter.class); serveRegex("/api((?!(/(ws|eventbus)($|/.*)))/.*)").with(GuiceEverrestServlet.class); install(new org.eclipse.che.swagger.deploy.BasicSwaggerConfigurationModule()); }

Target:
protected void configureServlets() { getServletContext().addListener(new org.everrest.websockets.WSConnectionTracker()); final Map<String, String> corsFilterParams = new HashMap<>(); corsFilterParams.put("cors.allowed.origins", "*"); corsFilterParams.put("cors.allowed.methods", "GET," + "POST," + "HEAD," + "OPTIONS," + "PUT," + "DELETE"); corsFilterParams.put("cors.allowed.headers", "Content-Type," + "X-Requested-With," + "accept," + "Origin," + "Access-Control-Request-Method," + "Access-Control-Request-Headers"); corsFilterParams.put("cors.support.credentials", "true"); corsFilterParams.put("cors.preflight.maxage", "10"); bind(CorsFilter.class).in(Singleton.class); filter("/*").through(CorsFilter.class, corsFilterParams); filter("/api/*").through(org.eclipse.che.api.local.filters.EnvironmentInitializationFilter.class); serveRegex("^/api((?!(/(ws|eventbus)($|/.*)))/.*)").with(GuiceEverrestServlet.class); install(new org.eclipse.che.swagger.deploy.BasicSwaggerConfigurationModule()); }
Source:
private BAMIndexer createBamIndex(final String pathURI) { try { final String indexFileBase = pathURI.toString().endsWith(BamFileIoUtils.BAM_FILE_EXTENSION) ? pathURI.substring(0, pathURI.lastIndexOf('.')) : pathURI; final Path indexPath = IOUtil.getPath(indexFileBase + BAMIndex.BAMIndexSuffix); if (Files.exists(indexPath)) { if (!Files.isWritable(indexPath)) { throw new SAMException("Not creating BAM index since unable to write index file " + indexPath.toUri()); } } return new BAMIndexer(indexPath, getFileHeader()); } catch (Exception e) { throw new SAMException("Not creating BAM index", e); } }

Target:
private BAMIndexer createBamIndex(final String pathURI) { try { final String indexFileBase = pathURI.endsWith(BamFileIoUtils.BAM_FILE_EXTENSION) ? pathURI.substring(0, pathURI.lastIndexOf('.')) : pathURI; final Path indexPath = IOUtil.getPath(indexFileBase + BAMIndex.BAMIndexSuffix); if (Files.exists(indexPath)) { if (!Files.isWritable(indexPath)) { throw new SAMException("Not creating BAM index since unable to write index file " + indexPath.toUri()); } } return new BAMIndexer(indexPath, getFileHeader()); } catch (Exception e) { throw new SAMException("Not creating BAM index", e); } }
Source:
private static void wrapCastedConstructorArgs(List<Expression> arguments, AstNodeCache nodeCache) { arguments .stream() .filter(MapExpression.class::isInstance) .map(MapExpression.class::cast) .flatMap(mapArgument -> mapArgument .getMapEntryExpressions() .stream() .filter(SpecialMethodCall::hasCastedConstructorArg) ) .forEach(constructorArgsEntry -> constructorArgsEntry .setValueExpression(new ListExpression( ((ListExpression) constructorArgsEntry.getValueExpression()) .getExpressions() .stream() .map(constructorArg -> { if (constructorArg instanceof CastExpression) { ConstructorCallExpression wrapExpression = new ConstructorCallExpression( nodeCache.PojoWrapper, new ArgumentListExpression( constructorArg, new ClassExpression(constructorArg.getType()))); wrapExpression.setSourcePosition(constructorArg); return wrapExpression; } else { return constructorArg; } }) .collect(toList())))); }

Target:
private static void wrapCastedConstructorArgs(List<Expression> arguments, AstNodeCache nodeCache) { arguments .stream() .filter(MapExpression.class::isInstance) .map(MapExpression.class::cast) .flatMap(SpecialMethodCall::entriesWithCastedConstructorArg) .forEach(constructorArgsEntry -> wrapCastedConstructorArgs(constructorArgsEntry, nodeCache)); }
Source:
public final void canBeRendered() throws Exception { final String text = "Hello, **world**!"; MatcherAssert.assertThat( new MkMarkdown(new MkGithub()).render( Json.createObjectBuilder() .add("text", text) .build() ), Matchers.equalTo(text) ); }

Target:
public final void canBeRendered() throws Exception { final String text = "Hello, **world**!"; MatcherAssert.assertThat( new MkGithub().markdown().render( Json.createObjectBuilder() .add("text", text) .build() ), Matchers.equalTo(text) ); }
Source:
private static void loadAllTextures() { getTexture(TEXTURE_PATH + BaseSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + BulletSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + CraterSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + DeepWaterSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + EngineerSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + GenericExplosionSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + GrassSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + MineExplosionSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + MineSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + PillboxSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + RoadSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + RubbleSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + SwampSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + TankSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + TreeSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + WallSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + WaterSprite.TEXTURE_FILE); }

Target:
private static void loadAllTextures() { File textureDirectory = new File(TEXTURE_PATH); for (File file : textureDirectory.listFiles()) { if (file.getName().endsWith("png")) { getTexture(TEXTURE_PATH + file.getName()); } } }
Source:
private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); plugParameters.setVmId(getParameters().getVmId()); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD); } return plugVmNicReturnValue.getSucceeded(); }

Target:
private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD.toString()); getReturnValue().setCanDoAction(false); } return plugVmNicReturnValue.getSucceeded(); }
Source:
protected Map<String, String> getProperties() { Map<String, String> properties = new HashMap<>(); if (config.getProperties() != null) { properties.putAll(config.getProperties().getProperties()); } if (!Strings.isNullOrEmpty(config.getAggregations())) { properties.remove(Properties.Cube.AGGREGATIONS); properties.putAll(CubeUtils.parseAndGetProperties(Properties.Cube.AGGREGATIONS, config.getAggregations(), ";", ":", new Function<String, String>() { @Override public String apply(String input) { return "dataset.cube.aggregation." + input + ".dimensions"; } })); } if (!Strings.isNullOrEmpty(config.getMeasurements())) { properties.remove(Properties.Cube.MEASUREMENTS); properties.putAll(CubeUtils.parseAndGetProperties(Properties.Cube.MEASUREMENTS, config.getMeasurements(), ",", ":", new Function<String, String>() { @Override public String apply(String input) { return Properties.Cube.MEASUREMENT_PREFIX + input; } })); } properties.put(Properties.BatchReadableWritable.NAME, config.getName()); properties.put(Properties.BatchReadableWritable.TYPE, Cube.class.getName()); return properties; }

Target:
protected Map<String, String> getProperties() { Map<String, String> properties = new HashMap<>(); if (config.getProperties() != null) { properties.putAll(config.getProperties().getProperties()); } if (!Strings.isNullOrEmpty(config.getAggregations())) { properties.remove(Properties.Cube.AGGREGATIONS); properties.putAll(CubeUtils.parseAndGetProperties(Properties.Cube.AGGREGATIONS, config.getAggregations(), ";", ":", new Function<String, String>() { @Override public String apply(String input) { return "dataset.cube.aggregation." + input + ".dimensions"; } })); } if (!Strings.isNullOrEmpty(config.getMeasurements())) { properties.remove(Properties.Cube.MEASUREMENTS); properties.putAll(CubeUtils.parseAndGetProperties(Properties.Cube.MEASUREMENTS, config.getMeasurements(), ";", ":", new Function<String, String>() { @Override public String apply(String input) { return Properties.Cube.MEASUREMENT_PREFIX + input; } })); } properties.put(Properties.BatchReadableWritable.NAME, config.getName()); properties.put(Properties.BatchReadableWritable.TYPE, Cube.class.getName()); return properties; }
Source:
private PopupMenuSessionSearch getPopupMenuItemFindRelatedMessages() { if (popupMenuItemFindRelatedMessages == null) { popupMenuItemFindRelatedMessages = new PopupMenuSessionSearch(this); } return popupMenuItemFindRelatedMessages; }

Target:
private PopupMenuSessionSearch getPopupMenuItemFindRelatedMessages() { if (popupMenuItemFindRelatedMessages == null) { popupMenuItemFindRelatedMessages = new PopupMenuSessionSearch(httpSessionsPanel); } return popupMenuItemFindRelatedMessages; }
Source:
private ValidationResult isNetworkSupportedInClusterWithOvsSwitch() { return ValidationResult .failWith(EngineMessage.ACTION_TYPE_FAILED_ONLY_EXTERNAL_NETWORK_IS_SUPPORTED_IN_OVS_SWITCH_TYPE) .when(isNetworkCompatibleWithClusterSwitchType() && !(getNetwork() == null || isVnicAttachedToExternalNetwork())); }

Target:
private ValidationResult isNetworkSupportedInClusterWithOvsSwitch() { return ValidationResult .failWith(EngineMessage.ACTION_TYPE_FAILED_ONLY_EXTERNAL_NETWORK_IS_SUPPORTED_IN_OVS_SWITCH_TYPE) .when(isOvsSwitchTypeOnCluster() && !isVnicEmptyOrAttachedToExternalNetwork()); }
Source:
public static void invalidateAllVanityUrlVersions(Contentlet vanityUrl){ try { Identifier identifier = identifierAPI.find(vanityUrl.getIdentifier()); List<Contentlet> contentletVersions = contentletAPI.findAllVersions(identifier,APILocator.systemUser(),false); contentletVersions.stream().forEach( (Contentlet con) -> { try { vanityURLCache.remove(VanityUrlUtil.sanitizeKey(con)); } catch (DotDataException | DotRuntimeException | DotSecurityException e) { Logger.error(VanityUrlServices.class, "Error trying to invalidate Vanity URL identifier:"+vanityUrl.getIdentifier(),e); } }); vanityURLCache.remove(VanityUrlUtil.sanitizeKey(vanityUrl)); } catch (DotDataException | DotRuntimeException | DotSecurityException e) { Logger.error(VanityUrlServices.class, "Error trying to invalidate Vanity URL identifier:"+vanityUrl.getIdentifier(),e); } }

Target:
public void invalidateAllVanityUrlVersions(Contentlet vanityUrl) { try { Identifier identifier = identifierAPI.find(vanityUrl.getIdentifier()); List<Contentlet> contentletVersions = contentletAPI .findAllVersions(identifier, APILocator.systemUser(), false); contentletVersions.stream() .filter(con -> vanityUrl.getLanguageId() == con.getLanguageId()) .forEach(this::removeFromCache); removeFromCache(vanityUrl); } catch (DotDataException | DotRuntimeException | DotSecurityException e) { Logger.error(VanityUrlServices.class, "Error trying to invalidate Vanity URL identifier:" + vanityUrl.getIdentifier(), e); } }