auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static List<AnnotationRange> prepareAnnotationRanges( int start, int end, @Nullable Editor editor, @NotNull User user, @NotNull IFile file) { List<AnnotationRange> annotationRanges = new ArrayList<>(); TextAttributes contributionTextAttributes; if (editor != null) { contributionTextAttributes = getContributionTextAttributes(editor, user); } else { contributionTextAttributes = null; } for (int i = 0; i < end - start; i++) { int currentStart = start + i; int currentEnd = start + i + 1; AnnotationRange annotationRange; if (editor != null) { RangeHighlighter rangeHighlighter = addRangeHighlighter(currentStart, currentEnd, editor, contributionTextAttributes, file); if (rangeHighlighter == null) { throw new IllegalStateException( "Failed to create range highlighter for range (" + currentStart + "," + currentEnd + ") for file " + file); } annotationRange = new AnnotationRange(currentStart, currentEnd, rangeHighlighter); } else { annotationRange = new AnnotationRange(currentStart, currentEnd); } annotationRanges.add(annotationRange); } return annotationRanges; }

Target:
private static List<AnnotationRange> prepareAnnotationRanges( int start, int end, @Nullable Editor editor, @NotNull User user, @NotNull IFile file) { checkRange(start, end); List<AnnotationRange> annotationRanges = new ArrayList<>(); TextAttributes contributionTextAttributes; if (editor != null) { contributionTextAttributes = getContributionTextAttributes(editor, user); } else { contributionTextAttributes = null; } for (int currentStart = start; currentStart < end; currentStart++) { int currentEnd = currentStart + 1; AnnotationRange annotationRange; if (editor != null) { RangeHighlighter rangeHighlighter = addRangeHighlighter(currentStart, currentEnd, editor, contributionTextAttributes, file); if (rangeHighlighter == null) { throw new IllegalStateException( "Failed to create range highlighter for range (" + currentStart + "," + currentEnd + ") for file " + file); } annotationRange = new AnnotationRange(currentStart, currentEnd, rangeHighlighter); } else { annotationRange = new AnnotationRange(currentStart, currentEnd); } annotationRanges.add(annotationRange); } return annotationRanges; }
Source:
public long count(String name, String namePattern, Optional<HivePrincipal> principal) { CriteriaBuilder cb = criteriaBuilder(); CriteriaQuery<DeviceType> criteria = cb.createQuery(DeviceType.class); Root<DeviceType> from = criteria.from(DeviceType.class); Predicate[] nameAndPrincipalPredicates = CriteriaHelper.deviceTypeListPredicates(cb, from, ofNullable(name), ofNullable(namePattern), principal); criteria.where(nameAndPrincipalPredicates); TypedQuery<DeviceType> query = createQuery(criteria); return query.getResultList().size(); }

Target:
public long count(String name, String namePattern, Optional<HivePrincipal> principal) { CriteriaBuilder cb = criteriaBuilder(); CriteriaQuery<Long> criteria = cb.createQuery(Long.class); Root<DeviceType> from = criteria.from(DeviceType.class); Predicate[] nameAndPrincipalPredicates = CriteriaHelper.deviceTypeListPredicates(cb, from, ofNullable(name), ofNullable(namePattern), principal); criteria.where(nameAndPrincipalPredicates); criteria.select(cb.count(from)); return count(criteria); }
Source:
public void setUp() throws Exception { Calcites.setSystemProperties(); new ApproximateHistogramDruidModule().configure(null); final QueryableIndex index = IndexBuilder.create() .tmpDir(temporaryFolder.newFolder()) .indexMerger(TestHelper.getTestIndexMergerV9()) .schema( new IncrementalIndexSchema.Builder() .withMetrics( new CountAggregatorFactory("cnt"), new DoubleSumAggregatorFactory("m1", "m1"), new ApproximateHistogramAggregatorFactory( "hist_m1", "m1", null, null, null, null ) ) .withRollup(false) .build() ) .rows(CalciteTests.ROWS1) .buildMMappedIndex(); walker = new SpecificSegmentsQuerySegmentWalker(CalciteTests.queryRunnerFactoryConglomerate()).add( DataSegment.builder() .dataSource(DATA_SOURCE) .interval(index.getDataInterval()) .version("1") .shardSpec(new LinearShardSpec(0)) .build(), index ); final PlannerConfig plannerConfig = new PlannerConfig(); final DruidSchema druidSchema = CalciteTests.createMockSchema(walker, plannerConfig); final DruidOperatorTable operatorTable = new DruidOperatorTable( ImmutableSet.of(new QuantileSqlAggregator()), ImmutableSet.of() ); final Map<String, Authenticator> defaultMap = Maps.newHashMap(); defaultMap.put("allowAll", new AllowAllAuthenticator()); plannerFactory = new PlannerFactory( druidSchema, CalciteTests.createMockQueryLifecycleFactory(walker), operatorTable, CalciteTests.createExprMacroTable(), plannerConfig, new AuthConfig(), new AuthenticatorMapper(defaultMap, "allowAll"), new AuthorizerMapper(null) { @Override public Authorizer getAuthorizer(String name) { return new AllowAllAuthorizer(); } }, CalciteTests.getJsonMapper() ); }

Target:
public void setUp() throws Exception { Calcites.setSystemProperties(); new ApproximateHistogramDruidModule().configure(null); final QueryableIndex index = IndexBuilder.create() .tmpDir(temporaryFolder.newFolder()) .indexMerger(TestHelper.getTestIndexMergerV9()) .schema( new IncrementalIndexSchema.Builder() .withMetrics( new CountAggregatorFactory("cnt"), new DoubleSumAggregatorFactory("m1", "m1"), new ApproximateHistogramAggregatorFactory( "hist_m1", "m1", null, null, null, null ) ) .withRollup(false) .build() ) .rows(CalciteTests.ROWS1) .buildMMappedIndex(); walker = new SpecificSegmentsQuerySegmentWalker(CalciteTests.queryRunnerFactoryConglomerate()).add( DataSegment.builder() .dataSource(DATA_SOURCE) .interval(index.getDataInterval()) .version("1") .shardSpec(new LinearShardSpec(0)) .build(), index ); final PlannerConfig plannerConfig = new PlannerConfig(); final DruidSchema druidSchema = CalciteTests.createMockSchema(walker, plannerConfig); final DruidOperatorTable operatorTable = new DruidOperatorTable( ImmutableSet.of(new QuantileSqlAggregator()), ImmutableSet.of() ); plannerFactory = new PlannerFactory( druidSchema, CalciteTests.createMockQueryLifecycleFactory(walker), operatorTable, CalciteTests.createExprMacroTable(), plannerConfig, new AuthConfig(), AuthTestUtils.TEST_AUTHENTICATOR_MAPPER, AuthTestUtils.TEST_AUTHORIZER_MAPPER, CalciteTests.getJsonMapper() ); }
Source:
public void setConstraint(String constr) { if (!isValidConstraint(constr)) throw new WrongValueException("Invalid constraint: " + constr + " (the constraint should be formatted in yyyyMMdd)"); setConstraint(constr != null ? new SimpleDateConstraint(constr) : null); }

Target:
public void setConstraint(String constr) { setConstraint(constr != null ? new SimpleDateConstraint(constr) : null); }
Source:
public static void main(String[] args) throws Exception { ConfigurableApplicationContext context = SpringApplication.run(Application.class, args); MessageChannel channelRestoutput = context.getBean("toSplunk", MessageChannel.class); sendWithRest(channelRestoutput); System.out.println("Consumer"); }

Target:
public static void main(String[] args) throws Exception { ConfigurableApplicationContext context = SpringApplication.run(Application.class, args); MessageChannel channelRestOutput = context.getBean("toSplunk", MessageChannel.class); sendWithRest(channelRestOutput); System.out.println("Consumer"); }
Source:
public void setup(OperatorContext context) { try { if (jsonSchema != null) { JsonSchemaFactory factory = JsonSchemaFactory.byDefault(); JsonNode schemaNode = JsonLoader.fromString(jsonSchema); schema = factory.getJsonSchema(schemaNode); } objMapper = new ObjectMapper(); } catch (ProcessingException | IOException e) { DTThrowable.wrapIfChecked(e); } }

Target:
public void setup(OperatorContext context) { try { if (jsonSchema != null) { JsonSchemaFactory factory = JsonSchemaFactory.byDefault(); JsonNode schemaNode = JsonLoader.fromString(jsonSchema); schema = factory.getJsonSchema(schemaNode); } objMapper = new ObjectMapper(); objMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); } catch (ProcessingException | IOException e) { DTThrowable.wrapIfChecked(e); } }
Source:
private Chunk allocateChunk() { SoftReference<Chunk> chunkRef = chunksCache.pollLast(); while (chunkRef != null && chunkRef.get() == null) { chunkRef = chunksCache.pollLast(); } Chunk chunk = chunkRef == null ? null : chunkRef.get(); if (chunk == null) { chunk = new Chunk(this.defaultChunkSize); } else { chunk.cursor = 0; chunk.startIndex = 0; chunk.chunkSize = chunk.keys.length; } return chunk; }

Target:
private Chunk allocateChunk() { while (true) { final SoftReference<Chunk> chunkRef = chunksCache.pollLast(); if (chunkRef == null) { return new Chunk(defaultChunkSize); } final Chunk chunk = chunkRef.get(); if (chunk != null) { chunk.cursor = 0; chunk.startIndex = 0; chunk.chunkSize = chunk.keys.length; return chunk; } } }
Source:
public void testMask() { BlockBuilder blockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus(), 10); blockBuilder.appendNull(); blockBuilder.writeLong(42L); blockBuilder.appendNull(); blockBuilder.writeLong(43L); blockBuilder.appendNull(); Block result = blockBuilder.mask(new int[] {0, 1, 1, 1, 4}); assertEquals(result.getPositionCount(), 5); assertTrue(result.isNull(0)); assertEquals(BIGINT.getLong(result, 1), 42L); assertEquals(BIGINT.getLong(result, 2), 42L); assertEquals(BIGINT.getLong(result, 3), 42L); assertTrue(result.isNull(4)); for (int position : ImmutableList.of(-1, 6)) { try { blockBuilder.mask(new int[] {position}).getLong(0, 0); fail("Expected to fail"); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().startsWith("position is not valid")); } } Block block = blockBuilder.build(); result = block.mask(new int[] {0, 1, 1, 1, 4}); assertEquals(result.getPositionCount(), 5); assertTrue(result.isNull(0)); assertEquals(BIGINT.getLong(result, 1), 42L); assertEquals(BIGINT.getLong(result, 2), 42L); assertEquals(BIGINT.getLong(result, 3), 42L); assertTrue(result.isNull(4)); for (int position : ImmutableList.of(-1, 6)) { try { block.mask(new int[] {position}).getLong(0, 0); fail("Expected to fail"); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().startsWith("position is not valid")); } } }

Target:
public void testMask() { BlockBuilder blockBuilder = BIGINT.createFixedSizeBlockBuilder(5).appendNull().writeLong(42L).appendNull().writeLong(43L).appendNull(); int[] positions = new int[] {0, 1, 1, 1, 4}; Block expected = BIGINT.createFixedSizeBlockBuilder(5).appendNull().writeLong(42).writeLong(42).writeLong(42).appendNull().build(); assertBlockEquals(BIGINT, blockBuilder.getPositions(positions), expected); assertInvalidMask(blockBuilder, new int[] {-1}); assertInvalidMask(blockBuilder, new int[] {6}); Block block = blockBuilder.build(); assertBlockEquals(BIGINT, block.getPositions(positions), expected); assertInvalidMask(block, new int[] {-1}); assertInvalidMask(block, new int[] {6}); }
Source:
void showList(JsArray<BranchInfo> result) { if (open && (result.length() != 0)) { Gerrit.display(PageLinks.toProjectBranches(getProjectKey())); return; } setToken(getTokenForScreen(qMatch, qStart)); ProjectBranchesScreen.this.match = qMatch; ProjectBranchesScreen.this.start = qStart; if (result.length() <= pageSize) { branchTable.display(Natives.asList(result)); next.setVisible(false); } else { branchTable.displaySubset(Natives.asList(result), 0, result.length() - 1); setupNavigationLink(next, qMatch, qStart + pageSize); } if (qStart > 0) { setupNavigationLink(prev, qMatch, qStart - pageSize); } else { prev.setVisible(false); } delBranch.setVisible(branchTable.hasBranchCanDelete()); Set<String> checkedRefs = branchTable.getCheckedRefs(); branchTable.setChecked(checkedRefs); updateForm(); if (!isCurrentView()) { display(); } }

Target:
void showList(JsArray<BranchInfo> result) { setToken(getTokenForScreen(qMatch, qStart)); ProjectBranchesScreen.this.match = qMatch; ProjectBranchesScreen.this.start = qStart; if (result.length() <= pageSize) { branchTable.display(Natives.asList(result)); next.setVisible(false); } else { branchTable.displaySubset(Natives.asList(result), 0, result.length() - 1); setupNavigationLink(next, qMatch, qStart + pageSize); } if (qStart > 0) { setupNavigationLink(prev, qMatch, qStart - pageSize); } else { prev.setVisible(false); } delBranch.setVisible(branchTable.hasBranchCanDelete()); Set<String> checkedRefs = branchTable.getCheckedRefs(); branchTable.setChecked(checkedRefs); updateForm(); if (!isCurrentView()) { display(); } }
Source:
protected IProject[] build(int kind, Map<String, String> args, final IProgressMonitor monitor) throws CoreException { IResourceDelta delta = getDelta(getProject()); if (delta == null) return null; delta.accept(delta1 -> { IPath ipath = delta1.getFullPath(); if (!"java".equals(ipath.getFileExtension())) return true; String path = ipath.toPortableString(); for (int i = 0; i < classes.length; i++) { if (classes[i].build) continue; if (path.startsWith(classes[i].sourceDir)) { classes[i].build = true; } } return true; }); final IWorkspaceRoot root = getProject().getWorkspace().getRoot(); for (MainClass classe : classes) { MainClass mainClass = classe; if (mainClass.build) { mainClass.build = false; IResource library = root.findMember(mainClass.outputDir); JNIGeneratorApp gen = new JNIGeneratorApp(); gen.setMainClassName(mainClass.mainClassName, library.getLocation().toPortableString()); gen.generate(); library.refreshLocal(IResource.DEPTH_INFINITE, null); } } return null; }

Target:
protected IProject[] build(int kind, Map<String, String> args, final IProgressMonitor monitor) throws CoreException { IResourceDelta delta = getDelta(getProject()); if (delta == null) return null; delta.accept(delta1 -> { IPath ipath = delta1.getFullPath(); if (!"java".equals(ipath.getFileExtension())) return true; String path = ipath.toPortableString(); for (int i = 0; i < classes.length; i++) { if (classes[i].build) continue; if (path.startsWith(classes[i].sourceDir)) { classes[i].build = true; } } return true; }); final IWorkspaceRoot root = getProject().getWorkspace().getRoot(); for (MainClass mainClass : classes) { if (mainClass.build) { mainClass.build = false; IResource library = root.findMember(mainClass.outputDir); JNIGeneratorApp gen = new JNIGeneratorApp(); gen.setMainClassName(mainClass.mainClassName, library.getLocation().toPortableString()); gen.generate(); library.refreshLocal(IResource.DEPTH_INFINITE, null); } } return null; }
Source:
public void roundtrip() throws IOException { when( storageFileItem.getInputStream() ).thenReturn( new ByteArrayInputStream( prefixFile1( true ).getBytes( UTF8 ) ) ); final List<String> entries = m.read( storageFileItem ).entries(); assertThat( entries, is( notNullValue() ) ); assertThat( entries.size(), is( 3 ) ); final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); m.write( entries, outputStream ); assertThat( outputStream.size(), greaterThan( 15 ) ); final String output = new String( outputStream.toByteArray(), UTF8 ); assertThat( output.replace("\r", ""), equalTo( withStandardHeaders( prefixFile1( false ) ).replace("\r", "") ) ); }

Target:
public void roundtrip() throws IOException { when( storageFileItem.getInputStream() ).thenReturn( new ByteArrayInputStream( prefixFile1( true ).getBytes( UTF8 ) ) ); final List<String> entries = m.read( storageFileItem ).entries(); assertThat( entries, is( notNullValue() ) ); assertThat( entries.size(), is( 3 ) ); final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); m.write( entries, outputStream ); assertThat( outputStream.size(), greaterThan( 15 ) ); final String output = new String( outputStream.toByteArray(), UTF8 ); assertThat( output, equalTo( withStandardHeaders( prefixFile1( false ) ) ) ); }
Source:
protected void selectionUpdatedHandler(SelectionUpdatedEvent event) { ListGridRecord[] selectedRecords = this.getSelectedRecords(); ArrayList<String> selectedTasksIds = new ArrayList<>(); for (ListGridRecord selectedRecord : selectedRecords) { Task task = TaskRecord.getTask(selectedRecord); selectedTasksIds.add(task.getJobId() + "_" + task.getId()); } controller.getModel().setSelectedTasksIds(selectedTasksIds); }

Target:
protected void selectionUpdatedHandler(SelectionUpdatedEvent event) { ListGridRecord[] selectedRecords = this.getSelectedRecords(); List<String> selectedTasksIds = new ArrayList<>(selectedRecords.length); for (ListGridRecord selectedRecord : selectedRecords) { Task task = TaskRecord.getTask(selectedRecord); selectedTasksIds.add(task.getJobId() + "_" + task.getId()); } controller.getModel().setSelectedTasksIds(selectedTasksIds); }
Source:
public <T, CC, C extends IClientProvider<T, CC>> C getClientProvider(Class<C> clientProviderClass) { log.info("ClientProvider request received for class: " + clientProviderClass.getCanonicalName()); for (IInternalClientProvider<?, ?> internalClientProvider : internalClientProviders) { Class<?> internalClientProviderClass = internalClientProvider.getClass(); if (doTypeArgumentsMatch(VALID_CLIENT_PROVIDERS, clientProviderClass, internalClientProviderClass, 2)) { C c = (C) Proxy.newProxyInstance(clientProviderClass.getClassLoader(), new Class[] { clientProviderClass }, new ClientProviderAdapter(internalClientProvider)); log.debug("Providing ClientProvider."); return c; } } log.debug("Not able to provide ClientProvider!"); return null; }

Target:
public <T, CC, C extends IClientProvider<T, CC>> C getClientProvider(Class<C> clientProviderClass) { log.info("ClientProvider request received for class: " + clientProviderClass.getCanonicalName()); for (Class<?> internalClientProviderClass : internalClientProviders.keySet()) { IInternalClientProvider<?, ?> internalClientProvider = internalClientProviders.get(internalClientProviderClass); if (doTypeArgumentsMatch(VALID_CLIENT_PROVIDERS, clientProviderClass, internalClientProviderClass, 2)) { @SuppressWarnings("unchecked") C c = (C) Proxy.newProxyInstance(clientProviderClass.getClassLoader(), new Class[] { clientProviderClass }, new ClientProviderAdapter<T, CC>((IInternalClientProvider<T, CC>) internalClientProvider, coreModelCapability)); log.debug("Providing ClientProvider."); return c; } } log.debug("Not able to provide ClientProvider!"); return null; }
Source:
public Constraint[] getConstraints() { return Arrays.copyOf(constraints, constraints.length); }

Target:
public Constraint[] getConstraints() { return constraints; }
Source:
private BpmnNode compensationEvent(CatchEvent event, CompensateEventDefinition e) { String nodeId = event.getId(); Node<View<IntermediateCompensationEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateCompensationEvent.class); IntermediateCompensationEvent definition = node.getContent().getDefinition(); CatchEventPropertyReader p = propertyReaderFactory.of(event); definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation()))); definition.setBackgroundSet(p.getBackgroundSet()); definition.setFontSet(p.getFontSet()); definition.setDimensionsSet(p.getCircleDimensionSet()); SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); BaseCancellingEventExecutionSet executionSet = new BaseCancellingEventExecutionSet(null, slaDueDate); definition.setExecutionSet(executionSet); node.getContent().setBounds(p.getBounds()); return BpmnNode.of(node, p); }

Target:
private BpmnNode compensationEvent(CatchEvent event, CompensateEventDefinition e) { String nodeId = event.getId(); Node<View<IntermediateCompensationEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateCompensationEvent.class); IntermediateCompensationEvent definition = node.getContent().getDefinition(); CatchEventPropertyReader p = propertyReaderFactory.of(event); definition.setGeneral( new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) ) ); definition.setBackgroundSet(p.getBackgroundSet()); definition.setFontSet(p.getFontSet()); definition.setDimensionsSet(p.getCircleDimensionSet()); CancelActivity cancelActivity = new CancelActivity(false); SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate()); BaseCancellingEventExecutionSet executionSet = new BaseCancellingEventExecutionSet(cancelActivity, slaDueDate); definition.setExecutionSet(executionSet); node.getContent().setBounds(p.getBounds()); return BpmnNode.of(node, p); }
Source:
public boolean pollWithTimeout(Guid hostId, long timeoutInMillis) { return pollingWithTimeoutAndCustomCondition(hostId, timeoutInMillis, () -> true); }

Target:
public boolean pollWithTimeout(Guid hostId, long timeoutInMillis) { return pollingWithTimeoutAndCustomCondition(hostId, timeoutInMillis, Function.identity()); }
Source:
private static void closeQuietly(LifeCycle service) { try { if (service != null) { service.stop(); } } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } catch (Exception ignored) { } }

Target:
private static void closeQuietly(LifeCycle service) { try { if (service != null) { service.stop(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (Exception ignored) { } }
Source:
private void writeResponse(Request request, Response response, OrganizationDto organization, GroupDto group) { WsUserGroups.CreateWsResponse.Builder respBuilder = WsUserGroups.CreateWsResponse.newBuilder(); respBuilder.setGroup(toProtobuf(organization, group, 0)); writeProtobuf(respBuilder.build(), request, response); }

Target:
private void writeResponse(Request request, Response response, OrganizationDto organization, GroupDto group) { WsUserGroups.CreateWsResponse.Builder respBuilder = WsUserGroups.CreateWsResponse.newBuilder(); respBuilder.setGroup(toProtobuf(organization, group, 0, false)); writeProtobuf(respBuilder.build(), request, response); }
Source:
public List<IdNamePair> getLabels() { List<IdNamePair> list = new ArrayList<>(values.size()); if(values == null) { return list; } for(int i = 0; i < values.size(); i++) { String id = values.get(i); IdNamePair pair = new IdNamePair(id, getValueText(i, id)); list.add(pair); } return list; }

Target:
public List<IdNamePair> getLabels() { if(values == null) { return Collections.emptyList(); } List<IdNamePair> list = new ArrayList<>(values.size()); for(int i = 0; i < values.size(); i++) { String id = values.get(i); IdNamePair pair = new IdNamePair(id, getValueText(i, id)); list.add(pair); } return list; }
Source:
public void cartesianShouldEqualItself() { assertEqual( pointValue( CoordinateReferenceSystem.Cartesian, 1.0, 2.0 ), pointValue( CoordinateReferenceSystem.Cartesian, 1.0, 2.0 ) ); assertEqual( pointValue( CoordinateReferenceSystem.Cartesian, -1.0, 2.0 ), pointValue( CoordinateReferenceSystem.Cartesian, -1.0, 2.0 ) ); assertEqual( pointValue( CoordinateReferenceSystem.Cartesian, -1.0, -2.0 ), pointValue( CoordinateReferenceSystem.Cartesian, -1.0, -2.0 ) ); assertEqual( pointValue( CoordinateReferenceSystem.Cartesian, 0.0, 0.0 ), pointValue( CoordinateReferenceSystem.Cartesian, 0.0, 0.0 ) ); }

Target:
public void cartesianShouldEqualItself() { assertEqual( pointValue( Cartesian, 1.0, 2.0 ), pointValue( Cartesian, 1.0, 2.0 ) ); assertEqual( pointValue( Cartesian, -1.0, 2.0 ), pointValue( Cartesian, -1.0, 2.0 ) ); assertEqual( pointValue( Cartesian, -1.0, -2.0 ), pointValue( Cartesian, -1.0, -2.0 ) ); assertEqual( pointValue( Cartesian, 0.0, 0.0 ), pointValue( Cartesian, 0.0, 0.0 ) ); }
Source:
public InternetDataConnection.InputStreamProvider forInput() throws IOException { if (input != null) throw new RuntimeException("Input has already been enabled"); if (connected) throw new RuntimeException("Cannot enable input after having already connected"); connection.setDoInput(true); input = new InternetDataConnection.InputStreamProvider(); return input; }

Target:
public InternetDataConnection.InputStreamProvider forInput() throws IOException { if (input != null) { throw new RuntimeException("Input has already been enabled"); } if (connected) { throw new RuntimeException("Cannot enable input after having already connected"); } connection.setDoInput(true); input = new InternetDataConnection.InputStreamProvider(); return input; }
Source:
public void clearTokensForUser(String userId) { List<TokenCacheItem> results = this.getTokensForUser(userId); for (TokenCacheItem item : results) { if (item.getUserInfo() != null && item.getUserInfo().getUserId().equalsIgnoreCase(userId)) { try { this.removeItem(CacheKey.createCacheKey(item)); } catch (final AuthenticationException exception) { Logger.e(TAG, "Fail to create cachekey", "", exception.getCode(), exception); } } } }

Target:
public void clearTokensForUser(String userId) { final List<TokenCacheItem> results = this.getTokensForUser(userId); for (TokenCacheItem item : results) { if (item.getUserInfo() != null && item.getUserInfo().getUserId() != null && item.getUserInfo().getUserId().equalsIgnoreCase(userId)) { try { this.removeItem(CacheKey.createCacheKey(item)); } catch (final AuthenticationException exception) { Logger.e(TAG, "Fail to create cachekey", "", exception.getCode(), exception); } } } }
Source:
public void join(MutationState newMutation) { if (this == newMutation) { return; } this.sizeOffset += newMutation.sizeOffset; for (Map.Entry<TableRef, Map<ImmutableBytesPtr,RowMutationState>> entry : newMutation.mutations.entrySet()) { TableRef tableRef = entry.getKey(); PTable table = tableRef.getTable(); boolean isIndex = table.getType() == PTableType.INDEX; Map<ImmutableBytesPtr,RowMutationState> existingRows = this.mutations.put(tableRef, entry.getValue()); if (existingRows != null) { for (Map.Entry<ImmutableBytesPtr,RowMutationState> rowEntry : entry.getValue().entrySet()) { RowMutationState existingRowMutationState = existingRows.put(rowEntry.getKey(), rowEntry.getValue()); if (existingRowMutationState != null) { Map<PColumn,byte[]> existingValues = existingRowMutationState.getColumnValues(); if (existingValues != PRow.DELETE_MARKER) { Map<PColumn,byte[]> newRow = rowEntry.getValue().getColumnValues(); if (newRow != PRow.DELETE_MARKER) { for (Map.Entry<PColumn,byte[]> valueEntry : newRow.entrySet()) { existingRowMutationState.getColumnValues().put(valueEntry.getKey(), valueEntry.getValue()); } existingRowMutationState.getOrderOfStatementsInConnection().addAll(rowEntry.getValue().getOrderOfStatementsInConnection()); existingRows.put(rowEntry.getKey(), existingRowMutationState); } } } else { if (!isIndex) { numRows++; } } } this.mutations.put(entry.getKey(), existingRows); } else { if (!isIndex) { numRows += entry.getValue().size(); } } } throwIfTooBig(); }

Target:
public void join(MutationState newMutation) { if (this == newMutation) { return; } this.sizeOffset += newMutation.sizeOffset; for (Map.Entry<TableRef, Map<ImmutableBytesPtr,RowMutationState>> entry : newMutation.mutations.entrySet()) { TableRef tableRef = entry.getKey(); PTable table = tableRef.getTable(); boolean isIndex = table.getType() == PTableType.INDEX; Map<ImmutableBytesPtr,RowMutationState> existingRows = this.mutations.put(tableRef, entry.getValue()); if (existingRows != null) { for (Map.Entry<ImmutableBytesPtr,RowMutationState> rowEntry : entry.getValue().entrySet()) { RowMutationState existingRowMutationState = existingRows.put(rowEntry.getKey(), rowEntry.getValue()); if (existingRowMutationState != null) { Map<PColumn,byte[]> existingValues = existingRowMutationState.getColumnValues(); if (existingValues != PRow.DELETE_MARKER) { Map<PColumn,byte[]> newRow = rowEntry.getValue().getColumnValues(); if (newRow != PRow.DELETE_MARKER) { existingRowMutationState.join(rowEntry.getValue()); existingRows.put(rowEntry.getKey(), existingRowMutationState); } } } else { if (!isIndex) { numRows++; } } } this.mutations.put(entry.getKey(), existingRows); } else { if (!isIndex) { numRows += entry.getValue().size(); } } } throwIfTooBig(); }
Source:
public void reset() { shutdown(); backedIterator.reset(); shouldWork.set(true); this.thread = new AsyncPrefetchThread(buffer, backedIterator, terminator, workspace); Integer deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread(); Nd4j.getAffinityManager().attachThreadToDevice(thread, deviceId); thread.setDaemon(true); thread.start(); nextElement = null; }

Target:
public void reset() { buffer.clear(); if (thread != null) thread.interrupt(); try { if (thread != null) thread.join(); } catch (InterruptedException e) { throw new RuntimeException(e); } buffer.clear(); backedIterator.reset(); shouldWork.set(true); this.thread = new AsyncPrefetchThread(buffer, backedIterator, terminator, null); Nd4j.getAffinityManager().attachThreadToDevice(thread, deviceId); thread.setDaemon(true); thread.start(); nextElement = null; }
Source:
public void scanDirectories(String[] directories) { if (DEBUG) Log.d(TAG, "scanDirectories: " + Arrays.toString(directories)); try { long start = System.nanoTime() / 1000000; prescan(null, true); long prescan = System.nanoTime() / 1000000; if (ENABLE_BULK_INSERTS) { mMediaInserter = new MediaInserter(mMediaProvider, 500); } for (int i = 0; i < directories.length; i++) { processDirectory(directories[i], mClient); } if (ENABLE_BULK_INSERTS) { mMediaInserter.flushAll(); mMediaInserter = null; } long scan = System.nanoTime() / 1000000; postscan(directories); long end = System.nanoTime() / 1000000; if (true) { Log.i(TAG, "< SCAN > : " + Arrays.toString(directories)); Log.i(TAG, " prescan time: " + (prescan - start) + "ms"); Log.i(TAG, " scan time: " + (scan - prescan) + "ms"); Log.i(TAG, "postscan time: " + (end - scan) + "ms"); Log.i(TAG, " total time: " + (end - start) + "ms"); } } catch (SQLException e) { Log.e(TAG, "SQLException in MediaScanner.scan()", e); } catch (UnsupportedOperationException e) { Log.e(TAG, "UnsupportedOperationException in MediaScanner.scan()", e); } catch (RemoteException e) { Log.e(TAG, "RemoteException in MediaScanner.scan()", e); } finally { releaseResources(); } }

Target:
public void scanDirectories(String[] directories) { if (DEBUG) Log.d(TAG, "scanDirectories: " + Arrays.toString(directories)); try { long start = System.currentTimeMillis(); prescan(null, true); long prescan = System.currentTimeMillis(); if (ENABLE_BULK_INSERTS) { mMediaInserter = new MediaInserter(mMediaProvider, 500); } for (int i = 0; i < directories.length; i++) { processDirectory(directories[i], mClient); } if (ENABLE_BULK_INSERTS) { mMediaInserter.flushAll(); mMediaInserter = null; } long scan = System.currentTimeMillis(); postscan(directories); long end = System.currentTimeMillis(); if (DEBUG) { Log.i(TAG, "< SCAN > : " + Arrays.toString(directories)); Log.i(TAG, " prescan time: " + (prescan - start) + "ms"); Log.i(TAG, " scan time: " + (scan - prescan) + "ms"); Log.i(TAG, "postscan time: " + (end - scan) + "ms"); Log.i(TAG, " total time: " + (end - start) + "ms"); } } catch (SQLException e) { Log.e(TAG, "SQLException in MediaScanner.scan()", e); } catch (UnsupportedOperationException e) { Log.e(TAG, "UnsupportedOperationException in MediaScanner.scan()", e); } catch (RemoteException e) { Log.e(TAG, "RemoteException in MediaScanner.scan()", e); } finally { releaseResources(); } }
Source:
public void getDescription_OldAnnotation() throws NoSuchMethodException { String actualResult = getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_1, FIRST_INDEX); assertEquals(SECOND_DESCRIPTION_METHOD_ANNOTATION, actualResult); }

Target:
public void getDescription_OldAnnotation() throws NoSuchMethodException { String actualRes = getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_1, FIRST_INDEX); assertEquals(SECOND_DESCRIPTION_METHOD_ANNOTATION, actualRes); }
Source:
private void close(final boolean clean) { switch (state()) { case CREATED: case SUSPENDED: if (clean) { stateMgr.checkpoint(Collections.emptyMap()); offsetSnapshotSinceLastCommit = new HashMap<>(stateMgr.changelogOffsets()); } executeAndMaybeSwallow( clean, () -> StateManagerUtil.closeStateManager( log, logPrefix, clean, eosEnabled, stateMgr, stateDirectory, TaskType.STANDBY ), "state manager close", log ); break; case CLOSED: log.trace("Skip closing since state is {}", state()); return; case RESTORING: case RUNNING: throw new IllegalStateException("Illegal state " + state() + " while closing standby task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while closing standby task " + id); } closeTaskSensor.record(); transitionTo(State.CLOSED); }

Target:
private void close(final boolean clean) { switch (state()) { case CREATED: case SUSPENDED: executeAndMaybeSwallow( clean, () -> StateManagerUtil.closeStateManager( log, logPrefix, clean, eosEnabled, stateMgr, stateDirectory, TaskType.STANDBY ), "state manager close", log ); break; case CLOSED: log.trace("Skip closing since state is {}", state()); return; case RESTORING: case RUNNING: throw new IllegalStateException("Illegal state " + state() + " while closing standby task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while closing standby task " + id); } closeTaskSensor.record(); transitionTo(State.CLOSED); }
Source:
private void backgroundOperationsLoop() { while ( !Thread.interrupted() ) { OperationAndData<?> operationAndData; try { operationAndData = backgroundOperations.take(); if ( debugListener != null ) { debugListener.listen(operationAndData); } } catch ( InterruptedException ignored ) { break; } performBackgroundOperation(operationAndData); } }

Target:
private void backgroundOperationsLoop() { while ( !Thread.currentThread().isInterrupted() ) { OperationAndData<?> operationAndData; try { operationAndData = backgroundOperations.take(); if ( debugListener != null ) { debugListener.listen(operationAndData); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); break; } performBackgroundOperation(operationAndData); } }
Source:
public void getDesignProcessDefinition_Should_Return_Design() throws Exception{ int processDefinitionId = 123; when(tenantAccessor.getProcessDefinitionService()).thenReturn(processDefinitionService); doReturn(processDefinitionService).when(tenantAccessor).getProcessDefinitionService(); DesignProcessDefinition designProcessDefinition = mock(DesignProcessDefinition.class); when(processDefinitionService.getDesignProcessDefinition(processDefinitionId)).thenReturn(designProcessDefinition); DesignProcessDefinition designProcessDefinitionResult = processAPI.getDesignProcessDefinition(processDefinitionId); assertThat(designProcessDefinitionResult).isSameAs(designProcessDefinition); }

Target:
public void getDesignProcessDefinition_Should_Return_Design() throws Exception { int processDefinitionId = 123; when(tenantAccessor.getProcessDefinitionService()).thenReturn(processDefinitionService); doReturn(processDefinitionService).when(tenantAccessor).getProcessDefinitionService(); DesignProcessDefinition designProcessDefinition = mock(DesignProcessDefinition.class); when(processDefinitionService.getDesignProcessDefinition(processDefinitionId)).thenReturn(designProcessDefinition); DesignProcessDefinition designProcessDefinitionResult = processAPI.getDesignProcessDefinition(processDefinitionId); assertThat(designProcessDefinitionResult).isSameAs(designProcessDefinition); verify(processDefinitionService).getDesignProcessDefinition(processDefinitionId); }
Source:
public static RpcMetrics createRpcMetrics(MethodDescriptor<?, ?> descriptor) { String fullMethodName = descriptor.getFullMethodName(); MetricRegistry debugRegistry = getMetricRegistry(MetricLevel.Debug); MetricRegistry infoRegistry = getMetricRegistry(MetricLevel.Info); return new RpcMetrics( infoRegistry.createTimer(fullMethodName + ".operation.latency"), debugRegistry.createTimer(fullMethodName + ".rpc.latency"), infoRegistry.createCounter(fullMethodName + ".retry.count"), infoRegistry.createCounter(fullMethodName + ".failure.count"), infoRegistry.createCounter(fullMethodName + ".retries.exhausted.count")); }

Target:
public static RpcMetrics createRpcMetrics(MethodDescriptor<?, ?> descriptor) { String fullMethodName = descriptor.getFullMethodName(); return new RpcMetrics( BigtableClientMetrics.timer(MetricLevel.Info, fullMethodName + ".operation.latency"), BigtableClientMetrics.timer(MetricLevel.Debug, fullMethodName + ".rpc.latency"), BigtableClientMetrics.counter(MetricLevel.Info, fullMethodName + ".retry.count"), BigtableClientMetrics.counter(MetricLevel.Info, fullMethodName + ".failure.count"), BigtableClientMetrics.counter(MetricLevel.Info, fullMethodName + ".retries.exhausted.count")); }
Source:
public List<UpdateSite.Warning> getActiveCoreWarnings() { List<UpdateSite.Warning> CoreWarnings = new ArrayList<>(); for (UpdateSite.Warning warning : getActiveWarnings()) { if (!UpdateSite.Warning.TYPE_CORE.equals(warning.type) || !UpdateSite.Warning.NAME_CORE.equals(warning.name)) { continue; } CoreWarnings.add(warning); } return CoreWarnings; }

Target:
public List<UpdateSite.Warning> getActiveCoreWarnings() { List<UpdateSite.Warning> CoreWarnings = new ArrayList<>(); for (UpdateSite.Warning warning : getActiveWarnings()) { if (warning.type != UpdateSite.Warning.Type.CORE) { continue; } CoreWarnings.add(warning); } return CoreWarnings; }
Source:
public AccountService getAccountService() { try { long startTimeMs = System.currentTimeMillis(); logger.info("Starting a MySqlAccountService"); ScheduledExecutorService scheduler = accountServiceConfig.updaterPollingIntervalMs > 0 ? Utils.newScheduler(1, MYSQL_ACCOUNT_UPDATER_PREFIX, false) : null; MySqlAccountService mySqlAccountService = new MySqlAccountService(accountServiceMetrics, accountServiceConfig, scheduler); long spentTimeMs = System.currentTimeMillis() - startTimeMs; logger.info("MySqlAccountService started, took ms", spentTimeMs); accountServiceMetrics.startupTimeInMs.update(spentTimeMs); return mySqlAccountService; } catch (Exception e) { throw new IllegalStateException("Could not instantiate MySqlAccountService", e); } }

Target:
public AccountService getAccountService() { try { long startTimeMs = System.currentTimeMillis(); logger.info("Starting a MySqlAccountService"); MySqlAccountStore mySqlAccountStore = null; try { mySqlAccountStore = new MySqlAccountStore(accountServiceConfig); } catch (SQLException e) { logger.error("MySQL account store creation failed", e); } MySqlAccountService mySqlAccountService = new MySqlAccountService(accountServiceMetrics, accountServiceConfig, mySqlAccountStore); long spentTimeMs = System.currentTimeMillis() - startTimeMs; logger.info("MySqlAccountService started, took ms", spentTimeMs); accountServiceMetrics.startupTimeInMs.update(spentTimeMs); return mySqlAccountService; } catch (Exception e) { throw new IllegalStateException("Could not instantiate MySqlAccountService", e); } }
Source:
public static Iterable<? extends Object> parameters() { return Arrays.asList( new Object[]{"BOOLEAN", Schema.create(Schema.Type.BOOLEAN), new SqoopOptions()}, new Object[]{"INT", Schema.create(Schema.Type.INT), new SqoopOptions()}, new Object[]{"BIGINT", Schema.create(Schema.Type.LONG), new SqoopOptions()}, new Object[]{"FLOAT", Schema.create(Schema.Type.FLOAT), new SqoopOptions()}, new Object[]{"DOUBLE", Schema.create(Schema.Type.DOUBLE), new SqoopOptions()}, new Object[]{"STRING", Schema.createEnum("ENUM", "doc", "namespce", new ArrayList<>()), new SqoopOptions()}, new Object[]{"STRING", Schema.create(Schema.Type.STRING), new SqoopOptions()}, new Object[]{"BINARY", Schema.create(Schema.Type.BYTES), new SqoopOptions()}, new Object[]{"BINARY", Schema.createFixed("Fixed", "doc", "space", 1), new SqoopOptions()}, new Object[]{"BINARY", createDecimal(20, 10), new SqoopOptions()}, new Object[]{"DECIMAL (20, 10)", createDecimal(20, 10), createSqoopOptionsWithLogicalTypesEnabled()} ); }

Target:
public static Iterable<? extends Object> parameters() { return Arrays.asList( new Object[]{"BOOLEAN", create(Type.BOOLEAN), new SqoopOptions()}, new Object[]{"INT", create(Type.INT), new SqoopOptions()}, new Object[]{"BIGINT", create(Type.LONG), new SqoopOptions()}, new Object[]{"FLOAT", create(Type.FLOAT), new SqoopOptions()}, new Object[]{"DOUBLE", create(Type.DOUBLE), new SqoopOptions()}, new Object[]{"STRING", createEnum("ENUM", "doc", "namespace", new ArrayList<>()), new SqoopOptions()}, new Object[]{"STRING", create(Type.STRING), new SqoopOptions()}, new Object[]{"BINARY", create(Type.BYTES), new SqoopOptions()}, new Object[]{"BINARY", createFixed("Fixed", "doc", "space", 1), new SqoopOptions()}, new Object[]{"BINARY", createDecimal(20, 10), new SqoopOptions()}, new Object[]{"BINARY", create(Type.BYTES), createSqoopOptionsWithLogicalTypesEnabled()}, new Object[]{"DECIMAL (20, 10)", createDecimal(20, 10), createSqoopOptionsWithLogicalTypesEnabled()} ); }
Source:
private Path checkRootDir(final Path rd, final Configuration c, final FileSystem fs) throws IOException { FSUtils.waitOnSafeMode(c, c.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000)); FileStatus status; try { status = fs.getFileStatus(rd); } catch (FileNotFoundException e) { status = null; } try { if (status == null) { if (!fs.mkdirs(rd)) { throw new IOException("Can not create root dir: " + rd); } FSUtils.setVersion(fs, rd, c.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000), c.getInt( HConstants.VERSION_FILE_WRITE_ATTEMPTS, HConstants.DEFAULT_VERSION_FILE_WRITE_ATTEMPTS)); } else { if (!status.isDirectory()) { throw new IllegalArgumentException(rd + " is not a directory"); } FSUtils.checkVersion(fs, rd, true, c.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000), c.getInt(HConstants.VERSION_FILE_WRITE_ATTEMPTS, HConstants.DEFAULT_VERSION_FILE_WRITE_ATTEMPTS)); } } catch (DeserializationException de) { LOG.error(HBaseMarkers.FATAL, "Please fix invalid configuration for " + HConstants.HBASE_DIR, de); throw new IOException(de); } catch (IllegalArgumentException iae) { LOG.error(HBaseMarkers.FATAL, "Please fix invalid configuration for " + HConstants.HBASE_DIR + " " + rd.toString(), iae); throw iae; } if (!FSUtils.checkClusterIdExists(fs, rd, c.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000))) { FSUtils.setClusterId(fs, rd, new ClusterId(), c.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000)); } clusterId = FSUtils.getClusterId(fs, rd); return rd; }

Target:
private void checkRootDir(final Path rd, final Configuration c, final FileSystem fs) throws IOException { int threadWakeFrequency = c.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000); FSUtils.waitOnSafeMode(c, threadWakeFrequency); FileStatus status; try { status = fs.getFileStatus(rd); } catch (FileNotFoundException e) { status = null; } int versionFileWriteAttempts = c.getInt(HConstants.VERSION_FILE_WRITE_ATTEMPTS, HConstants.DEFAULT_VERSION_FILE_WRITE_ATTEMPTS); try { if (status == null) { if (!fs.mkdirs(rd)) { throw new IOException("Can not create configured '" + HConstants.HBASE_DIR + "' " + rd); } FSUtils.setVersion(fs, rd, threadWakeFrequency, versionFileWriteAttempts); } else { if (!status.isDirectory()) { throw new IllegalArgumentException( "Configured '" + HConstants.HBASE_DIR + "' " + rd + " is not a directory."); } FSUtils.checkVersion(fs, rd, true, threadWakeFrequency, versionFileWriteAttempts); } } catch (DeserializationException de) { LOG.error(HBaseMarkers.FATAL, "Please fix invalid configuration for '{}' {}", HConstants.HBASE_DIR, rd, de); throw new IOException(de); } catch (IllegalArgumentException iae) { LOG.error(HBaseMarkers.FATAL, "Please fix invalid configuration for '{}' {}", HConstants.HBASE_DIR, rd, iae); throw iae; } if (!FSUtils.checkClusterIdExists(fs, rd, threadWakeFrequency)) { FSUtils.setClusterId(fs, rd, new ClusterId(), threadWakeFrequency); } clusterId = FSUtils.getClusterId(fs, rd); }
Source:
private Collection<FeedbackResponseComment> getFeedbackResponseCommentEntitiesForQuestionInSection( String questionId, String section) { Map<Long, FeedbackResponseComment> comments = new HashMap<>(); List<FeedbackResponseComment> firstQueryResponseComments = load() .filter("feedbackQuestionId =", questionId) .filter("giverSection =", section) .list(); for (FeedbackResponseComment comment : firstQueryResponseComments) { comments.put(comment.getFeedbackResponseCommentId(), comment); } List<FeedbackResponseComment> secondQueryResponseComments = load() .filter("feedbackQuestionId =", questionId) .filter("receiverSection =", section) .list(); for (FeedbackResponseComment comment : secondQueryResponseComments) { comments.put(comment.getFeedbackResponseCommentId(), comment); } return comments.values(); }

Target:
private Collection<FeedbackResponseComment> getFeedbackResponseCommentEntitiesForQuestionInSection( String questionId, String section) { Map<Long, FeedbackResponseComment> comments = new HashMap<>(); List<FeedbackResponseComment> responseCommentsFromSection = load() .filter("feedbackQuestionId =", questionId) .filter("giverSection =", section) .list(); for (FeedbackResponseComment comment : responseCommentsFromSection) { comments.put(comment.getFeedbackResponseCommentId(), comment); } List<FeedbackResponseComment> responseCommentsToSection = load() .filter("feedbackQuestionId =", questionId) .filter("receiverSection =", section) .list(); for (FeedbackResponseComment comment : responseCommentsToSection) { comments.put(comment.getFeedbackResponseCommentId(), comment); } return comments.values(); }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TestWithParameters other = (TestWithParameters) obj; if (fName == null) { if (other.fName != null) return false; } else if (!fName.equals(other.fName)) return false; return Arrays.equals(fParameters, other.fParameters) && fTestClass.equals(other.fTestClass); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } TestWithParameters other = (TestWithParameters) obj; return fName.equals(other.fName) && fParameters.equals(other.fParameters) && fTestClass.equals(other.fTestClass); }
Source:
public int getMaxCapacity() { readLock.lock(); try { return maxCapacity; } finally { readLock.unlock(); } }

Target:
public int getMaxCapacity() { return maxCapacity; }
Source:
public void performOperations(List<LuceneWork> workList, IndexingMonitor monitor) { if (this.cache.getCacheConfiguration().clustering().cacheMode().isClustered()) { readLock.lock(); Address localAddress = rpcManager.getAddress(); try { Map<Address, List<LuceneWork>> workByAddress = partitionWorkByAddress(workList); logDebug("Applying work @ %s, workMap is %s", localAddress, workByAddress); List<LuceneWork> localWork = workByAddress.get(localAddress); if (localWork != null && !localWork.isEmpty()) { logDebug("About to apply work locally %s, hasOwnership=%s", localWork, hasOwnership); super.performOperations(localWork, monitor); logDebug("Work applied"); workByAddress.remove(localAddress); } workByAddress.entrySet().stream().forEach(entry -> this.sendWork(entry.getValue(), entry.getKey())); } finally { readLock.unlock(); } } else { super.performOperations(workList, monitor); } }

Target:
public void performOperations(List<LuceneWork> workList, IndexingMonitor monitor) { if (this.cache.getCacheConfiguration().clustering().cacheMode().isClustered()) { readLock.lock(); try { Address localAddress = rpcManager.getAddress(); Map<Address, List<LuceneWork>> workByAddress = partitionWorkByAddress(workList); logDebug("Applying work @ %s, workMap is %s", localAddress, workByAddress); List<LuceneWork> localWork = workByAddress.get(localAddress); if (localWork != null && !localWork.isEmpty()) { logDebug("About to apply work locally %s, hasOwnership=%s", localWork, hasOwnership); super.performOperations(localWork, monitor); logDebug("Work applied"); workByAddress.remove(localAddress); } workByAddress.entrySet().forEach(entry -> this.sendWork(entry.getValue(), entry.getKey())); } finally { readLock.unlock(); } } else { super.performOperations(workList, monitor); } }
Source:
private String[] getMessages(MultipartBody inputDataMap) { try { if(inputDataMap.getAttachmentObject("messageIds", String.class) != null) { String messageIds = inputDataMap.getAttachmentObject("messageIds", String.class); return messageIds.split(","); } } catch (Exception e) { throw new ApiException(e); } return null; }

Target:
private String[] getMessages(MultipartBody inputDataMap) { String[] msgArr = null; try { msgArr = resolveStringFromMap(inputDataMap, "message").map(messageIds -> { return messageIds.split(","); }).orElse(null); } catch (Exception e) { throw new ApiException(e); } return msgArr; }