auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static boolean isReadyForSpark(CustomTask task) { Instant fiveMinsAgo = Instant.now().minus(1, ChronoUnit.MINUTES); return task.getName() != null && task.getName().matches(".*TEST.*") && Instant.parse(task.getCreated_at()).isBefore(fiveMinsAgo) && task.getCustom_fields() .stream() .noneMatch(d -> d.getName().equals("ORIGINAL UUID") && d.getText_value() != null); }

Target:
private static boolean isReadyForSpark(CustomTask task) { Instant fiveMinsAgo = Instant.now().minus(5, ChronoUnit.MINUTES); return task.getName() != null && Instant.parse(task.getCreated_at()).isBefore(fiveMinsAgo) && task.getCustom_fields() .stream() .noneMatch(d -> d.getName().equals("ORIGINAL UUID") && d.getText_value() != null); }
Source:
BlobStatus(List<String> replicaList) { if (replicaList != null && replicaList.size() > 0) { unavailable.addAll(replicaList); } }

Target:
BlobStatus(List<String> replicaList) { if (replicaList != null) { unavailable.addAll(replicaList); } }
Source:
public synchronized void addNamespace(String prefix, String namespaceURI) { urisByPrefix.put(prefix, namespaceURI); if (prefixesByURI.containsKey(namespaceURI)) { (prefixesByURI.get(namespaceURI)).add(prefix); } else { Set<String> set = new HashSet<String>(); set.add(prefix); prefixesByURI.put(namespaceURI, set); } }

Target:
public void addNamespace(String prefix, String namespaceURI) { urisByPrefix.put(prefix, namespaceURI); if (prefixesByURI.containsKey(namespaceURI)) { (prefixesByURI.get(namespaceURI)).add(prefix); } else { Set<String> set = new HashSet<String>(); set.add(prefix); prefixesByURI.put(namespaceURI, set); } }
Source:
private int getNumberOfPartitionsForTopic(final String topic) throws ExecutionException, InterruptedException { try (AdminClient adminClient = createAdminClient()) { final TopicDescription topicDescription = adminClient.describeTopics(Collections.singleton(topic)) .values() .get(topic) .get(); return topicDescription.partitions().size(); } }

Target:
private int getNumberOfPartitionsForTopic(final String topic) throws Exception { try (final AdminClient adminClient = createAdminClient()) { final TopicDescription topicDescription = adminClient.describeTopics(Collections.singleton(topic)) .values() .get(topic) .get(); return topicDescription.partitions().size(); } }
Source:
@Test public void supportsPortableCustomization() throws Exception { String uri = "/foo/bar?z=2&yAA=1"; close(); httpTracing = httpTracing.toBuilder() .clientRequestParser((request, context, span) -> { span.name(request.method().toLowerCase() + " " + request.path()); span.tag("http.url", request.url()); span.tag("request_customizer.is_span", (span instanceof brave.Span) + ""); }) .clientResponseParser(((response, error, context, span) -> { HttpResponseParser.DEFAULT.parse(response, error, context, span); span.tag("response_customizer.is_span", (span instanceof brave.Span) + ""); })) .build().clientOf("remote-service"); client = newClient(server.getPort()); server.enqueue(new MockResponse()); get(client, uri); Span span = takeSpan(); assertThat(span.name()) .isEqualTo("get /foo/bar"); assertThat(span.remoteServiceName()) .isEqualTo("remote-service"); assertThat(span.tags()) .containsEntry("http.url", url(uri)) .containsEntry("request_customizer.is_span", "false") .containsEntry("response_customizer.is_span", "false"); }

Target:
@Test public void supportsPortableCustomization() throws Exception { String uri = "/foo/bar?z=2&yAA=1"; close(); httpTracing = httpTracing.toBuilder() .clientRequestParser((request, context, span) -> { span.name(request.method().toLowerCase() + " " + request.path()); span.tag("http.url", request.url()); span.tag("request_customizer.is_span", (span instanceof brave.Span) + ""); }) .clientResponseParser((response, context, span) -> { HttpResponseParser.DEFAULT.parse(response, context, span); span.tag("response_customizer.is_span", (span instanceof brave.Span) + ""); }) .build().clientOf("remote-service"); client = newClient(server.getPort()); server.enqueue(new MockResponse()); get(client, uri); Span span = takeSpan(); assertThat(span.name()) .isEqualTo("get /foo/bar"); assertThat(span.remoteServiceName()) .isEqualTo("remote-service"); assertThat(span.tags()) .containsEntry("http.url", url(uri)) .containsEntry("request_customizer.is_span", "false") .containsEntry("response_customizer.is_span", "false"); }
Source:
public void databaseExceptionThrownWhenWrongTypeGiven() throws Exception { authChecker.isAuthenticated(INVALID_ITEM_TYPE, INVALID_ITEM_ID, TEACHER_ID, Authentication.AuthType.newBuilder() .setCheckAccess(true) .build()); }

Target:
public void databaseExceptionThrownWhenWrongTypeGiven() throws Exception { authChecker.isAuthenticated(INVALID_ITEM_TYPE, VALID_ITEM_ID, TEACHER_ID, Authentication.AuthType.newBuilder() .setCheckAccess(true) .build()); }
Source:
public void testConcurrentlyGetStatefulPrototypeKieSession() throws Exception { final int nThreads = 10; ExecutorService executorService = Executors.newFixedThreadPool(nThreads); final ConcurrentHashMap ksessionMap = new ConcurrentHashMap(); CountDownLatch latch = new CountDownLatch(nThreads); for (int i = 0; i < nThreads; i++) { executorService.submit(new Runnable() { @Override public void run() { KieSession ksession = (KieSession) context.getBean("statefulPrototypeSession"); Object put = ksessionMap.put(ksession.hashCode(), new Object()); if (put != null) { log.warn("ksession:{} repeated", ksession); } latch.countDown(); } }); } latch.await(); assertEquals(nThreads,ksessionMap.size()); }

Target:
public void testConcurrentlyGetStatefulPrototypeKieSession() throws Exception { final int nThreads = 10; ExecutorService executorService = Executors.newFixedThreadPool(nThreads); final ConcurrentHashMap ksessionMap = new ConcurrentHashMap(); final CountDownLatch latch = new CountDownLatch(nThreads); for (int i = 0; i < nThreads; i++) { executorService.submit(new Runnable() { @Override public void run() { KieSession ksession = (KieSession) context.getBean("statefulPrototypeSession"); Object put = ksessionMap.put(ksession.getIdentifier(), new Object()); if (put != null) { log.warn("ksession:{} repeated", ksession); } latch.countDown(); } }); } latch.await(); assertEquals(nThreads,ksessionMap.size()); }
Source:
public void createDatabase_withPropertiesAndOptions() throws CosmosClientException { CosmosDatabaseProperties databaseDefinition = new CosmosDatabaseProperties(CosmosDatabaseForTest.generateId()); databases.add(ModelBridgeInternal.getResource(databaseDefinition).getId()); CosmosDatabaseResponse createResponse = client.createDatabase(databaseDefinition, new CosmosDatabaseRequestOptions()); validateDatabaseResponse(databaseDefinition, createResponse); }

Target:
public void createDatabase_withPropertiesAndOptions() throws CosmosClientException { CosmosDatabaseProperties databaseDefinition = new CosmosDatabaseProperties(CosmosDatabaseForTest.generateId()); databases.add(databaseDefinition.getId()); CosmosDatabaseResponse createResponse = client.createDatabase(databaseDefinition, new CosmosDatabaseRequestOptions()); validateDatabaseResponse(databaseDefinition, createResponse); }
Source:
public void applyParameters(Material program) { super.applyParameters(program); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = CoreRegistry.get(DisplayResolutionDependentFBOs.class); FBO sceneOpaqueFbo = displayResolutionDependentFBOs.get(new ResourceUrn("engine:sceneOpaque")); if (sceneOpaqueFbo != null) { GL13.glActiveTexture(GL13.GL_TEXTURE0); sceneOpaqueFbo.bindDepthTexture(); program.setInt("texDepth", 0); program.setFloat("texelWidth", 1.0f / sceneOpaqueFbo.width()); program.setFloat("texelHeight", 1.0f / sceneOpaqueFbo.height()); } program.setFloat("pixelOffsetX", pixelOffsetX); program.setFloat("pixelOffsetY", pixelOffsetY); }

Target:
public void applyParameters(Material program) { super.applyParameters(program); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = CoreRegistry.get(DisplayResolutionDependentFBOs.class); FBO sceneOpaqueFbo = displayResolutionDependentFBOs.get(READONLY_GBUFFER); if (sceneOpaqueFbo != null) { GL13.glActiveTexture(GL13.GL_TEXTURE0); sceneOpaqueFbo.bindDepthTexture(); program.setInt("texDepth", 0); program.setFloat("texelWidth", 1.0f / sceneOpaqueFbo.width()); program.setFloat("texelHeight", 1.0f / sceneOpaqueFbo.height()); } program.setFloat("pixelOffsetX", pixelOffsetX); program.setFloat("pixelOffsetY", pixelOffsetY); }
Source:
public void testMarkingAcl_allUseMarking_allowConstraintMask() throws Exception { Permissions testPerms = new Permissions( TestObjectFactory.newPermissionList( TestObjectFactory.generatePermissions(2, 2, 1, 2, AccessRight.USE_MARKING_AS_INT, 0, PermissionSource.MARKING))); Permissions.Acl acl = testPerms.getMarkingAcl(~VIEW_ACCESS_RIGHTS); assertEquals( ImmutableSet.<String>of("MARKING_allow_user_0", "MARKING_allow_user_1"), acl.getAllowUsers()); assertEquals( ImmutableSet.<String>of("MARKING_allow_group_0", AUTHENTICATED_USERS), acl.getAllowGroups()); assertEquals( ImmutableSet.<String>of("MARKING_deny_user_0", "MARKING_deny_user_1"), acl.getDenyUsers()); assertEquals( ImmutableSet.<String>of("MARKING_deny_group_0", "MARKING_deny_group_1"), acl.getDenyGroups()); }

Target:
public void testMarkingAcl_allUseMarking_allowConstraintMask() throws Exception { Permissions testPerms = new Permissions( TestObjectFactory.getMarkingPermissions()); Permissions.Acl acl = testPerms.getMarkingAcl(~VIEW_ACCESS_RIGHTS); assertEquals(ImmutableSet.of("MARKING_allow_user_0"), acl.getAllowUsers()); assertEquals( ImmutableSet.of("MARKING_allow_group_0", AUTHENTICATED_USERS), acl.getAllowGroups()); assertEquals(ImmutableSet.of("MARKING_deny_user_0"), acl.getDenyUsers()); assertEquals(ImmutableSet.of("MARKING_deny_group_0"), acl.getDenyGroups()); }
Source:
public Notification createNotification(Intent inboundIntent) { final NotificationData data = readInboundIntent(inboundIntent); if (null == data) { return null; } else { this.data = data; } MPLog.d(LOGTAG, "MP FCM notification received: " + data.message); final PendingIntent contentIntent = PendingIntent.getActivity( context, 0, data.intent, PendingIntent.FLAG_UPDATE_CURRENT ); builder. setDefaults(MPConfig.getInstance(context).getNotificationDefaults()). setWhen(now). setContentTitle(data.title). setContentText(data.message). setTicker(data.ticker == null ? data.message : data.ticker). setContentIntent(contentIntent); maybeSetSubTitle(); maybeSetNotificationBarIcon(); maybeSetLargeIcon(); maybeSetExpandableNotification(); maybeSetCustomIconColor(); maybeAddActionButtons(); maybeSetChannel(); maybeSetNotificationBadge(); maybeSetGroupKey(contentIntent); maybeSetTime(); maybeSetVisibility(); final Notification n = buildNotification(); if (!data.sticky) { n.flags |= Notification.FLAG_AUTO_CANCEL; } return n; }

Target:
public Notification createNotification(Intent inboundIntent) { this.data = readInboundIntent(inboundIntent); if (null == data) { return null; } MPLog.d(LOGTAG, "MP FCM notification received: " + data.message); final PendingIntent contentIntent = PendingIntent.getActivity( context, 0, data.intent, PendingIntent.FLAG_UPDATE_CURRENT ); builder. setDefaults(MPConfig.getInstance(context).getNotificationDefaults()). setWhen(now). setContentTitle(data.title). setContentText(data.message). setTicker(data.ticker == null ? data.message : data.ticker). setContentIntent(contentIntent); maybeSetNotificationBarIcon(); maybeSetLargeIcon(); maybeSetExpandableNotification(); maybeSetCustomIconColor(); maybeAddActionButtons(); maybeSetChannel(); maybeSetNotificationBadge(); maybeSetTime(); maybeSetVisibility(); maybeSetSubText(); final Notification n = buildNotification(); if (!data.sticky) { n.flags |= Notification.FLAG_AUTO_CANCEL; } return n; }
Source:
public CompletableFuture<Void> waitRunningAsync( List<CompletableFuture<?>> toCancelFutures, KubernetesMachineImpl machine) { CompletableFuture<Void> waitFuture = namespace.deployments().waitRunningAsync(machine.getPodName(), tracerUtil); toCancelFutures.add(waitFuture); return waitFuture; }

Target:
public CompletableFuture<Void> waitRunningAsync( List<CompletableFuture<?>> toCancelFutures, KubernetesMachineImpl machine) { Span tracingSpan = tracerUtil.buildSpan( "WaitRunningAsync", null, machine.getWorkspaceId(), machine.getPodName()); CompletableFuture<Void> waitFuture = namespace.deployments().waitRunningAsync(machine.getPodName()); waitFuture.whenComplete( (res, ex) -> { if (ex != null) { tracerUtil.finishSpanAsFailure(tracingSpan, ex.getMessage()); } else { tracerUtil.finishSpan(tracingSpan); } }); toCancelFutures.add(waitFuture); return waitFuture; }
Source:
public ResponseEntity<?> getTicketTokensOpenForTransfer(Authentication auth) { User currentUser = (User) auth.getPrincipal(); Collection<TicketTransferToken> tokens = ticketService.getValidTicketTransferTokensByUser(currentUser.getEmail()); return createResponseEntity(HttpStatus.OK, "Ticket transfer tokens successfully retrieved.", tokens); }

Target:
public ResponseEntity<?> getTicketTokensOpenForTransfer(Authentication auth) { User currentUser = (User) auth.getPrincipal(); Collection<TicketTransferToken> tokens = ticketService.getValidTicketTransferTokensByUserEmail(currentUser.getEmail()); return createResponseEntity(HttpStatus.OK, "Ticket transfer tokens successfully retrieved.", tokens); }
Source:
protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor monitor) { return CompletableFuture.runAsync(() -> { try { long implCount= countImplementations((IType) getElement(), monitor); if (implCount == 0 && showImplementationsAtLeastOne) { super.setLabel(""); } else { super.setLabel(implCount + " implementations"); } } catch (JavaModelException e) { } }); }

Target:
protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor monitor) { return CompletableFuture.runAsync(() -> { try { long implCount= countImplementations((IType) getElement(), monitor); if (implCount == 0 && showImplementationsAtLeastOne) { super.setLabel(""); } else { super.setLabel(MessageFormat.format(JavaCodeMiningMessages.JavaImplementationCodeMining_label, implCount)); } } catch (JavaModelException e) { } }); }
Source:
protected ProcessBuilder createProcessBuilder() { ProcessBuilder pb = new ProcessBuilder( Paths.get(System.getProperty("user.dir"), "/bin/storm").toString(), "logviewer", "-c", "storm.log.dir=" + logdir, "-c", Config.LOGVIEWER_PORT + "=" + port ); Path logPath = Paths.get(System.getenv("MESOS_SANDBOX"), "/logs"); if (!logPath.toFile().exists() && !logPath.toFile().mkdirs()) { throw new RuntimeException("Couldn't create log directory"); } File log = Paths.get(System.getenv("MESOS_SANDBOX"), "/logs/logviewer-startup.log").toFile(); pb.redirectErrorStream(true); pb.redirectOutput(Redirect.appendTo(log)); return pb; }

Target:
protected ProcessBuilder createProcessBuilder() { ProcessBuilder pb = new ProcessBuilder( Paths.get(System.getProperty("user.dir"), "/bin/storm").toString(), "logviewer", "-c", "storm.log.dir=" + logDir, "-c", Config.LOGVIEWER_PORT + "=" + port ); Path logPath = Paths.get(logDir); if (!logPath.toFile().exists() && !logPath.toFile().mkdirs()) { throw new RuntimeException("Couldn't create log directory"); } File log = Paths.get(logDir, "/logviewer-startup.log").toFile(); pb.redirectErrorStream(true); pb.redirectOutput(Redirect.appendTo(log)); return pb; }
Source:
private void processInput(EntityRef entity, CharacterMovementComponent characterMovementComponent) { lookYaw = (lookYaw - lookYawDelta) % 360; lookYawDelta = 0f; lookPitch = TeraMath.clamp(lookPitch + lookPitchDelta, -89, 89); lookPitchDelta = 0f; Vector3f relMove = new Vector3f(relativeMovement); relMove.y = 0; Quat4f viewRot; switch (characterMovementComponent.mode) { case WALKING: if (!playerCamera.isTracked()) { viewRot = new Quat4f(TeraMath.DEG_TO_RAD * lookYaw, 0, 0); playerCamera.setOrientation(viewRot); } playerCamera.getOrientation().rotate(relMove, relMove); break; case CLIMBING: relMove.y += relativeMovement.y; break; default: if (playerCamera.isTracked()) { viewRot = new Quat4f(TeraMath.DEG_TO_RAD * lookYaw, TeraMath.DEG_TO_RAD * lookPitch, 0); playerCamera.setOrientation(viewRot); } playerCamera.getOrientation().rotate(relMove, relMove); relMove.y += relativeMovement.y; break; } entity.send(new CharacterMoveInputEvent(inputSequenceNumber++, lookPitch, lookYaw, relMove, run, jump, time.getGameDeltaInMs())); jump = false; }

Target:
private void processInput(EntityRef entity, CharacterMovementComponent characterMovementComponent) { lookYaw = (lookYaw - lookYawDelta) % 360; lookYawDelta = 0f; lookPitch = TeraMath.clamp(lookPitch + lookPitchDelta, -89, 89); lookPitchDelta = 0f; Vector3f relMove = new Vector3f(relativeMovement); relMove.y = 0; Quat4f viewRotation; switch (characterMovementComponent.mode) { case WALKING: if (!config.getRendering().isVrSupport()) { viewRotation = new Quat4f(TeraMath.DEG_TO_RAD * lookYaw, 0, 0); playerCamera.setOrientation(viewRotation); } playerCamera.getOrientation().rotate(relMove, relMove); break; case CLIMBING: relMove.y += relativeMovement.y; break; default: if (!config.getRendering().isVrSupport()) { viewRotation = new Quat4f(TeraMath.DEG_TO_RAD * lookYaw, TeraMath.DEG_TO_RAD * lookPitch, 0); playerCamera.setOrientation(viewRotation); } playerCamera.getOrientation().rotate(relMove, relMove); relMove.y += relativeMovement.y; break; } if (!Float.isNaN(relMove.getX()) && !Float.isNaN(relMove.getY()) && !Float.isNaN(relMove.getZ())) { entity.send(new CharacterMoveInputEvent(inputSequenceNumber++, lookPitch, lookYaw, relMove, run, jump, time.getGameDeltaInMs())); } jump = false; }
Source:
private void generateRowkeys(long maxInput) { int maxLength = ("" + maxInput).length(); for (int i = 0; i < maxInput; i++) { String paddedRowkey = String.format("%0" + maxLength + "d", i); String reversedRowkey = new StringBuilder(paddedRowkey).reverse().toString(); keys[i] = "" + reversedRowkey; } Arrays.sort(keys); }

Target:
private void generateRowkeys(long maxInput) { int maxLength = ("" + maxInput).length(); String numberFormat = "%0" + maxLength + "d"; for (int i = 0; i < maxInput; i++) { String paddedRowkey = String.format(numberFormat, i); String reversedRowkey = new StringBuilder(paddedRowkey).reverse().toString(); keys[i] = "" + reversedRowkey; } Arrays.sort(keys); }
Source:
public static boolean canBePreviewed(OCFile file) { return (file != null && file.isAudio()); }

Target:
public static boolean canBePreviewed(OCFile file) { return (file != null && file.isDown() && file.isAudio()); }
Source:
private void migrateAllVdss() { for (Guid vdsId : vdssToMaintenance.keySet()) { MaintenanceVdsParameters tempVar = new MaintenanceVdsParameters(vdsId, getParameters().getIsInternal(), getParameters().getIsStopGlusterProcesses()); tempVar.setSessionId(getParameters().getSessionId()); tempVar.setCorrelationId(getParameters().getCorrelationId()); VdcReturnValueBase result = runInternalAction(VdcActionType.MaintenanceVds, tempVar, ExecutionHandler.createInternalJobContext(getContext())); if (!result.isValid()) { getReturnValue().getValidationMessages().addAll(result.getValidationMessages()); getReturnValue().setValid(false); } } }

Target:
private void migrateAllVdss() { for (Guid vdsId : vdssToMaintenance.keySet()) { MaintenanceVdsParameters tempVar = new MaintenanceVdsParameters(vdsId, getParameters().getIsInternal(), getParameters().isStopGlusterService()); tempVar.setSessionId(getParameters().getSessionId()); tempVar.setCorrelationId(getParameters().getCorrelationId()); VdcReturnValueBase result = runInternalAction(VdcActionType.MaintenanceVds, tempVar, ExecutionHandler.createInternalJobContext(getContext())); if (!result.isValid()) { getReturnValue().getValidationMessages().addAll(result.getValidationMessages()); getReturnValue().setValid(false); } } }
Source:
private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry) { Geometry esriGeometry = geometry.getEsriGeometry(); verify(esriGeometry instanceof Point); Point point = (Point) esriGeometry; verify(!point.hasAttribute(VertexDescription.Semantics.Z) && !point.hasAttribute(VertexDescription.Semantics.M) && !point.hasAttribute(VertexDescription.Semantics.ID), "Only 2D points with no ID nor M attribute are supported"); output.appendByte(GeometryType.POINT.code()); if (!point.isEmpty()) { output.appendDouble(point.getX()); output.appendDouble(point.getY()); } else { output.appendDouble(translateToAVNaN(NaN)); output.appendDouble(translateToAVNaN(NaN)); } }

Target:
private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry) { Geometry esriGeometry = geometry.getEsriGeometry(); verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point"); Point point = (Point) esriGeometry; verify(!point.hasAttribute(VertexDescription.Semantics.Z) && !point.hasAttribute(VertexDescription.Semantics.M) && !point.hasAttribute(VertexDescription.Semantics.ID), "Only 2D points with no ID nor M attribute are supported"); output.appendByte(GeometryType.POINT.code()); if (!point.isEmpty()) { output.appendDouble(point.getX()); output.appendDouble(point.getY()); } else { output.appendDouble(NaN); output.appendDouble(NaN); } }
Source:
public static VdcReturnValueBase evaluateCorrelationId(VdcActionParametersBase parameters) { VdcReturnValueBase returnValue = null; if (parameters != null) { String correlationId = parameters.getCorrelationId(); if (StringUtils.isEmpty(correlationId)) { parameters.setCorrelationId(LoggedUtils.getObjectId(parameters)); } else if (correlationId.length() > MAX_CORRELATION_ID_LENGTH) { VdcReturnValueBase returnErrorValue = new VdcReturnValueBase(); returnErrorValue.setCanDoAction(false); returnErrorValue.getCanDoActionMessages() .add(VdcBllMessages.CORRELATION_ID_EXCEEDS_MAX_LENGTH.toString()); return returnErrorValue; } } return returnValue; }

Target:
public static VdcReturnValueBase evaluateCorrelationId(VdcActionParametersBase parameters) { VdcReturnValueBase returnValue = null; if (parameters != null) { String correlationId = parameters.getCorrelationId(); if (StringUtils.isEmpty(correlationId)) { parameters.setCorrelationId(LoggedUtils.getObjectId(parameters)); } else { ValidationResult result = ValidationUtils.validateInputs(validationGroups, parameters, null); if (!result.isValid()) { VdcReturnValueBase returnErrorValue = new VdcReturnValueBase(); returnErrorValue.setCanDoAction(false); returnErrorValue.getCanDoActionMessages().addAll(result.getMessages()); return returnErrorValue; } } } return returnValue; }
Source:
public ImmutableList<String> getDomains() throws DomainListException { List<String> domains = getDomainListInternal(); ImmutableList<String> detectedDomains = detectDomains(); ImmutableList<String> detectedIps = detectIps(Iterables.concat(domains, detectedDomains)); Iterable<String> allDomains = Iterables.concat(domains, detectedDomains, detectedIps); if (LOGGER.isDebugEnabled()) { for (String domain : allDomains) { LOGGER.debug("Handling mail for: " + domain); } } return ImmutableList.copyOf(allDomains); }

Target:
public ImmutableList<String> getDomains() throws DomainListException { List<String> domains = getDomainListInternal(); ImmutableList<String> detectedDomains = detectDomains(); Iterable<String> domainsWithoutIp = Iterables.concat(domains, detectedDomains); ImmutableList<String> detectedIps = detectIps(domainsWithoutIp); ImmutableList<String> allDomains = ImmutableList.copyOf(Iterables.concat(domainsWithoutIp, detectedIps)); if (LOGGER.isDebugEnabled()) { for (String domain : allDomains) { LOGGER.debug("Handling mail for: " + domain); } } return allDomains; }
Source:
public List<RefRight> getAllRights(final ApprovalCategory.Id id) { List<RefRight> l = new ArrayList<RefRight>(); l.addAll(getLocalRights(id)); l.addAll(getInheritedRights(id)); Collections.sort(l, RefRight.REF_PATTERN_ORDER); l = Collections.unmodifiableList(RefControl.filterMostSpecific(l)); return l; }

Target:
public List<RefRight> getAllRights(final ApprovalCategory.Id id) { List<RefRight> l = new ArrayList<RefRight>(); l.addAll(getLocalRights(id)); l.addAll(getInheritedRights(id)); Collections.sort(l, RefRight.REF_PATTERN_ORDER); return Collections.unmodifiableList(RefControl.filterMostSpecific(l)); }
Source:
public void canSupportGuaranteedSize() throws InterruptedException { ImageAnalysis useCase = new ImageAnalysis.Builder().build(); mInstrumentation.runOnMainSync(() -> { CameraX.bindToLifecycle(mLifecycleOwner, mCameraSelector, useCase); mLifecycleOwner.startAndResume(); useCase.setAnalyzer(CameraXExecutors.newHandlerExecutor(mHandler), mAnalyzer); }); mAnalysisResultsSemaphore.tryAcquire(5, TimeUnit.SECONDS); synchronized (mAnalysisResultLock) { assertEquals(GUARANTEED_RESOLUTION, mAnalysisResults.iterator().next().mResolution); } }

Target:
public void canSupportGuaranteedSize() throws InterruptedException, CameraInfoUnavailableException { for (int i = 0; i <= 1; i++) { final int lensFacing = i; if (CameraUtil.hasCameraWithLensFacing(lensFacing)) { continue; } String cameraId = CameraX.getCameraFactory().cameraIdForLensFacing(lensFacing); boolean isRotateNeeded = (CameraX.getCameraInfo(cameraId).getSensorRotationDegrees( Surface.ROTATION_0) % 180) != 0; ImageAnalysis useCase = new ImageAnalysis.Builder().setTargetResolution( GUARANTEED_RESOLUTION).setTargetRotation( isRotateNeeded ? Surface.ROTATION_90 : Surface.ROTATION_0).build(); mInstrumentation.runOnMainSync(() -> { CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing( lensFacing).build(); CameraX.bindToLifecycle(mLifecycleOwner, cameraSelector, useCase); mLifecycleOwner.startAndResume(); useCase.setAnalyzer(CameraXExecutors.newHandlerExecutor(mHandler), mAnalyzer); }); mAnalysisResultsSemaphore.tryAcquire(5, TimeUnit.SECONDS); synchronized (mAnalysisResultLock) { assertEquals(GUARANTEED_RESOLUTION, mAnalysisResults.iterator().next().mResolution); } } }
Source:
protected void registerCommands() { registerCommand("getConf", new AlluxioCommand(mAlluxioPath, "getConf --master --source"), null); registerCommand("fsadmin", new AlluxioCommand(mAlluxioPath, "fsadmin report"), null); registerCommand("mount", new AlluxioCommand(mAlluxioPath, "fs mount"), null); registerCommand("version", new AlluxioCommand(mAlluxioPath, "version -r"), null); registerCommand("job", new AlluxioCommand(mAlluxioPath, "job ls"), null); registerCommand("journal", new AlluxioCommand(mAlluxioPath, String.format("fs ls -R %s", mFsContext.getClusterConf().get(PropertyKey.MASTER_JOURNAL_FOLDER))), new ShellCommand(new String[]{"ls", "-al", "-R", mFsContext.getClusterConf().get(PropertyKey.MASTER_JOURNAL_FOLDER)})); }

Target:
protected void registerCommands() { registerCommand("getConf", new AlluxioCommand(mAlluxioPath, "getConf --master --source"), null); registerCommand("fsadmin", new AlluxioCommand(mAlluxioPath, "fsadmin report"), null); registerCommand("mount", new AlluxioCommand(mAlluxioPath, "fs mount"), null); registerCommand("version", new AlluxioCommand(mAlluxioPath, "version -r"), null); registerCommand("job", new AlluxioCommand(mAlluxioPath, "job ls"), null); registerCommand("journal", new AlluxioCommand(mAlluxioPath, String.format("fs ls -R %s", mFsContext.getClusterConf().get(PropertyKey.MASTER_JOURNAL_FOLDER))), getListJournalCommand()); }
Source:
public void browserAgentHeader_should_include_default_if_browser_agent_header_not_provided(@Nullable String browserAgentHeader) { authCardDetails.setUserAgentHeader(browserAgentHeader); List<NameValuePair> result = epdqPayloadDefinitionFor3ds2NewOrder.extract(epdqTemplateData); assertThat(result, hasItem(new BasicNameValuePair(BROWSER_USER_AGENT, "Mozilla/5.0"))); }

Target:
public void browserAgentHeader_should_include_default_if_browser_agent_header_not_provided(@Nullable String browserAgentHeader) { authCardDetails.setUserAgentHeader(browserAgentHeader); List<NameValuePair> result = epdqPayloadDefinitionFor3ds2NewOrder.extract(epdqTemplateData); assertThat(result, is(aParameterBuilder().withBrowserUserAgent("Mozilla/5.0").build())); }
Source:
private String getEffectiveUser(Props jobProps) { String effectiveUser = null; if (jobProps.containsKey(USER_TO_PROXY)) { effectiveUser = jobProps.getString(USER_TO_PROXY); } else if (jobProps.containsKey(CommonJobProperties.SUBMIT_USER)) { effectiveUser = jobProps.getString(CommonJobProperties.SUBMIT_USER); } else { throw new RuntimeException("There is no user.to.proxy and submit.user in the jobProps. There is something wrong with the system"); } info("effective user is: " + effectiveUser); return effectiveUser; }

Target:
private String getEffectiveUser(Props jobProps) { String effectiveUser = null; if (jobProps.containsKey(USER_TO_PROXY)) { effectiveUser = jobProps.getString(USER_TO_PROXY); } else if (jobProps.containsKey(CommonJobProperties.SUBMIT_USER)) { effectiveUser = jobProps.getString(CommonJobProperties.SUBMIT_USER); } else { throw new RuntimeException( "Internal Error: No user.to.proxy or submit.user in the jobProps"); } info("effective user is: " + effectiveUser); return effectiveUser; }
Source:
public Set<Map<String, String>> getAll() { Set<Map<String, String>> result = new HashSet<>(); try (Jedis jedis = getJedisPool().getResource()) { Set<String> keys = jedis.hkeys(DEPOSIT_STATUS_PREFIX +"*"); if (keys != null) { for(String uuid : keys) { result.add(jedis.hgetAll(DEPOSIT_STATUS_PREFIX + uuid)); } } } return result; }

Target:
public Set<Map<String, String>> getAll() { Set<Map<String, String>> result = new HashSet<>(); try (Jedis jedis = getJedisPool().getResource()) { Set<String> keys = jedis.keys(DEPOSIT_STATUS_PREFIX + "*"); if (keys != null) { for (String key : keys) { result.add(jedis.hgetAll(key)); } } } return result; }
Source:
public void setTriggerStack(TriggerExecutionStack triggerStack){ this.triggerStack=triggerStack; }

Target:
public void setTriggerStack(TriggerExecutionStack triggerStack){ if(this.triggerStack!=null){ SanityManager.THROWASSERT("LCC already has a trigger stack."); } this.triggerStack=triggerStack; }
Source:
public void execute(ScriptEntry scriptEntry) { List<EntityTag> casters = (List<EntityTag>) scriptEntry.getObject("casters"); ElementTag skill = scriptEntry.getObjectTag("skill"); List<EntityTag> entity_targets = (List<EntityTag>) scriptEntry.getObject("entity_targets"); List<LocationTag> location_targets = (List<LocationTag>) scriptEntry.getObject("location_targets"); ElementTag power = scriptEntry.getObjectTag("power"); if (scriptEntry.dbCallShouldDebug()) { Debug.report(scriptEntry, getName(), ArgumentHelper.debugList("casters", casters) + skill.debug() + (location_targets == null ? "" : ArgumentHelper.debugList("location_Targets", location_targets)) + (entity_targets == null ? "" : ArgumentHelper.debugList("entity_targets", entity_targets)) + (power == null ? "" : power.debug())); } for (EntityTag entity : casters) { MythicMobsBridge.castSkill(entity, skill.asString(), entity_targets, location_targets, power.asFloat()); } }

Target:
public void execute(ScriptEntry scriptEntry) { List<EntityTag> casters = (List<EntityTag>) scriptEntry.getObject("casters"); ElementTag skill = scriptEntry.getObjectTag("skill"); List<EntityTag> entity_targets = (List<EntityTag>) scriptEntry.getObject("entity_targets"); List<LocationTag> location_targets = (List<LocationTag>) scriptEntry.getObject("location_targets"); ElementTag power = scriptEntry.getObjectTag("power"); if (scriptEntry.dbCallShouldDebug()) { Debug.report(scriptEntry, getName(), ArgumentHelper.debugList("casters", casters) + skill.debug() + (location_targets == null ? "" : ArgumentHelper.debugList("location_Targets", location_targets)) + (entity_targets == null ? "" : ArgumentHelper.debugList("entity_targets", entity_targets)) + (power == null ? "" : power.debug())); } HashSet<Entity> entityTargets = null; HashSet<Location> locationTargets = null; if (entity_targets != null) { entityTargets = new HashSet<>(); for (EntityTag entity : entity_targets) { entityTargets.add(entity.getBukkitEntity()); } } else { locationTargets = new HashSet<>(location_targets); } for (EntityTag caster : casters) { MythicMobsBridge.getAPI().castSkill(caster.getBukkitEntity(), skill.asString(), caster.getBukkitEntity().getLocation(), entityTargets, locationTargets, power.asFloat()); } }
Source:
private DbUserCacheManager() { for (AuthenticationProfile profile : AuthenticationProfileRepository.getInstance().getProfiles()) { directoriesMap.put(profile.getDirectory().getName(), profile.getDirectory()); } }

Target:
private DbUserCacheManager() { }
Source:
public void stop() { stopping = true; exec.shutdown(); synchronized (tasks) { for (ForkingTaskRunnerWorkItem taskWorkItem : tasks.values()) { if (taskWorkItem.processHolder != null) { log.info("Closing output stream to task[%s].", taskWorkItem.getTask().getId()); try { taskWorkItem.processHolder.process.getOutputStream().close(); } catch (Exception e) { log.warn(e, "Failed to close stdout to task[%s]. Destroying task.", taskWorkItem.getTask().getId()); taskWorkItem.processHolder.process.destroy(); } } } } final DateTime start = new DateTime(); final long timeout = new Interval(start, taskConfig.getGracefulShutdownTimeout()).toDurationMillis(); log.info("Waiting up to %,dms for shutdown.", timeout); if (timeout > 0) { try { final boolean terminated = exec.awaitTermination(timeout, TimeUnit.MILLISECONDS); final long elapsed = System.currentTimeMillis() - start.getMillis(); if (terminated) { log.info("Finished stopping in %,dms.", elapsed); } else { log.warn("Executor failed to stop after %,dms, not waiting for it!", elapsed); } } catch (InterruptedException e) { log.warn(e, "Interrupted while waiting for executor to finish."); Thread.currentThread().interrupt(); } } else { log.warn("Ran out of time, not waiting for executor to finish!"); } }

Target:
public void stop() { stopping = true; exec.shutdown(); synchronized (tasks) { for (ForkingTaskRunnerWorkItem taskWorkItem : tasks.values()) { if (taskWorkItem.processHolder != null) { log.info("Closing output stream to task[%s].", taskWorkItem.getTask().getId()); try { taskWorkItem.processHolder.process.getOutputStream().close(); } catch (Exception e) { log.warn(e, "Failed to close stdout to task[%s]. Destroying task.", taskWorkItem.getTask().getId()); taskWorkItem.processHolder.process.destroy(); } } } } final DateTime start = new DateTime(); final long timeout = new Interval(start, taskConfig.getGracefulShutdownTimeout()).toDurationMillis(); log.info("Waiting up to %,dms for shutdown.", timeout); if (timeout > 0) { try { final boolean terminated = exec.awaitTermination(timeout, TimeUnit.MILLISECONDS); final long elapsed = System.currentTimeMillis() - start.getMillis(); if (terminated) { log.info("Finished stopping in %,dms.", elapsed); } else { final Set<String> stillRunning = ImmutableSet.copyOf(tasks.keySet()); log.makeAlert("Failed to stop forked tasks") .addData("stillRunning", stillRunning) .addData("elapsed", elapsed) .emit(); log.warn( "Executor failed to stop after %,dms, not waiting for it! Tasks still running: [%s]", elapsed, Joiner.on("; ").join(stillRunning) ); } } catch (InterruptedException e) { log.warn(e, "Interrupted while waiting for executor to finish."); Thread.currentThread().interrupt(); } } else { log.warn("Ran out of time, not waiting for executor to finish!"); } }
Source:
public NodeTypesVisualsApiData(VisualAppearanceResource visuals) { NodeTypeId parent = (NodeTypeId) visuals.getId().getParent(); TNodeType element = RepositoryFactory.getRepository().getElement(parent); this.color = visuals.getBorderColor(); this.nodeTypeId = parent.getQName(); if (Objects.nonNull(element.getTags())) { Optional<TTag> isPattern = element.getTags() .getTag() .stream() .filter( tTag -> "pattern".equals( tTag.getName().toLowerCase() ) ) .findFirst(); isPattern.ifPresent(tTag -> this.pattern = tTag.getValue()); } RepositoryFileReference iconRef = new RepositoryFileReference(visuals.getId(), Filename.FILENAME_SMALL_ICON); if (RepositoryFactory.getRepository().exists(iconRef)) { iconUrl = visuals.getAbsoluteURL() + "16x16"; } RepositoryFileReference imageRef = new RepositoryFileReference(visuals.getId(), Filename.FILENAME_BIG_ICON); if (RepositoryFactory.getRepository().exists(imageRef)) { imageUrl = visuals.getAbsoluteURL() + "50x50"; } }

Target:
public NodeTypesVisualsApiData(VisualAppearanceResource visuals) { IRepository repository = RepositoryFactory.getRepository(); NodeTypeId parent = (NodeTypeId) visuals.getId().getParent(); this.color = visuals.getBorderColor(); this.nodeTypeId = parent.getQName(); this.pattern = repository.getNamespaceManager().isPatternNamespace(parent.getNamespace().getDecoded()); RepositoryFileReference iconRef = new RepositoryFileReference(visuals.getId(), Filename.FILENAME_SMALL_ICON); if (repository.exists(iconRef)) { iconUrl = visuals.getAbsoluteURL() + "16x16"; } RepositoryFileReference imageRef = new RepositoryFileReference(visuals.getId(), Filename.FILENAME_BIG_ICON); if (repository.exists(imageRef)) { imageUrl = visuals.getAbsoluteURL() + "50x50"; } }
Source:
public boolean isBinding(String replName) { return factory.isBinded(getId(), replName); }

Target:
public boolean isBinding(String replName) { return factory.getInterpreter(this.getId(), replName) != null; }
Source:
public List getSelected() { return list.getSelectedValuesList(); }

Target:
public List<String> getSelected() { return list.getSelectedValuesList(); }
Source:
protected String[] initTextMessages() { IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class); String bindingKey = bindingService .getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST); String context; switch(ContextType.get(currentPath)) { case PATH_ITEM: context = "path item"; break; case PATH_PARAMETER: context = "parameter"; break; case PATH_RESPONSE: context = "response"; break; default: context = "schema"; break; } return new String[] { String.format(Messages.content_assist_proposal_project, bindingKey, context), String.format(Messages.content_assist_proposal_workspace, bindingKey, context), String.format(Messages.content_assist_proposal_local, bindingKey, context) }; }

Target:
protected String[] initTextMessages() { IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class); String bindingKey = bindingService .getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST); String context; switch(ContextType.get(currentPath)) { case PATH_ITEM: context = "path items"; break; case PATH_PARAMETER: context = "parameters"; break; case PATH_RESPONSE: context = "responses"; break; default: context = "schemas"; break; } return new String[] { String.format(Messages.content_assist_proposal_project, bindingKey, context), String.format(Messages.content_assist_proposal_workspace, bindingKey, context), String.format(Messages.content_assist_proposal_local, bindingKey, context) }; }
Source:
private int getAvailablePort() { ServerSocket serverSocket = null; int port = 0; for(int i = 0; i < 50; i++){ try { serverSocket = new ServerSocket(0); port = serverSocket.getLocalPort(); if(port != 0) { serverSocket.close(); break; } } catch (IOException e) { LOG.error("Unable to allocate port " + e.getMessage(), e); } } if (serverSocket != null && !serverSocket.isClosed()) { try { serverSocket.close(); } catch (IOException e) { LOG.error("error closing port", e); } } return port; }

Target:
private int getAvailablePort() { ServerSocket serverSocket = null; int port = 0; for(int i = 0; i < 50; i++){ try { serverSocket = new ServerSocket(0); port = serverSocket.getLocalPort(); if(port != 0) { serverSocket.close(); break; } } catch (IOException e) { LOG.error("Unable to close the server socket " + e.getMessage(), e); } } if (serverSocket != null && !serverSocket.isClosed()) { try { serverSocket.close(); } catch (IOException e) { LOG.error("error closing port", e); } } return port; }
Source:
public ListenableFuture<Boolean> processMetrics(final List<List<IMetric>> input) { int remainingCapacityOfTheBlockingQueue = this.remainingCapacityOfTheQueue(); log.debug("Remaining capacity of DiscoveryWriter blocking queue: [" + remainingCapacityOfTheBlockingQueue + "]"); if(remainingCapacityOfTheBlockingQueue == 0){ log.warn("Remaining capacity of DiscoveryWriter blocking queue: [" + remainingCapacityOfTheBlockingQueue + "]"); } return getThreadPool().submit(new Callable<Boolean>() { @Override public Boolean call() throws Exception { boolean success = true; final List<IMetric> willIndex = DiscoveryWriter.condense(input); for (DiscoveryIO io : discoveryIOs) { try { io.insertDiscovery(willIndex); } catch (Exception ex) { getLogger().error(ex.getMessage(), ex); writeErrorMeters.get(io.getClass()).mark(); success = false; } } if(success) { for(IMetric indexedMetric: willIndex) { LocatorCache.getInstance().setLocatorCurrentInDiscoveryLayer(indexedMetric.getLocator()); } } return success; } }); }

Target:
public ListenableFuture<Boolean> processMetrics(final List<List<IMetric>> input) { int remainingCapacityOfTheBlockingQueue = this.remainingCapacityOfTheQueue(); log.debug("Remaining capacity of DiscoveryWriter blocking queue: [{}]", remainingCapacityOfTheBlockingQueue); if(remainingCapacityOfTheBlockingQueue == 0){ log.warn("Remaining capacity of DiscoveryWriter blocking queue: [{}]", remainingCapacityOfTheBlockingQueue); } return getThreadPool().submit(new Callable<Boolean>() { @Override public Boolean call() throws Exception { boolean success = true; final List<IMetric> willIndex = DiscoveryWriter.condense(input); for (DiscoveryIO io : discoveryIOs) { try { io.insertDiscovery(willIndex); } catch (Exception ex) { getLogger().error(ex.getMessage(), ex); writeErrorMeters.get(io.getClass()).mark(); success = false; } } if(success) { for(IMetric indexedMetric: willIndex) { LocatorCache.getInstance().setLocatorCurrentInDiscoveryLayer(indexedMetric.getLocator()); } } return success; } }); }
Source:
private AgentNotificationData notificationDataFrom(AgentInstance agentInstance) { return new AgentNotificationData(agentInstance.getUuid(), agentInstance.getHostname(), elasticAgentId(agentInstance), agentInstance.getIpAddress(), agentInstance.getOperatingSystem(), agentInstance.freeDiskSpace().toString(), agentInstance.getAgentConfigStatus().name(), agentInstance.getRuntimeStatus().agentState().name(), agentInstance.getRuntimeStatus().buildState().name(), new Date() ); }

Target:
private AgentNotificationData notificationDataFrom(AgentInstance agentInstance) { return new AgentNotificationData(agentInstance.getUuid(), agentInstance.getHostname(), agentInstance.isElastic(), agentInstance.getIpAddress(), agentInstance.getOperatingSystem(), agentInstance.freeDiskSpace().toString(), agentInstance.getAgentConfigStatus().name(), agentInstance.getRuntimeStatus().agentState().name(), agentInstance.getRuntimeStatus().buildState().name(), new Date() ); }
Source:
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { super.handle(target, baseRequest, request, response); if (baseRequest.isHandled()) return; try { response.setContentType(JSON_CONTENT_TYPE); if (m_jsonEnabled) { if (target.equals("/") && !VoltDB.instance().rejoining()) { httpClientInterface.process(baseRequest, response); } else { response.setStatus(HttpServletResponse.SC_NOT_FOUND); response.getWriter().println("Resource not found"); baseRequest.setHandled(true); } } else { response.setStatus(HttpServletResponse.SC_FORBIDDEN); baseRequest.setHandled(true); response.getWriter().println("JSON API IS CURRENTLY DISABLED"); } } catch(Exception ex){ logger.info("Not servicing url: " + baseRequest.getRequestURI() + " Details: "+ ex.getMessage(), ex); } }

Target:
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { super.handle(target, baseRequest, request, response); if (baseRequest.isHandled()) return; try { response.setContentType(JSON_CONTENT_TYPE); if (m_jsonEnabled) { if (target.equals("/")) { httpClientInterface.process(baseRequest, response); } else { response.setStatus(HttpServletResponse.SC_NOT_FOUND); response.getWriter().println("Resource not found"); baseRequest.setHandled(true); } } else { response.setStatus(HttpServletResponse.SC_FORBIDDEN); baseRequest.setHandled(true); response.getWriter().println("JSON API IS CURRENTLY DISABLED"); } } catch(Exception ex){ logger.info("Not servicing url: " + baseRequest.getRequestURI() + " Details: "+ ex.getMessage(), ex); } }
Source:
public void resourceSizeInGigabytes() { transformer.setAttributeMappings( Collections.singletonList( createMapping(Core.RESOURCE_SIZE, "ResourceSize", "{{ResourceSize}}"))); transformer.setDataUnit(WfsConstants.GB); final Optional<Metacard> metacardOptional = transformer.apply(inputStream, mockWfsMetadata); assertThat( "The transformer should have returned a metacard but didn't.", metacardOptional.isPresent(), is(true)); final Metacard metacard = metacardOptional.get(); assertThat(getAttributeValue(Core.RESOURCE_SIZE, metacard), is("1073741824.0")); }

Target:
public void resourceSizeInGigabytes() { transformer.setAttributeMappings( Collections.singletonList( createMapping(Core.RESOURCE_SIZE, "ResourceSize", "{{ResourceSize}}"))); transformer.setDataUnit(WfsConstants.GB); final Optional<Metacard> metacardOptional = transformer.apply(inputStream, mockWfsMetadata); assertThat( "The transformer should have returned a metacard but didn't.", metacardOptional.isPresent(), is(true)); final Metacard metacard = metacardOptional.get(); assertThat( getAttributeValue(Core.RESOURCE_SIZE, metacard), is(WfsConstants.BYTES_PER_GB + ".0")); }
Source:
private List<ClosedAccount> findAllClosedAccountsFor(Map<String, Date> dateRange) { try { RowMapper<ClosedAccount> mapRow = new RowMapper<ClosedAccount>() { public ClosedAccount mapRow(ResultSet resultSet, int rowNumber) throws SQLException { ClosedAccount laborClosedAccountDataRow = new ClosedAccount(); laborClosedAccountDataRow.setChart(resultSet.getString(ACCT_FIN_COA_CD)); laborClosedAccountDataRow.setAccountNumber(resultSet.getString(ACCT_ACCOUNT_NBR)); laborClosedAccountDataRow.setSubAccountNumber(resultSet.getString(SUB_SUB_ACCT_NBR)); laborClosedAccountDataRow.setAccountClosedIndicator(resultSet.getString(ACCT_ACCT_CLOSED_IND)); laborClosedAccountDataRow.setAccountClosedDate(resultSet.getDate(ACCTX_ACCT_CLOSED_DT)); return laborClosedAccountDataRow; } }; return this.getJdbcTemplate().query(buildClosedAccountsForItChartDateRangeSql(dateRange), mapRow); } catch (Exception e) { LOG.info("findAllClosedAccountsFor Exception: " + e.getMessage()); return null; } }

Target:
private List<ClosedAccount> findAllClosedAccountsFor(Map<String, Date> dateRange) { try { RowMapper<ClosedAccount> mapRow = new RowMapper<ClosedAccount>() { public ClosedAccount mapRow(ResultSet resultSet, int rowNumber) throws SQLException { ClosedAccount closedAccountDataRow = new ClosedAccount(); closedAccountDataRow.setChart(resultSet.getString(ACCT_FIN_COA_CD)); closedAccountDataRow.setAccountNumber(resultSet.getString(ACCT_ACCOUNT_NBR)); closedAccountDataRow.setSubAccountNumber(resultSet.getString(SUB_SUB_ACCT_NBR)); closedAccountDataRow.setAccountClosedIndicator(resultSet.getString(ACCT_ACCT_CLOSED_IND)); closedAccountDataRow.setAccountClosedDate(resultSet.getDate(ACCTX_ACCT_CLOSED_DT)); return closedAccountDataRow; } }; return this.getJdbcTemplate().query(buildClosedAccountsForItChartDateRangeSql(dateRange), mapRow); } catch (Exception e) { LOG.info("findAllClosedAccountsFor Exception: " + e.getMessage()); return null; } }
Source:
public int hashCode() { return Objects.hashCode(mInputPartitionInfo, mInput, mOutput, mMaxNumFiles, mMinFileSize); }

Target:
public int hashCode() { return Objects.hashCode(mInputPartitionInfo, mOutputPartitionInfo, mInput, mOutput, mMaxNumFiles, mMinFileSize); }