auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testIndexIdDataTypeDefaultValue() throws Exception { String tableName = "T_" + generateUniqueName(); String globalViewName = "V_" + generateUniqueName(); String globalViewIndexName = "GV_" + generateUniqueName(); try (Connection globalConn = getConnection()) { createBaseTable(SCHEMA1, tableName, true, 0, null, true); createView(globalConn, SCHEMA1, globalViewName, tableName); createViewIndex(globalConn, SCHEMA1, globalViewIndexName, globalViewName, "v1"); String sql = "SELECT " + VIEW_INDEX_ID_DATA_TYPE + " FROM " + SYSTEM_CATALOG_NAME + " WHERE " + TABLE_SCHEM + " = '%s' AND " + TABLE_NAME + " = '%s' AND " + COLUMN_COUNT + " IS NOT NULL"; ResultSet rs = globalConn.createStatement().executeQuery(String.format(sql, SCHEMA1, tableName)); if (rs.next()) { <START> assertEquals(null, rs.getObject(1)); <END> } else { fail(); } rs = globalConn.createStatement().executeQuery(String.format(sql, SCHEMA1, globalViewName)); if (rs.next()) { assertEquals(null, rs.getObject(1)); } else { fail(); } rs = globalConn.createStatement().executeQuery(String.format(sql, SCHEMA1, globalViewIndexName)); if (rs.next()) { assertEquals(QueryServicesOptions.DEFAULT_LONG_VIEW_INDEX_ENABLED, rs.getInt(1)); } else { fail(); } } }</code><technical_language>nit: do assertIsNull</technical_language>

Target:
public void testIndexIdDataTypeDefaultValue() throws Exception { String tableName = "T_" + generateUniqueName(); String globalViewName = "V_" + generateUniqueName(); String globalViewIndexName = "GV_" + generateUniqueName(); try (Connection globalConn = getConnection()) { createBaseTable(SCHEMA1, tableName, true, 0, null, true); createView(globalConn, SCHEMA1, globalViewName, tableName); createViewIndex(globalConn, SCHEMA1, globalViewIndexName, globalViewName, "v1"); String sql = "SELECT " + VIEW_INDEX_ID_DATA_TYPE + " FROM " + SYSTEM_CATALOG_NAME + " WHERE " + TABLE_SCHEM + " = '%s' AND " + TABLE_NAME + " = '%s' AND " + COLUMN_COUNT + " IS NOT NULL"; ResultSet rs = globalConn.createStatement().executeQuery(String.format(sql, SCHEMA1, tableName)); if (rs.next()) { assertNull(rs.getObject(1)); } else { fail(); } rs = globalConn.createStatement().executeQuery(String.format(sql, SCHEMA1, globalViewName)); if (rs.next()) { assertNull(rs.getObject(1)); } else { fail(); } rs = globalConn.createStatement().executeQuery(String.format(sql, SCHEMA1, globalViewIndexName)); if (rs.next()) { assertEquals(Types.BIGINT, rs.getInt(1)); } else { fail(); } } }
Source:
<code>protected void subscribeActual(final MaybeObserver<? super Long> observer) { SequentialDisposable sd = new SequentialDisposable(); observer.onSubscribe(sd); <START> sd.replace(scheduler.scheduleDirect(new Runnable() { <END> @Override public void run() { observer.onSuccess(0L); } }, delay, unit)); }</code><technical_language>named class, moving anonymous classes</technical_language>

Target:
protected void subscribeActual(final MaybeObserver<? super Long> observer) { TimerDisposable parent = new TimerDisposable(observer); observer.onSubscribe(parent); parent.setFuture(scheduler.scheduleDirect(parent, delay, unit)); }
Source:
<code>public List<ReportMetadataJson> getReports() { if (reports != null) { return reports; } else if (serializedReports != null) { deserializeReports(); return reports; } <START> return Collections.emptyList(); <END> }</code><technical_language>return statement</technical_language>

Target:
public List<ReportMetadataJson> getReports() { return reports; }
Source:
<code>public static String generateResponseParser(final String structName, final ImmutableList<StructMember> variables) throws ParseException { final StringBuilder outputBuilder = new StringBuilder(); for (int structMemberIndex = 0; structMemberIndex < variables.size(); structMemberIndex++) { outputBuilder.append(indent(2)); if (structMemberIndex > 0) { outputBuilder.append("} else "); } final StructMember currentStructMember = variables.get(structMemberIndex); outputBuilder.append("if (element_equal(child_node, \"").append(Helper.underscoreToCamel(currentStructMember.getName())).append("\")) {").append("\n"); outputBuilder.append(getParseStructMemberBlock(structName, currentStructMember)); } outputBuilder.append(indent(2)).append("}").append("\n"); return outputBuilder.toString(); }</code><technical_language>leave this code in there, especially testing autogen code is generating parsers correctly</technical_language>

Target:
public static String generateResponseParser(final String structName, final ImmutableList<StructMember> variables) throws ParseException { final StringBuilder outputBuilder = new StringBuilder(); for (int structMemberIndex = 0; structMemberIndex < variables.size(); structMemberIndex++) { outputBuilder.append(indent(2)); if (structMemberIndex > 0) { outputBuilder.append("} else "); } final StructMember currentStructMember = variables.get(structMemberIndex); outputBuilder.append("if (element_equal(child_node, \"").append(Helper.underscoreToCamel(currentStructMember.getName())).append("\")) {").append("\n"); outputBuilder.append(getParseStructMemberBlock(structName, currentStructMember)); } outputBuilder.append(indent(2)).append("} else {").append("\n"); outputBuilder.append(indent(3)).append("ds3_log_message(log, DS3_ERROR, \"Unknown element[%s]\\n\", child_node->name);").append("\n"); outputBuilder.append(indent(2)).append("}").append("\n"); return outputBuilder.toString(); }
Source:
<code>public void getAllCsvAttributeDescriptors() { <START> Set<String> hiddenFields = new HashSet<>(); <END> hiddenFields.add("attribute1"); Set<AttributeDescriptor> allAttributes = CsvTransformer.getAllCsvAttributeDescriptors(metacardList); assertThat(allAttributes, hasSize(5)); Set<String> allAttributeNames = allAttributes.stream().map(AttributeDescriptor::getName).collect(Collectors.toSet()); final Set<String> expectedAttributes = Sets.newHashSet("attribute2", "attribute3", "attribute4", "attribute5", "attribute6"); assertThat(allAttributeNames, is(expectedAttributes)); }</code><technical_language>Remove</technical_language>

Target:
public void getAllCsvAttributeDescriptors() { Set<AttributeDescriptor> allAttributes = CsvTransformer.getAllCsvAttributeDescriptors(metacardList); assertThat(allAttributes, hasSize(6)); Set<String> allAttributeNames = allAttributes.stream().map(AttributeDescriptor::getName).collect(Collectors.toSet()); final Set<String> expectedAttributes = Sets.newHashSet( "attribute1", "attribute2", "attribute3", "attribute4", "attribute5", "attribute6"); assertThat(allAttributeNames, is(expectedAttributes)); }
Source:
<code><START> public MemberSearchRequestBuilder filterBySet(String setId) { <END> return addOption(OptionKey.SET, setId); }</code><technical_language>Add support for multi-valued filtering Set ID a filterBySets(Iterable<String>) method</technical_language>

Target:
public MemberSearchRequestBuilder filterBySet(String setId) { return filterBySets(ImmutableSet.of(setId)); }
Source:
<code>public void targetMemberIsSetIfMemberOptionsIsUsed() { <START> QueryCommand spyCommand = spy(command); DistributedMember member = mock(DistributedMember.class); <END> String query = "select query"; String memberName = "member"; doReturn(member).when(spyCommand).getMember(memberName); doReturn(mock(DataCommandResult.class)).when(spyCommand).select(query, member); spyCommand.query(query, null, false, memberName); verify(spyCommand).select(query, member); }</code><technical_language>put lines in a @Before setup method need repeat for test</technical_language>

Target:
public void targetMemberIsSetIfMemberOptionsIsUsed() { DistributedMember member = mock(DistributedMember.class); String query = "select query"; String memberName = "member"; doReturn(member).when(spyCommand).getMember(memberName); doReturn(mock(DataCommandResult.class)).when(spyCommand).select(query, member); spyCommand.query(query, null, false, memberName); verify(spyCommand).select(query, member); }
Source:
<code>public GsonConverter(Gson gson, Charset charset) { this.gson = gson; this.charset = charset; <START> this.mediaType = MediaType.parse("application/json; charset=" + charset.name()); <END> }</code><technical_language>Do want API this? MediaType.parse("application/json").withCharset(charset)</technical_language>

Target:
public GsonConverter(Gson gson, Charset charset) { if (gson == null) throw new NullPointerException("gson == null"); if (charset == null) throw new NullPointerException("charset == null"); this.gson = gson; this.charset = charset; this.mediaType = MediaType.parse("application/json; charset=" + charset.name()); }
Source:
<code>public static int verifyTally(String testLabels, EMap<String, LabelInfo> labels) { int state = 0, prevState; if (labels != null && labels.get(testLabels) != null) { <START> for (Map.Entry<String, LabelInfo> entry : labels.entrySet()) { <END> if (entry.getKey() != null && entry.getKey().compareTo(testLabels) == 0) { LabelInfo labelInfo = entry.getValue(); if (labelInfo.getAll() != null) { for (ApprovalInfo it : labelInfo.getAll()) { if (it.getValue() != null) { prevState = state; state = Utils.getStateValue(it.getValue(), state); if (testLabels.compareTo(CODE_REVIEW) == 0) { if (state <= -1) { if (state < prevState) { state = Math.min(state, prevState); } } else if (state >= 1) { if (state > prevState && !(prevState < 0)) { state = Math.max(state, prevState); } else if (prevState < state) { state = prevState; } } } } } } } } } return state; }</code><technical_language>please opportunity of this change get rid of this for loop? This get replaced a simple lookup in labels map</technical_language>

Target:
public static int verifyTally(String testLabels, EMap<String, LabelInfo> labels) { int state = 0, prevState; if (labels == null) { return state; } LabelInfo labelInfo = labels.get(testLabels); if (labelInfo == null) { return state; } if (labelInfo.getAll() != null) { for (ApprovalInfo it : labelInfo.getAll()) { if (it.getValue() != null) { prevState = state; state = Utils.getStateValue(it.getValue(), state); if (testLabels.compareTo(CODE_REVIEW) == 0) { if (state <= -1) { if (state < prevState) { state = Math.min(state, prevState); } } else if (state >= 1) { if (state > prevState && !(prevState < 0)) { state = Math.max(state, prevState); } else if (prevState < state) { state = prevState; } } } } } } return state; }
Source:
<code>public Raster readRaster(int frameIndex, ImageReadParam param) throws IOException { readMetadata(); checkIndex(frameIndex); Raster raster; <START> try (ImageInputStream iisOfFrame = iisOfFrame( frameIndex)) { <END> if (decompressor != null) { decompressor.setInput(iisOfFrame); if (LOG.isDebugEnabled()) LOG.debug("Start decompressing frame #" + (frameIndex + 1)); raster = pmi.decompress() == pmi && decompressor.canReadRaster() ? decompressor.readRaster(0, decompressParam(param)) : decompressor.read(0, decompressParam(param)).getRaster(); if (LOG.isDebugEnabled()) LOG.debug("Finished decompressing frame #" + (frameIndex + 1)); } else { WritableRaster wr = Raster.createWritableRaster(createSampleModel(dataType, banded), null); DataBuffer buf = wr.getDataBuffer(); if (buf instanceof DataBufferByte) { byte[][] data = ((DataBufferByte) buf).getBankData(); for (byte[] bs : data) { System.out.printf("Filling buffer of size %s from %s with offset %s and remaining %s", bs.length, iisOfFrame.toString(), iisOfFrame.getStreamPosition(), iisOfFrame.length() - iisOfFrame.getStreamPosition()); iisOfFrame.readFully(bs); } if (this.metadata.getPixelDataVR() == VR.OW && bigEndian()) { ByteUtils.swapShorts(data); } } else { short[] data = ((DataBufferUShort) buf).getData(); iisOfFrame.readFully(data, 0, data.length); } raster = wr; } } return raster; }</code><technical_language>This is cleaner open/close this worrying underlying state</technical_language>

Target:
public Raster readRaster(int frameIndex, ImageReadParam param) throws IOException { readMetadata(); checkIndex(frameIndex); Raster raster; try (ImageInputStream iisOfFrame = iisOfFrame( frameIndex)) { if (decompressor != null) { decompressor.setInput(iisOfFrame); LOG.debug("Start decompressing frame # {}", (frameIndex + 1)); PhotometricInterpretation pmi = getAccessor().getPhotometricInterpretation(); raster = pmi.decompress() == pmi && decompressor.canReadRaster() ? decompressor.readRaster(0, decompressParam(param)) : decompressor.read(0, decompressParam(param)).getRaster(); if (LOG.isDebugEnabled()) LOG.debug("Finished decompressing frame #" + (frameIndex + 1)); } else { WritableRaster wr = Raster.createWritableRaster(createSampleModel(getAccessor().getDataType(), getAccessor().isBanded()), null); DataBuffer buf = wr.getDataBuffer(); if (buf instanceof DataBufferByte) { byte[][] data = ((DataBufferByte) buf).getBankData(); for (byte[] bs : data) { LOG.debug("Filling buffer of size from with offset and remaining {}", bs.length, iisOfFrame.toString(), iisOfFrame.getStreamPosition(), iisOfFrame.length() - iisOfFrame.getStreamPosition()); iisOfFrame.readFully(bs); } if (getAccessor().isSwapShortsRequired()) { ByteUtils.swapShorts(data); } } else { short[] data = ((DataBufferUShort) buf).getData(); iisOfFrame.readFully(data, 0, data.length); } raster = wr; } } return raster; }
Source:
<code>void fillPolygonInPixels (int[] pointArray) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); checkGC(FILL); if (data.gdipGraphics != 0) { int mode = OS.GetPolyFillMode(handle) == OS.WINDING ? Gdip.FillModeWinding : Gdip.FillModeAlternate; <START> Gdip.Graphics_TranslateTransform(data.gdipGraphics, data.gdipXOffset + 1, data.gdipYOffset, Gdip.MatrixOrderPrepend); <END> Gdip.Graphics_FillPolygon(data.gdipGraphics, data.gdipBrush, pointArray, pointArray.length / 2, mode); Gdip.Graphics_TranslateTransform(data.gdipGraphics, -(data.gdipXOffset + 1), -data.gdipYOffset, Gdip.MatrixOrderPrepend); return; } if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]--; } } OS.Polygon(handle, pointArray, pointArray.length / 2); if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]++; } } }</code><technical_language>Actually... I this is is required Gdip.Graphics_TranslateTransform(gdipGraphics, data.gdipXOffset, data.gdipYOffset, Gdip.MatrixOrderPrepend);</technical_language>

Target:
void fillPolygonInPixels (int[] pointArray) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); checkGC(FILL); if (data.gdipGraphics != 0) { int mode = OS.GetPolyFillMode(handle) == OS.WINDING ? Gdip.FillModeWinding : Gdip.FillModeAlternate; float offsetCorrection = 0.5f; Gdip.Graphics_TranslateTransform(data.gdipGraphics, data.gdipXOffset + offsetCorrection, data.gdipYOffset + offsetCorrection, Gdip.MatrixOrderPrepend); Gdip.Graphics_FillPolygon(data.gdipGraphics, data.gdipBrush, pointArray, pointArray.length / 2, mode); Gdip.Graphics_TranslateTransform(data.gdipGraphics, -(data.gdipXOffset + offsetCorrection), -(data.gdipYOffset + offsetCorrection), Gdip.MatrixOrderPrepend); return; } if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]--; } } OS.Polygon(handle, pointArray, pointArray.length / 2); if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]++; } } }
Source:
<code>public RangePublisherTest() { <START> super(new TestEnvironment(25)); <END> }</code><technical_language>default fine, it</technical_language>

Target:
public RangePublisherTest() { super(new TestEnvironment()); }
Source:
<code>public void process(Region region, EntityBuffer buffer) { if (region.getRegion().encompasses(0, 64, 24)) { Prefab chooseFactionNpc = Assets.getPrefab("LightAndShadow:MagicFool").get(); EntityStore entity = new EntityStore(chooseFactionNpc); entity.addComponent(new LocationComponent(new Vector3f(0, 61, 24))); buffer.enqueue(entity); Prefab beaconMark = Assets.getPrefab("BeaconMark").get(); EntityStore entityStore = new EntityStore(beaconMark); entityStore.addComponent(new LocationComponent(new Vector3f(0, 63, 24))); <START> entityStore.addComponent(new NetworkComponent()); <END> buffer.enqueue(entityStore); } }</code><technical_language>Is a reason for adding this component code prefab</technical_language>

Target:
public void process(Region region, EntityBuffer buffer) { if (region.getRegion().encompasses(0, 64, 24)) { Prefab chooseFactionNpc = Assets.getPrefab("LightAndShadow:MagicFool").get(); EntityStore entity = new EntityStore(chooseFactionNpc); entity.addComponent(new LocationComponent(new Vector3f(0, 61, 24))); buffer.enqueue(entity); Prefab beaconMark = Assets.getPrefab("BeaconMark").get(); EntityStore entityStore = new EntityStore(beaconMark); entityStore.addComponent(new LocationComponent(new Vector3f(0, 63, 24))); buffer.enqueue(entityStore); } }
Source:
<code>public static void addServiceProvider (IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) throws CoreException { ASTNode node= problem.getCoveredNode(context.getASTRoot()); if (! (node instanceof Name) && ! (node.getParent() instanceof ProvidesDirective)) { return; } Name name= (Name) node; ProvidesDirective prov= (ProvidesDirective) name.getParent(); ITypeBinding targetBinding= name.resolveTypeBinding(); ITypeBinding serviceBinding= prov.getName().resolveTypeBinding(); if (targetBinding != null && serviceBinding != null) { ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(context.getCompilationUnit(), context.getASTRoot(), targetBinding); IJavaProject proj= context.getCompilationUnit().getJavaProject(); IType type= proj.findType(serviceBinding.getQualifiedName()); ITypeHierarchy th= <START> type.newTypeHierarchy(null); <END> IType[] subTypes= th.getAllSubtypes(type); List<IType> typeProposals= new ArrayList<> (Arrays.asList(type)); typeProposals.addAll(Arrays.asList(subTypes)); Image image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC); for (IType t : typeProposals) { if (proj.findType(t.getFullyQualifiedName()) != null && Flags.isPublic(t.getFlags())) { proposals.add(new NewProviderMethodDeclaration( Messages.format(CorrectionMessages.LocalCorrectionsSubProcessor_add_provider_method_description, t.getElementName()), targetCU, context.getASTRoot(), targetBinding, IProposalRelevance.CREATE_METHOD, image, t.getElementName())); } } } }</code><technical_language>I if type.newTypeHierarchy(context.getCompilationUnit().getJavaProject(), null) perform filtering 'workaround' below. test this</technical_language>

Target:
public static void addServiceProvider (IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) throws CoreException { ASTNode node= problem.getCoveredNode(context.getASTRoot()); if (! (node instanceof Name) && ! (node.getParent() instanceof ProvidesDirective)) { return; } Name name= (Name) node; ProvidesDirective prov= (ProvidesDirective) name.getParent(); ITypeBinding targetBinding= name.resolveTypeBinding(); ITypeBinding serviceBinding= prov.getName().resolveTypeBinding(); if (targetBinding != null && serviceBinding != null) { ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(context.getCompilationUnit(), context.getASTRoot(), targetBinding); IJavaProject proj= context.getCompilationUnit().getJavaProject(); IType type= proj.findType(serviceBinding.getQualifiedName()); ITypeHierarchy th= type.newTypeHierarchy(proj, null); IType[] subTypes= th.getAllSubtypes(type); List<IType> typeProposals= new ArrayList<> (Arrays.asList(type)); typeProposals.addAll(Arrays.asList(subTypes)); Image image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC); for (IType t : typeProposals) { proposals.add(new NewProviderMethodDeclaration( Messages.format(CorrectionMessages.LocalCorrectionsSubProcessor_add_provider_method_description, t.getElementName()), targetCU, context.getASTRoot(), targetBinding, IProposalRelevance.CREATE_METHOD, image, t)); } } }
Source:
<code>public ExecTransformationProfile(ProfileCallback callback, ProfileContext context, TransformationService service) { this.service = service; this.callback = callback; Object paramFunction = context.getConfiguration().get(FUNCTION_PARAM); Object paramSource = context.getConfiguration().get(SOURCE_FORMAT_PARAM); logger.debug("Profile configured with '{}'='{}', '{}'={}", FUNCTION_PARAM, paramFunction, SOURCE_FORMAT_PARAM, paramSource); if (paramSource == null) { paramSource = "%s"; } if (paramFunction instanceof String && paramSource instanceof String) { function = (String) paramFunction; sourceFormat = (String) paramSource; } else { <START> logger.warn("Parameter '{}' and '{}' have to be Strings. Profile will be inactive.", FUNCTION_PARAM, <END> SOURCE_FORMAT_PARAM); function = null; sourceFormat = null; } }</code><technical_language>log error construction time warn in onCommandFromHandler onStateUpdateFromHandler</technical_language>

Target:
public ExecTransformationProfile(ProfileCallback callback, ProfileContext context, TransformationService service) { this.service = service; this.callback = callback; Object paramFunction = context.getConfiguration().get(FUNCTION_PARAM); Object paramSource = context.getConfiguration().get(SOURCE_FORMAT_PARAM); logger.debug("Profile configured with '{}'='{}', '{}'={}", FUNCTION_PARAM, paramFunction, SOURCE_FORMAT_PARAM, paramSource); if (paramSource == null) { paramSource = "%s"; } if (paramFunction instanceof String && paramSource instanceof String) { function = (String) paramFunction; sourceFormat = (String) paramSource; } else { logger.error("Parameter '{}' and '{}' have to be Strings. Profile will be inactive.", FUNCTION_PARAM, SOURCE_FORMAT_PARAM); function = null; sourceFormat = null; } }
Source:
<code>public void processDeviceChange(UUID idOfRequestingUser, UUID relatedUserAnonymizedId, DeviceChange change, UUID deviceAnonymizedId, Optional<String> oldName, Optional<String> newName) { <START> User user = userService.getValidatedUserbyId(idOfRequestingUser); <END> Buddy buddy = user.getBuddyByUserAnonymizedId(relatedUserAnonymizedId); switch (change) { case ADD: addDeviceToBuddy(buddy, deviceAnonymizedId, newName.get()); break; case RENAME: updateDeviceNameForToBuddy(buddy, deviceAnonymizedId, newName.get()); break; case DELETE: removeDeviceFromBuddy(buddy, deviceAnonymizedId); break; default: throw new IllegalArgumentException("Change " + change + " is unknown"); } }</code><technical_language>getValidatedUserById</technical_language>

Target:
public void processDeviceChange(UUID idOfRequestingUser, UUID relatedUserAnonymizedId, DeviceChange change, UUID deviceAnonymizedId, Optional<String> oldName, Optional<String> newName) { User user = userService.getValidatedUserById(idOfRequestingUser); Buddy buddy = user.getBuddyByUserAnonymizedId(relatedUserAnonymizedId); switch (change) { case ADD: addDeviceToBuddy(buddy, deviceAnonymizedId, newName.get()); break; case RENAME: updateDeviceNameForToBuddy(buddy, deviceAnonymizedId, newName.get()); break; case DELETE: removeDeviceFromBuddy(buddy, deviceAnonymizedId); break; default: throw new IllegalArgumentException("Change " + change + " is unknown"); } }
Source:
<code>public static void main(String[] args) { DataGenerator generator = new DataGenerator(new Configuration()); if (args.length < 1) { System.err.println("Please specify a command (generate VERSION|cleanup)."); System.exit(1); } String command = args[0]; if (command.equalsIgnoreCase("generate")) { if (args.length < 2 || args.length > 3) { System.err.println("Usage: generate VERSION [-randomData]\n"); System.err.println("Options:"); System.err.println(" VERSION Use a specific parquet file version to generate data."); System.err.println(" - v1 for PARQUET_1_0 version."); System.err.println(" - v2 for PARQUET_2_0 version."); <START> System.err.println(" -randomData This flag specifies if random data will be used to generate data."); <END> System.err.println(" By default, only 1 random row is generated, and repeated across the file."); System.exit(1); } String parquetVersion = args[1]; if (args.length == 3 && args[2].equalsIgnoreCase("-randomData")) { generator.initializeRandomSampleData(RANDOM_SAMPLE_ROWS); } else { System.err.println("Unknown option: " + args[2]); System.exit(1); } generator.setWriterVersion(WriterVersion.fromString(parquetVersion)); generator.generateAll(); } else if (command.equalsIgnoreCase("cleanup")) { generator.cleanup(); } else { throw new IllegalArgumentException("invalid command " + command); } }</code><technical_language>Is randomData optional? I version generate some data (with a command .... org.apache.parquet.benchmarks.DataGenerator generate v2) I get exception Java Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 org.apache.parquet.benchmarks.DataGenerator.main(DataGenerator.java:188)</technical_language>

Target:
public static void main(String[] args) { DataGenerator generator = new DataGenerator(new Configuration()); if (args.length < 1) { System.err.println("Please specify a command (generate VERSION [-randomData]|cleanup)."); System.exit(1); } String command = args[0]; if (command.equalsIgnoreCase("generate")) { if (args.length < 2 || args.length > 3) { System.err.println("Usage: generate VERSION [-randomData]\n"); System.err.println("Options:"); System.err.println(" VERSION Use a specific parquet file version to generate data."); System.err.println(" - v1 for PARQUET_1_0 version."); System.err.println(" - v2 for PARQUET_2_0 version."); System.err.println(" -randomData This flag specifies if random data will be used to generate data."); System.err.println(" By default, only 1 random row is generated, and repeated across the file."); System.exit(1); } String parquetVersion = args[1]; if (args.length == 3) { if (args[2].equalsIgnoreCase("-randomData")) { generator.initializeRandomSampleData(RANDOM_SAMPLE_ROWS); } else { System.err.println("Unknown option: " + args[2]); System.exit(1); } } generator.setWriterVersion(WriterVersion.fromString(parquetVersion)); generator.generateAll(); } else if (command.equalsIgnoreCase("cleanup")) { generator.cleanup(); } else { throw new IllegalArgumentException("invalid command " + command); } }
Source:
<code>private static List<ColumnReference> matchIndexExpression(RelationalOperator relOp, InListOperatorNode inNode, boolean isIn, boolean isProbe, ValueNode indexExprAst, Optimizable optTable) throws StandardException { CollectNodesVisitor cnv = new CollectNodesVisitor(ColumnReference.class); int tableNumber = optTable.getTableNumber(); if (isIn) { if (inNode.getLeftOperand().equals(indexExprAst)) { inNode.getLeftOperand().accept(cnv); if (isProbe) { assert relOp instanceof BinaryOperatorNode; BinaryOperatorNode binOp = (BinaryOperatorNode) relOp; binOp.setMatchIndexExpr(tableNumber, true); } } } else { if (relOp instanceof BinaryOperatorNode) { BinaryOperatorNode binOp = (BinaryOperatorNode) relOp; if (binOp.getLeftOperand().equals(indexExprAst)) { binOp.getLeftOperand().accept(cnv); binOp.setMatchIndexExpr(tableNumber, true); } else if (binOp.getRightOperand().equals(indexExprAst)) { binOp.getRightOperand().accept(cnv); binOp.setMatchIndexExpr(tableNumber, false); } } else if (relOp instanceof IsNullNode) { IsNullNode isNull = (IsNullNode) relOp; if (isNull.getOperand().equals(indexExprAst)) { isNull.getOperand().accept(cnv); } } } <START> return cnv.getList(); <END> }</code><technical_language>caller of matchIndexExpression(), list of column references useful, a boolean returned sufficient</technical_language>

Target:
private static boolean matchIndexExpression(RelationalOperator relOp, InListOperatorNode inNode, boolean isIn, boolean isProbe, ValueNode indexExprAst, Optimizable optTable) { boolean match = false; int tableNumber = optTable.getTableNumber(); if (isIn) { if (inNode.getLeftOperand().semanticallyEquals(indexExprAst)) { match = true; if (isProbe) { assert relOp instanceof BinaryOperatorNode; BinaryOperatorNode binOp = (BinaryOperatorNode) relOp; binOp.setMatchIndexExpr(tableNumber, true); } } } else { if (relOp instanceof BinaryOperatorNode) { BinaryOperatorNode binOp = (BinaryOperatorNode) relOp; if (binOp.getLeftOperand().semanticallyEquals(indexExprAst)) { match = true; binOp.setMatchIndexExpr(tableNumber, true); } else if (binOp.getRightOperand().semanticallyEquals(indexExprAst)) { match = true; binOp.setMatchIndexExpr(tableNumber, false); } } else if (relOp instanceof IsNullNode) { IsNullNode isNull = (IsNullNode) relOp; if (isNull.getOperand().semanticallyEquals(indexExprAst)) { match = true; } } } return match; }
Source:
<code>public void testCompositeBlobGetSuccess() throws Exception { router = getNonBlockingRouter(); setOperationParams(chunkSize * 6 + 11, null); <START> String blobId = router.putBlob(putBlobProperties, putUserMetadata, putChannel).get(); <END> BlobInfo blobInfo = router.getBlobInfo(blobId).get(); Assert.assertTrue("Blob properties should match", RouterTestHelpers.haveEquivalentFields(putBlobProperties, blobInfo.getBlobProperties())); Assert.assertArrayEquals("User metadata should match", putUserMetadata, blobInfo.getUserMetadata()); getBlobAndCompareContent(blobId); router.close(); }</code><technical_language>chance put lines a function? (Considering next test lines)</technical_language>

Target:
public void testCompositeBlobGetSuccess() throws Exception { testGetSuccess(chunkSize * 6 + 11, null); }
Source:
<code>public void initialize(String blobProviderId, Map<String, String> properties) throws IOException { super.initialize(blobProviderId, properties); this.properties = properties; if (StringUtils.isNotBlank(properties.get(SERVER_PROPERTY)) || StringUtils.isNotBlank(properties.get(DBNAME_PROPERTY))) { throw new NuxeoException("Unable to initialize GridFS Binary Manager, properties " + SERVER_PROPERTY + " and " + DBNAME_PROPERTY + " has been removed. Please configure a connection!"); } String bucket = properties.get(BUCKET_PROPERTY); if (StringUtils.isBlank(bucket)) { bucket = blobProviderId + ".fs"; } MongoDBConnectionService mongoService = Framework.getService(MongoDBConnectionService.class); <START> MongoDatabase database = mongoService.getDatabase("blobProvider/" + blobProviderId); <END> gridFSBucket = GridFSBuckets.create(database, bucket); filesColl = database.getCollection(bucket + ".files"); garbageCollector = new GridFSBinaryGarbageCollector(bucket); }</code><technical_language>a constant of "blobProvider/" add some doc explaining prefix chosen get MongoDB database for this blob provider</technical_language>

Target:
public void initialize(String blobProviderId, Map<String, String> properties) throws IOException { super.initialize(blobProviderId, properties); this.properties = properties; if (StringUtils.isNotBlank(properties.get(SERVER_PROPERTY)) || StringUtils.isNotBlank(properties.get(DBNAME_PROPERTY))) { throw new NuxeoException("Unable to initialize GridFS Binary Manager, properties " + SERVER_PROPERTY + " and " + DBNAME_PROPERTY + " has been removed. Please configure a connection!"); } String bucket = properties.get(BUCKET_PROPERTY); if (StringUtils.isBlank(bucket)) { bucket = blobProviderId + ".fs"; } MongoDBConnectionService mongoService = Framework.getService(MongoDBConnectionService.class); MongoDatabase database = mongoService.getDatabase(BLOB_PROVIDER_CONNECTION_PREFIX + blobProviderId); gridFSBucket = GridFSBuckets.create(database, bucket); filesColl = database.getCollection(bucket + ".files"); garbageCollector = new GridFSBinaryGarbageCollector(bucket); }
Source:
<code>protected void runApplication(String[] args) throws Exception { LOG.info("Running 'run-application' command."); final Options commandOptions = CliFrontendParser.getRunCommandOptions(); final CommandLine commandLine = getCommandLine(commandOptions, args, true); if (commandLine.hasOption(HELP_OPTION.getOpt())) { CliFrontendParser.printHelpForRun(customCommandLines); return; } final CustomCommandLine activeCommandLine = validateAndGetActiveCommandLine(checkNotNull(commandLine)); <START> ProgramOptions programOptions; <END> if (ProgramOptionsUtils.isPythonEntryPoint(commandLine)) { programOptions = ProgramOptionsUtils.createPythonApplicationProgramOptions(commandLine); } else { programOptions = new ProgramOptions(commandLine); } final ApplicationDeployer deployer = new ApplicationClusterDeployer(clusterClientServiceLoader); programOptions.validate(); final URI uri = PackagedProgramUtils.resolveURI(programOptions.getJarFilePath()); final Configuration effectiveConfiguration = getEffectiveConfiguration( activeCommandLine, commandLine, programOptions, Collections.singletonList(uri.toString())); final ApplicationConfiguration applicationConfiguration = new ApplicationConfiguration(programOptions.getProgramArgs(), programOptions.getEntryPointClassName()); deployer.run(effectiveConfiguration, applicationConfiguration); }</code><technical_language>programOptions final here. Please try define a local variable final</technical_language>

Target:
protected void runApplication(String[] args) throws Exception { LOG.info("Running 'run-application' command."); final Options commandOptions = CliFrontendParser.getRunCommandOptions(); final CommandLine commandLine = getCommandLine(commandOptions, args, true); if (commandLine.hasOption(HELP_OPTION.getOpt())) { CliFrontendParser.printHelpForRun(customCommandLines); return; } final CustomCommandLine activeCommandLine = validateAndGetActiveCommandLine(checkNotNull(commandLine)); final ApplicationDeployer deployer = new ApplicationClusterDeployer(clusterClientServiceLoader); final ProgramOptions programOptions; final Configuration effectiveConfiguration; if (ProgramOptionsUtils.isPythonEntryPoint(commandLine)) { programOptions = ProgramOptionsUtils.createPythonProgramOptions(commandLine); effectiveConfiguration = getEffectiveConfiguration( activeCommandLine, commandLine, programOptions, Collections.emptyList()); } else { programOptions = new ProgramOptions(commandLine); programOptions.validate(); final URI uri = PackagedProgramUtils.resolveURI(programOptions.getJarFilePath()); effectiveConfiguration = getEffectiveConfiguration( activeCommandLine, commandLine, programOptions, Collections.singletonList(uri.toString())); } final ApplicationConfiguration applicationConfiguration = new ApplicationConfiguration(programOptions.getProgramArgs(), programOptions.getEntryPointClassName()); deployer.run(effectiveConfiguration, applicationConfiguration); }
Source:
<code><START> private void writeVoidPromise(ChannelHandlerContext ctx, CodecOutputList out) { <END> final ChannelPromise voidPromise = ctx.voidPromise(); for (int i = 0; i < out.size(); i++) { ctx.write(out.getUnsafe(i), voidPromise); } }</code><technical_language>static</technical_language>

Target:
private static void writeVoidPromise(ChannelHandlerContext ctx, CodecOutputList out) { final ChannelPromise voidPromise = ctx.voidPromise(); for (int i = 0; i < out.size(); i++) { ctx.write(out.getUnsafe(i), voidPromise); } }
Source:
<code>public String getColumnText(Object element, XViewerColumn column, int columnIndex) { <START> try { <END> if (element instanceof Artifact) { Collection<IUserGroupArtifactToken> userGroups = UserGroupService.getUserGrps(); if (userGroups.isEmpty()) { return ""; } String strUserGroupsOut = ""; for (IUserGroupArtifactToken usr : userGroups) { strUserGroupsOut += usr.getName().substring(usr.getName().indexOf("[")) + ", "; } return strUserGroupsOut.substring(0, strUserGroupsOut.length() - 2); } else { return ""; } } catch (OseeCoreException ex) { return LogUtil.getCellExceptionString(ex); } }</code><technical_language>code is display current user's user groups. want user groups for ((User)element if a user artifact, else "" if (element instanceof User) { for (Aritfact userGroup: ((User)element).getRelatedArtifacts(CoreRelationTypes.Users_Artifact)) { str += userGroup.toStringWithId() + "," } }</technical_language>

Target:
public String getColumnText(Object element, XViewerColumn column, int columnIndex) { try { if (element instanceof User) { Collection<Artifact> userGroups = ((User) element).getRelatedArtifacts(CoreRelationTypes.Users_Artifact); if (userGroups.isEmpty()) { return ""; } String strUserGroupsOut = ""; for (Artifact usr : userGroups) { strUserGroupsOut += usr.toStringWithId() + ", "; } return strUserGroupsOut.substring(0, strUserGroupsOut.length() - 2); } else { return ""; } } catch (OseeCoreException ex) { return LogUtil.getCellExceptionString(ex); } }
Source:
<code>private void showMenu() { if (mNavigationView != null) { final int accountCount = AccountManager.get(this) .getAccountsByType(MainApp.getAccountType()).length; if (mIsAccountChooserActive) { mAccountChooserToggle.setImageResource(R.drawable.ic_up); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, true); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, false); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_settings_etc, false); <START> if(mDrawerCloud != null && accountCount > 4) mDrawerCloud.setVisibility(View.GONE); <END> } else { mAccountChooserToggle.setImageResource(R.drawable.ic_down); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, false); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, true); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_settings_etc, true); if(mDrawerCloud != null) mDrawerCloud.setVisibility(View.VISIBLE); } } }</code><technical_language>creating a new constant 4 value</technical_language>

Target:
private void showMenu() { if (mNavigationView != null) { final int accountCount = AccountManager.get(this) .getAccountsByType(MainApp.getAccountType()).length; if (mIsAccountChooserActive) { mAccountChooserToggle.setImageResource(R.drawable.ic_up); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, true); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, false); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_settings_etc, false); if(mDrawerCloud != null && accountCount > USER_ITEMS_ALLOWD_BEFORE_REMOVING_CLOUD) mDrawerCloud.setVisibility(View.GONE); } else { mAccountChooserToggle.setImageResource(R.drawable.ic_down); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, false); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, true); mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_settings_etc, true); if(mDrawerCloud != null) mDrawerCloud.setVisibility(View.VISIBLE); } } }
Source:
<code>public void should_not_explode_if_bad_json_response() throws Exception { eslintBridgeServer = createEslintBridgeServer("badResponse.js"); eslintBridgeServer.deploy(); eslintBridgeServer.startServerLazily(context); DefaultInputFile inputFile = TestInputFileBuilder.create("foo", "foo.js") .setContents("alert('Fly, you fools!')") .build(); EslintBridgeServer.AnalysisRequest request = new EslintBridgeServer.AnalysisRequest(inputFile, new EslintBridgeServer.Rule[0]); <START> eslintBridgeServer.call(request); <END> assertThat(logTester.logs(LoggerLevel.ERROR).get(0)).startsWith("Failed to parse: \n" + "-----\n" + "Invalid response\n" + "-----\n"); assertThat(context.allIssues()).isEmpty(); }</code><technical_language>check return of this call</technical_language>

Target:
public void should_not_explode_if_bad_json_response() throws Exception { eslintBridgeServer = createEslintBridgeServer("badResponse.js"); eslintBridgeServer.deploy(); eslintBridgeServer.startServerLazily(context); DefaultInputFile inputFile = TestInputFileBuilder.create("foo", "foo.js") .setContents("alert('Fly, you fools!')") .build(); AnalysisRequest request = new AnalysisRequest(inputFile, new Rule[0]); EslintBridgeServer.AnalysisResponse response = eslintBridgeServer.analyzeJavaScript(request); assertThat(response.issues).isEmpty(); assertThat(logTester.logs(LoggerLevel.ERROR).get(0)).startsWith("Failed to parse: \n" + "-----\n" + "Invalid response\n" + "-----\n"); assertThat(context.allIssues()).isEmpty(); }
Source:
<code>public Element caseAssociation(Association association) { if (isReconnectable(association)) { if (RECONNECT_SOURCE == reconnectKind) { if (association.getMemberEnds().size() > 2) { <START> final String sourceObject = edgeToReconnect.getSourceNode().toString(); <END> final List<Property> members = association.getMemberEnds(); for (final Property member : members) { final String typeName = member.getType().getName(); if (sourceObject.contains(typeName)) { member.setType((Type)newPointedElement); } } } else { final Property source = AssociationServices.INSTANCE.getSource(association); source.setType((Type)newPointedElement); } } else { final Property target = AssociationServices.INSTANCE.getTarget(association); target.setType((Type)newPointedElement); } } return association; }</code><technical_language>Instead of toString EObject compare for example : private Property getSourceEndNaryAssociation(Association association, DDiagramElement view){ final DEdge edge = (DEdge)view; final List<Property> members = association.getMemberEnds(); final DNodeListSpec source = (DNodeListSpec)edge.getSourceNode(); final List<EObject> sourceSemanticElements = source.getSemanticElements(); for (final EObject sourceEObject : sourceSemanticElements) { for (final Property member : members) { if (sourceEObject.equals(member.getType())) { return member; } } } return null; }</technical_language>

Target:
public Element caseAssociation(Association association) { if (isReconnectable(association)) { if (RECONNECT_SOURCE == reconnectKind) { if (association.getMemberEnds().size() > 2) { final Property end = AssociationServices.INSTANCE.getSourceEndAssociation(association, edgeToReconnect); end.setType((Type)newPointedElement); } else { final Property source = AssociationServices.INSTANCE.getSource(association); source.setType((Type)newPointedElement); } } else { final Property target = AssociationServices.INSTANCE.getTarget(association); target.setType((Type)newPointedElement); } } return association; }
Source:
<code><START> public ArrayList<Integer> sample_value_use_binomial() { <END> BinomialDistribution binom = null; int cur = 0; double cdf = 0; ArrayList<Integer> result = new ArrayList<Integer>(k); for (int i = 0; i < k - 1; i++) { if (n == cur) { result.add(0); continue; } binom = new BinomialDistribution(n - cur, p[i] / (1.0 - cdf)); int x = binom.sample(); cur += x; cdf += p[i]; result.add(x); } result.add(n - cur); return result; }</code><technical_language>private. called</technical_language>

Target:
private ArrayList<Integer> sample_value_use_binomial() { BinomialDistribution binom = null; int cur = 0; double cdf = 0; ArrayList<Integer> result = new ArrayList<Integer>(k); for (int i = 0; i < k - 1; i++) { if (n == cur) { result.add(0); continue; } binom = new BinomialDistribution(n - cur, p[i] / (1.0 - cdf)); int x = binom.sample(); cur += x; cdf += p[i]; result.add(x); } result.add(n - cur); return result; }
Source:
<code>protected JdbcConnectionOptions(String url, String driverName, String username, String password, int connectionCheckTimeoutSeconds) { this.url = Preconditions.checkNotNull(url, "jdbc url is empty"); this.driverName = Preconditions.checkNotNull(driverName, "driver name is empty"); this.username = username; this.password = password; this.connectionCheckTimeoutSeconds = connectionCheckTimeoutSeconds; <START> } <END></code><technical_language>validate seconds again, this is a public API, users in JdbcSink</technical_language>

Target:
protected JdbcConnectionOptions(String url, String driverName, String username, String password, int connectionCheckTimeoutSeconds) { Preconditions.checkArgument(connectionCheckTimeoutSeconds > 0); this.url = Preconditions.checkNotNull(url, "jdbc url is empty"); this.driverName = Preconditions.checkNotNull(driverName, "driver name is empty"); this.username = username; this.password = password; this.connectionCheckTimeoutSeconds = connectionCheckTimeoutSeconds; }
Source:
<code>public void execute(IProgressMonitor monitor) throws CoreException { IWorkspaceRunnable action = new IWorkspaceRunnable() { <START> public void run(IProgressMonitor monitor) throws CoreException { <END> List<IResource> allFiles = new ArrayList<IResource>(); for (IResource res : files) { allFiles.addAll(getAllMembers(res)); } for (IResource res : allFiles) { Repository repo = getRepository(res); if (repo == null) { IStatus status = Activator.error( CoreText.DiscardChangesOperation_repoNotFound, null); throw new CoreException(status); } discardChange(res, repo, monitor); } } }; ResourcesPlugin.getWorkspace().run(action, monitor); }</code><technical_language>Please convert monitor a SubMonitor split work units. is pass original monitor discardChange(*) method implies monitor marked completed iteration leads incorrect progress reporting. :(</technical_language>

Target:
public void execute(IProgressMonitor monitor) throws CoreException { IWorkspaceRunnable action = new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { discardChanges(monitor); } }; ResourcesPlugin.getWorkspace().run(action, getSchedulingRule(), IWorkspace.AVOID_UPDATE, monitor); }
Source:
<code>private static AccountDiffPreference initAccountDiffPreferences( AccountDiffPreference a, DiffPreferencesInfo i, Account.Id id) { if (a == null) { a = AccountDiffPreference.createDefault(id); } int context = i.context == null ? DiffPreferencesInfo.DEFAULT_CONTEXT : i.context; a.setContext((short)context); a.setExpandAllComments(b(i.expandAllComments)); a.setHideLineNumbers(b(i.hideLineNumbers)); a.setHideTopMenu(b(i.hideTopMenu)); a.setIgnoreWhitespace(Whitespace.forCode( PatchListKey.WHITESPACE_TYPES.get(i.ignoreWhitespace))); a.setIntralineDifference(b(i.intralineDifference)); <START> a.setLineLength(i.lineLength == null ? 100 : i.lineLength); <END> a.setManualReview(i.manualReview); a.setRenderEntireFile(b(i.renderEntireFile)); a.setRetainHeader(b(i.retainHeader)); a.setShowLineEndings(b(i.showLineEndings)); a.setShowTabs(b(i.showTabs)); a.setShowWhitespaceErrors(b(i.showWhitespaceErrors)); a.setSkipDeleted(b(i.skipDeleted)); a.setSkipUncommented(b(i.skipUncommented)); a.setSyntaxHighlighting(b(i.syntaxHighlighting)); a.setTabSize(i.tabSize == null ? 8 : i.tabSize); a.setTheme(i.theme); a.setHideEmptyPane(b(i.hideEmptyPane)); a.setAutoHideDiffTableHeader(b(i.autoHideDiffTableHeader)); return a; }</code><technical_language>100 8 sense constants in AccountDiffPreference? I hard coded in AccountDiffPreference.defaults()</technical_language>

Target:
private static AccountDiffPreference initAccountDiffPreferences( AccountDiffPreference a, DiffPreferencesInfo i, Account.Id id) { if (a == null) { a = AccountDiffPreference.createDefault(id); } int context = i.context == null ? DiffPreferencesInfo.DEFAULT_CONTEXT : i.context; a.setContext((short)context); a.setExpandAllComments(b(i.expandAllComments)); a.setHideLineNumbers(b(i.hideLineNumbers)); a.setHideTopMenu(b(i.hideTopMenu)); a.setIgnoreWhitespace(Whitespace.forCode( PatchListKey.WHITESPACE_TYPES.get(i.ignoreWhitespace))); a.setIntralineDifference(b(i.intralineDifference)); a.setLineLength(i.lineLength == null ? DiffPreferencesInfo.DEFAULT_LINE_LENGTH : i.lineLength); a.setManualReview(i.manualReview); a.setRenderEntireFile(b(i.renderEntireFile)); a.setRetainHeader(b(i.retainHeader)); a.setShowLineEndings(b(i.showLineEndings)); a.setShowTabs(b(i.showTabs)); a.setShowWhitespaceErrors(b(i.showWhitespaceErrors)); a.setSkipDeleted(b(i.skipDeleted)); a.setSkipUncommented(b(i.skipUncommented)); a.setSyntaxHighlighting(b(i.syntaxHighlighting)); a.setTabSize(i.tabSize == null ? DiffPreferencesInfo.DEFAULT_TAB_SIZE : i.tabSize); a.setTheme(i.theme); a.setHideEmptyPane(b(i.hideEmptyPane)); a.setAutoHideDiffTableHeader(b(i.autoHideDiffTableHeader)); return a; }
Source:
<code><START> public <T> AttributeRenderer<? super T> getAttributeRenderer(Class<? extends T> attributeType) { <END> if ( renderers==null ) { return null; } return renderers.get(attributeType); }</code><technical_language>attribute type needs exact here. suggestion public <T> AttributeRenderer<? super T> getAttributeRenderer(Class<T> attributeType) {</technical_language>

Target:
public <T> AttributeRenderer<? super T> getAttributeRenderer(Class<? extends T> attributeType) { if ( renderers==null ) { return null; } return (AttributeRenderer<? super T>) renderers.get(attributeType); }