auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addSnapshotToDB(Map<Guid, DiskImage> oldToNewImageMap, Snapshot snapshot) { VM oldVm = snapshotVmConfigurationHelper.getVmFromConfiguration(snapshot); List<DiskImage> newDiskImages = oldVm.getDiskList() .stream() .map(d -> oldToNewImageMap.get(d.getImageId())) .collect(Collectors.toList()); Guid newSnapshotId = Guid.newGuid(); newDiskImages.forEach(di -> { di.setVmSnapshotId(newSnapshotId); imageDao.update(di.getImage()); }); snapshotsManager.addSnapshot(newSnapshotId, snapshot.getDescription(), snapshot.getStatus(), snapshot.getType(), initClonedVm(oldVm), true, null, null, snapshot.getCreationDate(), newDiskImages, oldVm.getManagedVmDeviceMap(), getCompensationContext()); }

Target:
private void addSnapshotToDB(Map<Guid, DiskImage> oldToNewImageMap, Snapshot snapshot) { VM oldVm = snapshotVmConfigurationHelper.getVmFromConfiguration(snapshot); List<DiskImage> newDiskImages = oldVm.getDiskList() .stream() .map(d -> oldToNewImageMap.get(d.getImageId())) .collect(Collectors.toList()); Guid newSnapshotId = Guid.newGuid(); newDiskImages.forEach(diskImage -> { diskImage.setVmSnapshotId(newSnapshotId); imageDao.update(diskImage.getImage()); }); snapshotsManager.addSnapshot(newSnapshotId, snapshot.getDescription(), snapshot.getStatus(), snapshot.getType(), initClonedVm(oldVm), true, null, null, snapshot.getCreationDate(), newDiskImages, oldVm.getManagedVmDeviceMap(), getCompensationContext()); }
Source:
@Override public boolean isBrowser() { return super.isBrowser() && !getContext().toLowerCase().contains("NATIVE_APP".toLowerCase()); }

Target:
@Override public boolean isBrowser() { return super.isBrowser() && !containsIgnoreCase(getContext(), "NATIVE_APP"); }
Source:
public void testSortNodes_SubStage() throws Exception { final Diagram<Graph<DefinitionSet, Node>, Metadata> diagram = mock(Diagram.class); final Graph<DefinitionSet, Node> graph = mock(Graph.class); when(diagram.getGraph()).thenReturn(graph); final List<Node> nodes = new LinkedList<>(); when(graph.nodes()).thenReturn(nodes); final Node root = createNode(CaseManagementDiagram.class); final Node start = createNode(StartNoneEvent.class); final Node end = createNode(EndNoneEvent.class); final Node stage = createNode(AdHocSubprocess.class); nodes.add(root); nodes.add(start); nodes.add(end); nodes.add(stage); createChildEdge(root, end); createChildEdge(root, start); createChildEdge(root, stage); createSequenceFlow(start, stage); createSequenceFlow(stage, end); final Node ss1 = createNode(UserTask.class, 3.0); final Node ss2 = createNode(CaseReusableSubprocess.class, 2.0); final Node ss3 = createNode(ProcessReusableSubprocess.class, 1.0); nodes.add(ss1); nodes.add(ss2); nodes.add(ss3); createChildEdge(stage, ss1); createChildEdge(stage, ss2); createChildEdge(stage, ss3); tested.sortNodes(diagram); final List<Edge> rEdges = root.getOutEdges(); assertEquals(3, rEdges.size()); assertEquals(start, rEdges.get(0).getTargetNode()); assertEquals(stage, rEdges.get(1).getTargetNode()); assertEquals(end, rEdges.get(2).getTargetNode()); final List<Edge> sEdges = stage.getOutEdges(); assertEquals(4, sEdges.size()); assertEquals(ss3, sEdges.get(0).getTargetNode()); assertEquals(ss2, sEdges.get(1).getTargetNode()); assertEquals(ss1, sEdges.get(2).getTargetNode()); }

Target:
public void testSortNodes_SubStage() { final Diagram<Graph<DefinitionSet, Node>, Metadata> diagram = mock(Diagram.class); final Graph<DefinitionSet, Node> graph = mock(Graph.class); when(diagram.getGraph()).thenReturn(graph); final List<Node> nodes = new LinkedList<>(); when(graph.nodes()).thenReturn(nodes); final Node root = createNode(CaseManagementDiagram.class); final Node start = createNode(StartNoneEvent.class); final Node end = createNode(EndNoneEvent.class); final Node stage = createNode(AdHocSubprocess.class); nodes.add(root); nodes.add(start); nodes.add(end); nodes.add(stage); createChildEdge(root, end); createChildEdge(root, start); createChildEdge(root, stage); createSequenceFlow(start, stage); createSequenceFlow(stage, end); final Node ss1 = createNode(UserTask.class, 3.0); final Node ss2 = createNode(CaseReusableSubprocess.class, 2.0); final Node ss3 = createNode(ProcessReusableSubprocess.class, 1.0); nodes.add(ss1); nodes.add(ss2); nodes.add(ss3); createChildEdge(stage, ss1); createChildEdge(stage, ss2); createChildEdge(stage, ss3); tested.sortNodes(diagram); final List<Edge> rEdges = root.getOutEdges(); assertEquals(3, rEdges.size()); assertEquals(start, rEdges.get(0).getTargetNode()); assertEquals(stage, rEdges.get(1).getTargetNode()); assertEquals(end, rEdges.get(2).getTargetNode()); final List<Edge> sEdges = stage.getOutEdges(); assertEquals(4, sEdges.size()); assertEquals(ss3, sEdges.get(0).getTargetNode()); assertEquals(ss2, sEdges.get(1).getTargetNode()); assertEquals(ss1, sEdges.get(2).getTargetNode()); }
Source:
private void fillInExistingPVCs(KubernetesEnvironment k8sEnv, String workspaceId) throws InfrastructureException { k8sEnv .getPersistentVolumeClaims() .putAll( factory .create(workspaceId) .persistentVolumeClaims() .getByLabel(CHE_WORKSPACE_ID_LABEL, workspaceId) .stream() .peek(pvc -> pvc.getAdditionalProperties().put(CHE_PROVISIONED_PVC_PROPERTY, true)) .collect(toMap(pvc -> pvc.getMetadata().getName(), Function.identity()))); }

Target:
private void fillInExistingPVCs(KubernetesEnvironment k8sEnv, String workspaceId) throws InfrastructureException { Map<String, PersistentVolumeClaim> existingPVCs = factory .create(workspaceId) .persistentVolumeClaims() .getByLabel(CHE_WORKSPACE_ID_LABEL, workspaceId) .stream() .peek(pvc -> pvc.getAdditionalProperties().put(CHE_PROVISIONED_PVC_PROPERTY, true)) .collect(toMap(pvc -> pvc.getMetadata().getName(), Function.identity())); k8sEnv.getPersistentVolumeClaims().putAll(existingPVCs); }
Source:
public boolean deployAPI(String apiId, String gatewayLabel) throws ArtifactSynchronizerException { if (gatewayArtifactSynchronizerProperties.isRetrieveFromStorageEnabled() && gatewayArtifactSynchronizerProperties.getGatewayLabels().contains(gatewayLabel)) { if (artifactRetriever != null) { try { String gatewayRuntimeArtifact = artifactRetriever.retrieveArtifact(apiId, gatewayLabel, APIConstants.GatewayArtifactSynchronizer.GATEWAY_INSTRUCTION_PUBLISH); if (gatewayRuntimeArtifact != null) { GatewayAPIDTO gatewayAPIDTO = new Gson().fromJson(gatewayRuntimeArtifact, GatewayAPIDTO.class); apiGatewayAdmin.deployAPI(gatewayAPIDTO); if (debugEnabled) { log.debug("API with " + apiId + " is deployed in gateway with the label of " + gatewayLabel); } return true; } else { String msg = "Error retrieving artifacts for API " + apiId + ". Storage returned null"; log.error(msg); throw new ArtifactSynchronizerException(msg); } } catch (IOException | ArtifactSynchronizerException e) { String msg = "\"Error deploying \" + apiId + \" in Gateway\""; log.error(msg, e); throw new ArtifactSynchronizerException(msg, e); } } else { String msg = "Artifact retriever not found"; log.error(msg); throw new ArtifactSynchronizerException(msg); } } return false; }

Target:
public boolean deployAPI(String apiId, String gatewayLabel) throws ArtifactSynchronizerException { if (gatewayArtifactSynchronizerProperties.isRetrieveFromStorageEnabled() && gatewayArtifactSynchronizerProperties.getGatewayLabels().contains(gatewayLabel)) { if (artifactRetriever != null) { try { String gatewayRuntimeArtifact = artifactRetriever.retrieveArtifact(apiId, gatewayLabel, APIConstants.GatewayArtifactSynchronizer.GATEWAY_INSTRUCTION_PUBLISH); if (gatewayRuntimeArtifact != null) { GatewayAPIDTO gatewayAPIDTO = new Gson().fromJson(gatewayRuntimeArtifact, GatewayAPIDTO.class); apiGatewayAdmin.deployAPI(gatewayAPIDTO); if (debugEnabled) { log.debug("API with " + apiId + " is deployed in gateway with the label of " + gatewayLabel); } return true; } else { String msg = "Error retrieving artifacts for API " + apiId + ". Storage returned null"; log.error(msg); throw new ArtifactSynchronizerException(msg); } } catch (IOException | ArtifactSynchronizerException e) { String msg = "Error deploying" + apiId + "in Gateway"; log.error(msg, e); throw new ArtifactSynchronizerException(msg, e); } } else { String msg = "Artifact retriever not found"; log.error(msg); throw new ArtifactSynchronizerException(msg); } } return false; }
Source:
public void writeMixedBadCharacters() throws Exception { OutputStream output = new ByteArrayOutputStream(); write(output, Lists .newArrayList(createTestRepository(kind, firstUrl, labelPropertyKeyCharacters, labelPropertyValue))); String serialized = output.toString(); assertTrue( serialized.contains(("key=\"" + escapeXml(labelPropertyKeyCharacters) + "\"").replace("&apos;", "'"))); assertTrue(serialized.contains("value=\"" + escapeXml(labelPropertyValue) + "\"")); assertEquals(serialized.lastIndexOf(labelPropertyValue), serialized.lastIndexOf(labelPropertyValue)); }

Target:
public void writeMixedBadCharacters() throws Exception { OutputStream output = new ByteArrayOutputStream(); write(output, Lists .newArrayList(createTestRepository(kind, firstUrl, labelPropertyKeyCharacters, labelPropertyValue))); String serialized = output.toString(); assertTrue( serialized.contains(("key=\"" + escapeXml(labelPropertyKeyCharacters) + "\"").replace("&apos;", "'"))); assertTrue(serialized.contains("value=\"" + escapeXml(labelPropertyValue) + "\"")); assertEquals(serialized.lastIndexOf(labelPropertyValue), serialized.indexOf(labelPropertyValue)); }
Source:
protected Class<?> findClass(final String className) throws ClassNotFoundException { final Set<ClassLoader> classLoaders = packageClassLoaderMap.get(getPackageName(className)); if (classLoaders != null) { for (final ClassLoader cl : classLoaders) { try { return Class.forName(className, true, cl); } catch (ClassNotFoundException e) { } } } throw new ClassNotFoundException(className); }

Target:
protected Class<?> findClass(final String className) throws ClassNotFoundException { final Collection<ClassLoader> classLoaders = packageClassLoaderMap.get(getPackageName(className)); for (final ClassLoader cl : classLoaders) { try { return Class.forName(className, true, cl); } catch (ClassNotFoundException e) { } } throw new ClassNotFoundException(className); }
Source:
public void privateField() throws NoSuchFieldException { MemberAccessor memberAccessor = MemberAccessorFactory.buildMemberAccessor( TestdataVisibilityModifierSolution.class.getDeclaredField("privateField"), MemberAccessorFactory.MemberAccessorType.FIELD_OR_GETTER_METHOD_WITH_SETTER, ProblemFactProperty.class); assertEquals("privateField", memberAccessor.getName()); assertEquals(String.class, memberAccessor.getType()); TestdataVisibilityModifierSolution s1 = new TestdataVisibilityModifierSolution("s1", "firstValue", "n/a", "n/a", "n/a", "n/a", "n/a"); assertSame("firstValue", memberAccessor.executeGetter(s1)); memberAccessor.executeSetter(s1, "secondValue"); assertSame("secondValue", memberAccessor.executeGetter(s1)); }

Target:
public void privateField() throws NoSuchFieldException { MemberAccessor memberAccessor = MemberAccessorFactory.buildMemberAccessor( TestdataVisibilityModifierSolution.class.getDeclaredField("privateField"), MemberAccessorFactory.MemberAccessorType.FIELD_OR_GETTER_METHOD_WITH_SETTER, ProblemFactProperty.class); assertInstanceOf(ReflectionFieldMemberAccessor.class, memberAccessor); assertEquals("privateField", memberAccessor.getName()); assertEquals(String.class, memberAccessor.getType()); TestdataVisibilityModifierSolution s1 = new TestdataVisibilityModifierSolution("s1", "firstValue", "n/a", "n/a", "n/a", "n/a", "n/a"); assertEquals("firstValue", memberAccessor.executeGetter(s1)); memberAccessor.executeSetter(s1, "secondValue"); assertEquals("secondValue", memberAccessor.executeGetter(s1)); }
Source:
private String getUniqueId() { String unique = null; Connection conn = null; try { conn = TransactionLegacy.getStandaloneConnection(); PreparedStatement pstmt = conn.prepareStatement("SELECT version,updated FROM version ORDER BY id ASC LIMIT 1"); ResultSet rs = pstmt.executeQuery(); if (rs.next()) { unique = DigestUtils.sha256Hex(rs.getString(1) + rs.getString(2)); } else { s_logger.debug("No rows found in the version table. Unable to obtain unique ID for this environment"); } rs.close(); } catch (SQLException e) { s_logger.debug("Unable to get the unique ID of this environment: " + e.getMessage()); } finally { try { conn.close(); } catch (SQLException e) { } } s_logger.debug("Usage Report Unique ID is: " + unique); return unique; }

Target:
protected String getUniqueId() { VersionVO version = null; String unique = null; try { List<VersionVO> versions = _versionDao.getAllVersions(); if (versions != null && !versions.isEmpty()) { version = versions.get(0); unique = DigestUtils.sha256Hex(version.getVersion() + dateFormat.format(version.getUpdated())); } else { s_logger.info("No rows found in the version table. Unable to obtain unique ID for this environment"); } s_logger.debug("Usage Report Unique ID is: " + unique); return unique; } catch (Exception e) { s_logger.error("Failed to fetch the UniqueID: " + e.getMessage()); return null; } }
Source:
Role(String name, Pattern pattern, Set < Permission > permissions) { this.name = name; this.pattern = pattern; if (permissions.remove(null)) { LOGGER.warning("Found some null permission(s)"); } this.permissions.addAll(permissions); }

Target:
Role(String name, Pattern pattern, Set < Permission > permissions) { this.name = name; this.pattern = pattern; for(Permission perm : permissions) { if(perm == null ){ LOGGER.log(Level.WARNING, "Found some null permission(s) in role " + this.name, new IllegalStateException()); } else { this.permissions.add(perm); } } }
Source:
private Object handleWriteManyOnPrimary(InvocationContext ctx, VisitableCommand command, Object rv) { WriteCommand cmd = (WriteCommand) command; int numKeys = cmd.getAffectedKeys().size(); InternalCacheValue[] values = new InternalCacheValue[numKeys]; int i = 0; ComposedCompletionStage composedCompletionStage = CompletionStages.composedCompletionStage(); for (Object key : cmd.getAffectedKeys()) { RepeatableReadEntry entry = (RepeatableReadEntry) ctx.lookupEntry(key); EntryVersion nextVersion = svm.incrementVersion(keyPartitioner.getSegment(key)); entry.setMetadata(addVersion(entry.getMetadata(), nextVersion)); if (cmd.loadType() == DONT_LOAD) { composedCompletionStage.dependsOn(commitSingleEntryIfNewer(entry, ctx, command)); } else { composedCompletionStage.dependsOn(commitSingleEntryIfNoChange(entry, ctx, command)); } values[i++] = new MetadataImmortalCacheValue(entry.getValue(), entry.getMetadata()); } composedCompletionStage.freeze(); if (cmd.loadType() == DONT_LOAD) { cmd.setFlagsBitSet(cmd.getFlagsBitSet() & ~FlagBitSets.IGNORE_RETURN_VALUES); if (CompletionStages.isComplete(composedCompletionStage)) { return manyWriteResponse(ctx, cmd, values); } return asyncValue(composedCompletionStage).thenApply(ctx, cmd, (rCtx2, rCommand2, rv2) -> manyWriteResponse(rCtx2, cmd, values)); } else { Object[] returnValue = {values, ((List) rv).toArray()}; if (CompletionStages.isComplete(composedCompletionStage)) { return manyWriteResponse(ctx, cmd, returnValue); } return asyncValue(composedCompletionStage).thenApply(ctx, cmd, (rCtx2, rCommand2, rv2) -> manyWriteResponse(ctx, cmd, returnValue)); } }

Target:
private Object handleWriteManyOnPrimary(InvocationContext ctx, VisitableCommand command, Object rv) { WriteCommand cmd = (WriteCommand) command; int numKeys = cmd.getAffectedKeys().size(); InternalCacheValue[] values = new InternalCacheValue[numKeys]; int i = 0; AggregateCompletionStage<Void> aggregateCompletionStage = CompletionStages.aggregateCompletionStage(); for (Object key : cmd.getAffectedKeys()) { RepeatableReadEntry entry = (RepeatableReadEntry) ctx.lookupEntry(key); EntryVersion nextVersion = svm.incrementVersion(keyPartitioner.getSegment(key)); entry.setMetadata(addVersion(entry.getMetadata(), nextVersion)); if (cmd.loadType() == DONT_LOAD) { aggregateCompletionStage.dependsOn(commitSingleEntryIfNewer(entry, ctx, command)); } else { aggregateCompletionStage.dependsOn(commitSingleEntryIfNoChange(entry, ctx, command)); } values[i++] = new MetadataImmortalCacheValue(entry.getValue(), entry.getMetadata()); } CompletionStage<Void> aggregatedStage = aggregateCompletionStage.freeze(); Object returnValue; if (cmd.loadType() == DONT_LOAD) { cmd.setFlagsBitSet(cmd.getFlagsBitSet() & ~FlagBitSets.IGNORE_RETURN_VALUES); returnValue = values; } else { returnValue = new Object[]{values, ((List) rv).toArray()}; } return asyncValue(aggregatedStage).thenApply(ctx, cmd, ((rCtx, rCommand, rv1) -> manyWriteResponse(rCtx, cmd, returnValue))); }
Source:
public static void main(String[] args) throws Exception { final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setDegreeOfParallelism(4); DataSet<String> text = env.fromElements("To be", "or not to be", "or to be still", "and certainly not to be not at all", "is that the question?"); DataSet<WC> tokenized = text.flatMap(new Tokenizer()); DataSet<WC> result = tokenized .groupBy(new KeySelector<WC, String>() { public String getKey(WC v) { return v.word; } }) .reduce(new ReduceFunction<WC>() { private Collection<DataSet<?>> i; @Override public void open(Configuration parameters) throws Exception { i = this.getRuntimeContext().getBroadcastVariable("lol"); } public WC reduce(WC value1, WC value2) { return new WC(value1.word, value1.count + value2.count); } }).withBroadcastSet(null, null); result.print(); env.execute(); }

Target:
public static void main(String[] args) throws Exception { final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); env.setDegreeOfParallelism(4); DataSet<String> text = env.fromElements("To be", "or not to be", "or to be still", "and certainly not to be not at all", "is that the question?"); DataSet<WC> tokenized = text.flatMap(new Tokenizer()); DataSet<WC> result = tokenized .groupBy(new KeySelector<WC, String>() { public String getKey(WC v) { return v.word; } }) .reduce(new ReduceFunction<WC>() { public WC reduce(WC value1, WC value2) { return new WC(value1.word, value1.count + value2.count); } }); result.print(); env.execute(); }
Source:
public DefaultCompilationResponse(final Boolean successful, final List<String> mavenOutput, final Path workingDir, final List<String> projectDependencies, final String requestUUID) { this.successful = successful; if(mavenOutput != null) { this.mavenOutput = new ArrayList<>(mavenOutput); }else{ this.mavenOutput = Collections.emptyList(); } if(projectDependencies != null) { this.projectDependencies = new ArrayList<>(projectDependencies); }else{ this.projectDependencies = Collections.emptyList(); } this.workingDir = workingDir; this.requestUUID = requestUUID; }

Target:
public DefaultCompilationResponse(final Boolean successful, final List<String> mavenOutput, final Path workingDir, final List<String> projectDependencies, final String requestUUID) { this(successful,mavenOutput,workingDir, Collections.emptyList(), projectDependencies, requestUUID); }
Source:
public RollbackOptions update(UpdateOptions opt) throws PackageException { String key = getKey(opt); Entry entry = registry.get(key); if (entry == null) { entry = createEntry(key); } else if (!entry.hasBaseVersion() && entry.getLastVersion(false) == null) { if (updateBaseVersion(entry)) { log.warn("Registry repaired: JAR introduced without corresponding entry in the registry (copy task?) : " + key); } } Version v = entry.getVersion(opt.version); boolean newVersion = v == null; if (v == null) { v = entry.addVersion(new Version(opt.getVersion())); v.setPath(getVersionPath(opt)); } v.addPackage(opt); if (newVersion || opt.isSnapshotVersion()) { backupFile(opt.getFile(), v.getPath()); } Match<File> currentJar = findInstalledJar(key); UpdateOptions optToUpdate = shouldUpdate(key, opt, currentJar); if (optToUpdate != null) { File currentFile = currentJar != null ? currentJar.object : null; doUpdate(currentFile, optToUpdate); } return new RollbackOptions(key, opt); }

Target:
public RollbackOptions update(UpdateOptions opt) throws PackageException { String key = getKey(opt); Entry entry = registry.get(key); if (entry == null) { entry = createEntry(key); } else if (!entry.hasBaseVersion() && entry.getLastVersion(false) == null) { if (createBaseVersion(entry)) { log.warn("Registry repaired: JAR introduced without corresponding entry in the registry (copy task?) : " + key); } } Version v = entry.getVersion(opt.version); boolean newVersion = v == null; if (v == null) { v = entry.addVersion(new Version(opt.getVersion())); v.setPath(getVersionPath(opt)); } v.addPackage(opt); if (newVersion || opt.isSnapshotVersion()) { backupFile(opt.getFile(), v.getPath()); } Match<File> currentJar = findInstalledJar(key); UpdateOptions optToUpdate = shouldUpdate(key, opt, currentJar); if (optToUpdate != null) { File currentFile = currentJar != null ? currentJar.object : null; doUpdate(currentFile, optToUpdate); } return new RollbackOptions(key, opt); }
Source:
public void onDisconnected() { LOG.info("ConsumerConnector shutting down"); try { scheduler.shutdown(); for (Map.Entry<String, List<FetcherRunnable>> entry : consumerThreadsMap.entrySet()) { for (FetcherRunnable fetcherThread : entry.getValue()) { try { fetcherThread.shutdown(); } catch (InterruptedException e) { LOG.warn(e.getMessage(), e); } } LOG.debug("Clear consumer=>fetcherthread map. KEY[" + entry.getKey() + "]"); entry.getValue().clear(); } for (Map.Entry<String, BlockingQueue<FetchedDataChunk>> entry : queues.entrySet()) { LOG.debug("Clear consumer=>queue map. KEY[" + entry.getKey() + "]"); entry.getValue().clear(); try { entry.getValue().put(SHUTDOWN_COMMAND); } catch (InterruptedException e) { LOG.warn(e.getMessage(), e); } } if (Consumer.config.isAutoCommit()) { commitOffsets(); } for (Map.Entry<String, Map<String, PartitionTopicInfo>> entry : allPartitions.entrySet()) { LOG.debug("Clear consumer=>partition map. KEY[" + entry.getKey() + "]"); entry.getValue().clear(); } consumerThreadsMap.clear(); queues.clear(); topicToConsumerMap.clear(); allPartitions.clear(); } catch (Exception e) { LOG.error("error during consumer connector shutdown", e); } LOG.info("ConsumerConnector shut down completed"); }

Target:
public void onDisconnected() { LOG.info("ConsumerConnector shutting down"); try { scheduler.shutdown(); for (Map.Entry<String, List<FetcherRunnable>> entry : consumerThreadsMap.entrySet()) { for (FetcherRunnable fetcherThread : entry.getValue()) { try { fetcherThread.shutdown(); } catch (InterruptedException e) { LOG.warn(e.getMessage(), e); } } LOG.debug("Clear consumer=>fetcherthread map. KEY[" + entry.getKey() + "]"); } for (Map.Entry<String, BlockingQueue<FetchedDataChunk>> entry : queues.entrySet()) { LOG.debug("Clear consumer=>queue map. KEY[" + entry.getKey() + "]"); entry.getValue().clear(); try { entry.getValue().put(SHUTDOWN_COMMAND); } catch (InterruptedException e) { LOG.warn(e.getMessage(), e); } } consumerThreadsMap.clear(); queues.clear(); allPartitions.clear(); } catch (Exception e) { LOG.error("error during consumer connector shutdown", e); } LOG.info("ConsumerConnector shut down completed"); }
Source:
public CommitValidationException(String reason) { super(reason); this.messages = Collections.<CommitValidationMessage>emptyList(); }

Target:
public CommitValidationException(String reason) { super(reason); this.messages = Collections.emptyList(); }
Source:
public ResponseEntity<Map<String, Object>> handleTypeMismatchError(TypeMismatchException ex){ ErrorReason errorStatus = ErrorReason.WRONG_REQUEST_PARAMETER_ERROR; ErrorRepresentation.Builder builder = create(errorStatus, ex); builder.propertyName(ex.getPropertyName()); String message = String.format("parameter can't have value '%s'", ex.getValue()); builder.message(message); return createErrorResponse(builder, errorStatus); }

Target:
public ResponseEntity<Map<String, Object>> handleTypeMismatchError(TypeMismatchException ex){ ErrorReason errorStatus = ErrorReason.WRONG_REQUEST_PARAMETER_ERROR; ErrorRepresentation.Builder builder = create(errorStatus, ex); builder.propertyName(ex.getPropertyName()); String message = String.format("incorrect parameter value '%s'", ex.getValue()); builder.message(message); return createErrorResponse(builder, errorStatus); }
Source:
private String loadMostRecentArtifact(String location, String host, Integer port) { JSONObject json = getArtifactMetadata(location, host, port); if (json == null) { LOG.error("got null metadata"); return null; } @SuppressWarnings("checkstyle:AbbreviationAsWordInName") String downloadURI = (String) json.get("downloadUri"); if (downloadURI != null) { String returnValue = doGet(null, location, host, port); saveInArtifactoryCache(returnValue); return returnValue; } JSONArray msg = (JSONArray) json.get("children"); if (msg == null || msg.size() == 0) { LOG.error("Expected directory children not present"); return null; } JSONObject newest = (JSONObject) Collections.max(msg, new DirEntryCompare()); if (newest == null) { LOG.error("Failed to find most recent artifact uri in {}", location); return null; } String uri = (String) newest.get("uri"); if (uri == null) { LOG.error("Expected directory uri not present"); return null; } String returnValue = doGet(null, location + uri, host, port); saveInArtifactoryCache(returnValue); return returnValue; }

Target:
private String loadMostRecentArtifact(String location, String host, Integer port) { JSONObject json = getArtifactMetadata(location, host, port); if (json == null) { LOG.error("got null metadata"); return null; } String downloadUri = (String) json.get("downloadUri"); if (downloadUri != null) { String returnValue = doGet(null, location, host, port); saveInArtifactoryCache(returnValue); return returnValue; } JSONArray msg = (JSONArray) json.get("children"); if (msg == null || msg.size() == 0) { LOG.error("Expected directory children not present"); return null; } JSONObject newest = (JSONObject) Collections.max(msg, new DirEntryCompare()); if (newest == null) { LOG.error("Failed to find most recent artifact uri in {}", location); return null; } String uri = (String) newest.get("uri"); if (uri == null) { LOG.error("Expected directory uri not present"); return null; } String returnValue = doGet(null, location + uri, host, port); saveInArtifactoryCache(returnValue); return returnValue; }
Source:
public void createConnectionTest() throws TimeoutException, Exception { IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout); EntityBareJid userTwo = conTwo.getUser().asEntityBareJid(); final String messageBody = "Hello from the other side!"; Message message = conTwo.getStanzaFactory().buildMessageStanza() .to(userTwo) .setBody(messageBody) .build(); final SimpleResultSyncPoint messageReceived = new SimpleResultSyncPoint(); final StanzaListener stanzaListener = new StanzaListener() { @Override public void processStanza(Stanza stanza) { Message message = (Message) stanza; if (message.getBody().equals(messageBody)) { messageReceived.signal(); } } }; conTwo.addAsyncStanzaListener(stanzaListener, MessageWithBodiesFilter.INSTANCE); try { conOne.sendStanza(message); messageReceived.waitForResult(timeout); } finally { conTwo.removeAsyncStanzaListener(stanzaListener); } }

Target:
public void createConnectionTest() throws TimeoutException, Exception { EntityFullJid userTwo = conTwo.getUser(); final String messageBody = testRunId + ": Hello from the other side!"; Message message = conTwo.getStanzaFactory().buildMessageStanza() .to(userTwo) .setBody(messageBody) .build(); final SimpleResultSyncPoint messageReceived = new SimpleResultSyncPoint(); final StanzaListener stanzaListener = (Stanza stanza) -> { if (((Message) stanza).getBody().equals(messageBody)) { messageReceived.signal(); } }; conTwo.addAsyncStanzaListener(stanzaListener, MessageWithBodiesFilter.INSTANCE); try { conOne.sendStanza(message); messageReceived.waitForResult(timeout); } finally { conTwo.removeAsyncStanzaListener(stanzaListener); } }
Source:
public void checkConfig() { assertNotNull(gateway); assertThat((Boolean) getPropertyValue(gateway, "expectReply"), is(true)); assertThat((Boolean) getPropertyValue(gateway, "convertExceptions"), is(true)); assertThat((PollableChannel) getPropertyValue(gateway, "replyChannel"), is(responses)); assertNotNull(TestUtils.getPropertyValue(gateway, "errorChannel")); MessagingTemplate messagingTemplate = TestUtils.getPropertyValue( gateway, "messagingTemplate", MessagingTemplate.class); assertEquals(Long.valueOf(1234), TestUtils.getPropertyValue(messagingTemplate, "sendTimeout")); assertEquals(Long.valueOf(4567), TestUtils.getPropertyValue(messagingTemplate, "receiveTimeout")); boolean registerDefaultConverters = TestUtils.getPropertyValue(gateway,"registerDefaultConverters", Boolean.class); assertThat(registerDefaultConverters, is(true)); @SuppressWarnings("unchecked") List<HttpMessageConverter<?>> messageConverters = TestUtils.getPropertyValue(gateway,"messageConverters", List.class); assertThat(messageConverters.size()>0, is(true)); }

Target:
public void checkConfig() { assertNotNull(gateway); assertThat((Boolean) getPropertyValue(gateway, "expectReply"), is(true)); assertThat((Boolean) getPropertyValue(gateway, "convertExceptions"), is(true)); assertThat((PollableChannel) getPropertyValue(gateway, "replyChannel"), is(responses)); assertNotNull(TestUtils.getPropertyValue(gateway, "errorChannel")); MessagingTemplate messagingTemplate = TestUtils.getPropertyValue( gateway, "messagingTemplate", MessagingTemplate.class); assertEquals(Long.valueOf(1234), TestUtils.getPropertyValue(messagingTemplate, "sendTimeout")); assertEquals(Long.valueOf(4567), TestUtils.getPropertyValue(messagingTemplate, "receiveTimeout")); boolean registerDefaultConverters = TestUtils.getPropertyValue(gateway,"mergeWithDefaultConverters", Boolean.class); assertFalse("By default the register-default-converters flag should be false", registerDefaultConverters); @SuppressWarnings("unchecked") List<HttpMessageConverter<?>> messageConverters = TestUtils.getPropertyValue(gateway,"messageConverters", List.class); assertTrue("The default converters should have been registered, given there are no custom converters", messageConverters.size() > 0); }
Source:
public static void connect(Socket socket, SocketAddress endpoint, SocketAddress localAddr, int timeout) throws IOException { if (socket == null || endpoint == null || timeout < 0) { throw new IllegalArgumentException("Illegal argument for connect()"); } SocketChannel ch = socket.getChannel(); if (localAddr != null) { Class localClass = localAddr.getClass(); Class remoteClass = endpoint.getClass(); Preconditions.checkArgument(localClass.equals(remoteClass), "Local address %s must be of same family as remote address %s.", localAddr, endpoint); socket.bind(localAddr); } try { if (ch == null) { socket.connect(endpoint, timeout); } else { SocketIOWithTimeout.connect(ch, endpoint, timeout); } LOG.info("endpoint : , timeout : connect successful",endpoint,timeout); } catch (SocketTimeoutException ste) { throw new ConnectTimeoutException(ste.getMessage()); } if (socket.getLocalPort() == socket.getPort() && socket.getLocalAddress().equals(socket.getInetAddress())) { LOG.info("Detected a loopback TCP socket, disconnecting it"); socket.close(); throw new ConnectException( "Localhost targeted connection resulted in a loopback. " + "No daemon is listening on the target port."); } }

Target:
public static void connect(Socket socket, SocketAddress endpoint, SocketAddress localAddr, int timeout) throws IOException { if (socket == null || endpoint == null || timeout < 0) { throw new IllegalArgumentException("Illegal argument for connect()"); } SocketChannel ch = socket.getChannel(); if (localAddr != null) { Class localClass = localAddr.getClass(); Class remoteClass = endpoint.getClass(); Preconditions.checkArgument(localClass.equals(remoteClass), "Local address %s must be of same family as remote address %s.", localAddr, endpoint); socket.bind(localAddr); } try { if (ch == null) { socket.connect(endpoint, timeout); } else { SocketIOWithTimeout.connect(ch, endpoint, timeout); } LOG.info("endpoint : , timeout : connected successful",endpoint,timeout); } catch (SocketTimeoutException ste) { throw new ConnectTimeoutException(ste.getMessage()); } if (socket.getLocalPort() == socket.getPort() && socket.getLocalAddress().equals(socket.getInetAddress())) { LOG.info("Detected a loopback TCP socket, disconnecting it"); socket.close(); throw new ConnectException( "Localhost targeted connection resulted in a loopback. " + "No daemon is listening on the target port."); } }
Source:
public List<Map<String, Object>> getApplications() { try { return appService .getApplications() .stream() .map(this::convertApplicationEntries) .collect(Collectors.toList()); } catch (Exception e) { LOGGER.error("Could not get applications", e); throw new ApplicationServiceBeanException("Could not get applications"); } }

Target:
public List<Map<String, Object>> getApplications() { try { return appService .getApplications() .stream() .filter( app -> !getPluginsForApplication(app.getName()).isEmpty() || !getServices(app.getName()).isEmpty()) .map(this::convertApplicationEntries) .collect(Collectors.toList()); } catch (VirtualMachineError e) { throw e; } catch (Throwable e) { LOGGER.info("Could not retrieve applications", e); throw new ApplicationServiceBeanException("Could not retrieve applications"); } }
Source:
private Object applyUpdateUnsafe(SMRRecord record) { log.trace("Apply[{}] of {}@{} ({})", this, record.getSMRMethod(), Address.isAddress(record.getGlobalAddress()) ? record.getGlobalAddress() : "OPT", record.getSMRArguments()); ICorfuSMRUpcallTarget<T> target = upcallTargetMap.get(record.getSMRMethod()); if (target == null) { throw new RuntimeException("Unknown upcall " + record.getSMRMethod()); } if (!record.isUndoable() || !Address.isAddress(record.getGlobalAddress())) { IUndoRecordFunction<T> undoRecordTarget = undoRecordFunctionMap.get(record.getSMRMethod()); if (undoRecordTarget != null) { record.setUndoRecord(undoRecordTarget .getUndoRecord(object, record.getSMRArguments())); log.trace("Apply[{}] Undo->{}", this, record.getUndoRecord()); } else if (resetSet.contains(record.getSMRMethod())) { record.setUndoRecord(object); object = newObjectFn.get(); log.trace("Apply[{}] Undo->RESET", this); } } if (record.locator != null && record.locator.getGlobalAddress() >= syncTail) { IGarbageIdentifyFunction<T> garbageIdentifyFunction = garbageIdentifyFunctionMap.get(record.getSMRMethod()); if (garbageIdentifyFunction != null) { List<Object> garbage = garbageIdentifyFunction.identify(record.locator, record.getSMRArguments()); } syncTail = record.locator.getGlobalAddress(); } return target.upcall(object, record.getSMRArguments()); }

Target:
private Object applyUpdateUnsafe(SMRRecord record) { log.trace("Apply[{}] of {}@{} ({})", this, record.getSMRMethod(), Address.isAddress(record.getGlobalAddress()) ? record.getGlobalAddress() : "OPT", record.getSMRArguments()); ICorfuSMRUpcallTarget<T> target = upcallTargetMap.get(record.getSMRMethod()); if (target == null) { throw new RuntimeException("Unknown upcall " + record.getSMRMethod()); } if (!record.isUndoable() || !Address.isAddress(record.getGlobalAddress())) { IUndoRecordFunction<T> undoRecordTarget = undoRecordFunctionMap.get(record.getSMRMethod()); if (undoRecordTarget != null) { record.setUndoRecord(undoRecordTarget .getUndoRecord(object, record.getSMRArguments())); log.trace("Apply[{}] Undo->{}", this, record.getUndoRecord()); } else if (resetSet.contains(record.getSMRMethod())) { record.setUndoRecord(object); object = newObjectFn.get(); log.trace("Apply[{}] Undo->RESET", this); } } return target.upcall(object, record.getSMRArguments()); }
Source:
public Response createFedoraWebacAcl(@HeaderParam(CONTENT_TYPE) final MediaType requestContentType, final InputStream requestBodyStream) { if (resource().isAcl() || resource().isMemento()) { throw new BadRequestException("ACL resource creation is not allowed for resource " + resource().getId()); } LOGGER.info("PUT acl resource '{}'", externalPath()); final FedoraId aclId = identifierConverter().pathToInternalId(externalPath()).resolve(FCR_ACL); final boolean exists = resourceFactory.doesResourceExist(transaction(), aclId); final MediaType contentType = requestContentType == null ? RDFMediaType.TURTLE_TYPE : valueOf(getSimpleContentType(requestContentType)); if (isRdfContentType(contentType.toString())) { final Model model = httpRdfService.bodyToInternalModel(aclId.getFullId(), requestBodyStream, contentType, identifierConverter()); if (exists) { replacePropertiesService.perform(transaction().getId(), getUserPrincipal(), aclId, model); } else { webacAclService.create(transaction(), aclId, getUserPrincipal(), model); } } else { throw new BadRequestException("Content-Type (" + requestContentType + ") is invalid. Try text/turtle " + "or other RDF compatible type."); } transaction().commit(); final FedoraResource aclResource = getFedoraResource(transaction(), aclId); addCacheControlHeaders(servletResponse, aclResource, transaction()); final URI location = getUri(aclResource); if (!exists) { return created(location).build(); } else { return noContent().location(location).build(); } }

Target:
public Response createFedoraWebacAcl(@HeaderParam(CONTENT_TYPE) final MediaType requestContentType, final InputStream requestBodyStream) { if (resource().isAcl() || resource().isMemento()) { throw new BadRequestException("ACL resource creation is not allowed for resource " + resource().getId()); } LOGGER.info("PUT acl resource '{}'", externalPath()); final FedoraId aclId = identifierConverter().pathToInternalId(externalPath()).resolve(FCR_ACL); final boolean exists = resourceFactory.doesResourceExist(transaction(), aclId); final MediaType contentType = requestContentType == null ? RDFMediaType.TURTLE_TYPE : valueOf(getSimpleContentType(requestContentType)); if (isRdfContentType(contentType.toString())) { final Model model = httpRdfService.bodyToInternalModel(aclId.getFullId(), requestBodyStream, contentType, identifierConverter()); if (exists) { replacePropertiesService.perform(transaction().getId(), getUserPrincipal(), aclId, model); } else { webacAclService.create(transaction(), aclId, getUserPrincipal(), model); } } else { throw new BadRequestException("Content-Type (" + requestContentType + ") is invalid. Try text/turtle " + "or other RDF compatible type."); } transaction().commitIfShortLived(); final FedoraResource aclResource = getFedoraResource(transaction(), aclId); addCacheControlHeaders(servletResponse, aclResource, transaction()); final URI location = getUri(aclResource); if (!exists) { return created(location).build(); } else { return noContent().location(location).build(); } }
Source:
public void hasSameOrderableAs_shouldReturnFalseIfTheConceptsMatchAndEitherOfDrugNonCodedIsNull() throws Exception { DrugOrder order = new DrugOrder(); Concept concept = new Concept(); order.setDrugNonCoded("Chrocine"); DrugOrder otherOrder = new DrugOrder(); otherOrder.setConcept(concept); assertFalse(order.hasSameOrderableAs(otherOrder)); }

Target:
public void hasSameOrderableAs_shouldReturnFalseIfTheConceptsMatchAndEitherOfDrugNonCodedIsNull() throws Exception { DrugOrder order = new DrugOrder(); Concept concept = new Concept(); order.setConcept(concept); order.setDrugNonCoded("Chrocine"); DrugOrder otherOrder = new DrugOrder(); otherOrder.setConcept(concept); assertFalse(order.hasSameOrderableAs(otherOrder)); }
Source:
protected void testSchemaOfSubsystemTemplates() throws Exception { String schemaPath = getSubsystemXsdPath(); Assume.assumeTrue("getSubsystemXsdPath() has been overridden to disable the validation of the subsystem templates", schemaPath != null); String[] templates = getSubsystemTemplatePaths(); Assume.assumeTrue("Override getSubsystemTemplatePaths() to activate the validation of the subsystem templates", templates != null && templates.length > 0); for (String template : templates) { String content = readResource(template); SchemaValidator.validateXML(content, "subsystem", schemaPath, getResolvedProperties()); } }

Target:
protected void testSchemaOfSubsystemTemplates() throws Exception { String schemaPath = getSubsystemXsdPath(); Assert.assertTrue("getSubsystemXsdPath() needs to be overridden to enable the validation of the subsystem templates", schemaPath != null); String[] templates = getSubsystemTemplatePaths(); Assert.assertTrue("Override getSubsystemTemplatePaths() to activate the validation of the subsystem templates", templates != null && templates.length > 0); for (String template : templates) { String content = readResource(template); SchemaValidator.validateXML(content, "subsystem", schemaPath, getResolvedProperties()); } }
Source:
public void addTheFetchedPhoto() { waitForElementByElement(fetchedPhoto); clickAndWait(fetchedPhoto); PageObjectLogging.log("addTheFetchedPhoto", "add the fetched photo", true, driver); }

Target:
public void addTheFetchedPhoto() { waitForElementByElement(fetchedPhoto); scrollAndClick(fetchedPhoto); PageObjectLogging.log("addTheFetchedPhoto", "add the fetched photo", true, driver); }
Source:
public ObjectStat statObject(String bucketName, String objectName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { HttpResponse response = executeHead(bucketName, objectName); ResponseHeader header = response.header(); ObjectStat objectStat = null; if ((header.xamzMetaKey() != null) && (header.xamzMetaIv() != null)) { objectStat = new ObjectStat(bucketName, objectName, header); } else { objectStat = new ObjectStat(bucketName, objectName, header.lastModified(), header.contentLength(), header.etag(), header.contentType()); } return objectStat; }

Target:
public ObjectStat statObject(String bucketName, String objectName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { HttpResponse response = executeHead(bucketName, objectName); ResponseHeader header = response.header(); ObjectStat objectStat = new ObjectStat(bucketName, objectName, header); return objectStat; }
Source:
public String toString() { return "LongFirstAggregatorFactory{" + "name='" + name + '\'' + ", fieldName='" + fieldName + '\'' + '}'; }

Target:
public String toString() { return "DoubleFirstAggregatorFactory{" + "name='" + name + '\'' + ", fieldName='" + fieldName + '\'' + '}'; }
Source:
private static boolean isLongOrNarrower(Object value) { return (value instanceof Long || value instanceof Short || value instanceof Byte); }

Target:
private static boolean isLongOrNarrower(Object value) { return (value instanceof Long || isIntegerOrNarrower(value)); }
Source:
public void makeBusinessObjectActiveIfApplicable(T xmlObject, R newBusinessObject) { if (newBusinessObject instanceof MutableInactivatable) { ((MutableInactivatable) newBusinessObject).setActive(true); } }

Target:
public <T extends RassXmlObject, R extends PersistableBusinessObject> void makeBusinessObjectActiveIfApplicable(T xmlObject, R newBusinessObject) { if (newBusinessObject instanceof MutableInactivatable) { ((MutableInactivatable) newBusinessObject).setActive(true); } }
Source:
public Iterator<K> wrapIterator(final Iterator<K> iterator, final boolean includeUncommitted) { return new Iterator<K>() { private K current; private void fetchNext() { while (iterator.hasNext()) { current = iterator.next(); if (includeUncommitted) { return; } if (containsKey(current)) { return; } } current = null; } @Override public boolean hasNext() { if(current == null) { fetchNext(); } return current != null; } @Override public K next() { if(!hasNext()) { throw new NoSuchElementException(); } assert current != null; K result = current; current = null; return result; } @Override public void remove() { throw DataUtils.newUnsupportedOperationException( "Removal is not supported"); } }; }

Target:
public Iterator<K> wrapIterator(final Iterator<K> iterator, final boolean includeUncommitted) { return new Iterator<K>() { private K current; { fetchNext(); } private void fetchNext() { while (iterator.hasNext()) { current = iterator.next(); if (includeUncommitted) { return; } if (containsKey(current)) { return; } } current = null; } @Override public boolean hasNext() { return current != null; } @Override public K next() { K result = current; fetchNext(); return result; } @Override public void remove() { throw DataUtils.newUnsupportedOperationException( "Removal is not supported"); } }; }
Source:
public boolean equals(byte[] object, ByteBuffer binary) throws ClassNotFoundException, SerializerException { return Arrays.equals(read(binary), object); }

Target:
public boolean equals(byte[] object, ByteBuffer binary) throws ClassNotFoundException, SerializerException { boolean equals = binary.equals(serialize(object)); binary.position(binary.limit()); return equals; }
Source:
protected ImmutableList<String> _call() { Builder<String> cleaned = new ImmutableList.Builder<String>(); Optional<Ref> ref = command(RefParse.class).setName(Ref.MERGE_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.MERGE_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.MERGE_HEAD).call(); } ref = command(RefParse.class).setName(Ref.ORIG_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.ORIG_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.ORIG_HEAD).call(); } ref = command(RefParse.class).setName(Ref.CHERRY_PICK_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.CHERRY_PICK_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.CHERRY_PICK_HEAD).call(); } BlobStore blobStore = context.blobStore(); Optional<InputStream> blobAsStream = blobStore.getBlobAsStream(MergeOp.MERGE_MSG); if (blobAsStream.isPresent()) { cleaned.add(MergeOp.MERGE_MSG); blobStore.removeBlob(MergeOp.MERGE_MSG); } return cleaned.build(); }

Target:
protected ImmutableList<String> _call() { Builder<String> cleaned = new ImmutableList.Builder<String>(); Optional<Ref> ref = command(RefParse.class).setName(Ref.MERGE_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.MERGE_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.MERGE_HEAD).call(); } ref = command(RefParse.class).setName(Ref.ORIG_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.ORIG_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.ORIG_HEAD).call(); } ref = command(RefParse.class).setName(Ref.CHERRY_PICK_HEAD).call(); if (ref.isPresent()) { cleaned.add(Ref.CHERRY_PICK_HEAD); command(UpdateRef.class).setDelete(true).setName(Ref.CHERRY_PICK_HEAD).call(); } BlobStore blobStore = context.blobStore(); Optional<String> blob = Blobs.getBlobAsString(blobStore, MergeOp.MERGE_MSG); if (blob.isPresent()) { cleaned.add(MergeOp.MERGE_MSG); blobStore.removeBlob(MergeOp.MERGE_MSG); } return cleaned.build(); }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SchemaCompatibilityResult other = (SchemaCompatibilityResult) obj; if (mMessage == null) { if (other.mMessage != null) return false; } else if (!mMessage.equals(other.mMessage)) return false; if (mReaderSubset == null) { if (other.mReaderSubset != null) return false; } else if (!mReaderSubset.equals(other.mReaderSubset)) return false; if (mCompatibility != other.mCompatibility) return false; if (mSchemaIncompatibilityType != other.mSchemaIncompatibilityType) return false; if (mWriterSubset == null) { if (other.mWriterSubset != null) return false; } else if (!mWriterSubset.equals(other.mWriterSubset)) return false; return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SchemaCompatibilityResult other = (SchemaCompatibilityResult) obj; if (mMessage == null) { if (other.mMessage != null) { return false; } } else if (!mMessage.equals(other.mMessage)) { return false; } if (mReaderSubset == null) { if (other.mReaderSubset != null) { return false; } } else if (!mReaderSubset.equals(other.mReaderSubset)) { return false; } if (mCompatibility != other.mCompatibility) { return false; } if (mSchemaIncompatibilityType != other.mSchemaIncompatibilityType) { return false; } if (mWriterSubset == null) { if (other.mWriterSubset != null) { return false; } } else if (!mWriterSubset.equals(other.mWriterSubset)) { return false; } return true; }