auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void createTable(HTableDescriptor desc, byte[][] splitKeys) throws IOException { CreateTableRequest.Builder builder = CreateTableRequest.newBuilder(); clusterMetadataSetter.setMetadata(builder); builder.setTableId(desc.getTableName().getQualifierAsString()); builder.setTable(tableAdapter.adapt(desc)); if (splitKeys != null) { <START> for (int i = 0; i < splitKeys.length; i++) { <END> builder.addInitialSplitKeys(new String(splitKeys[i])); } } try { bigtableTableAdminClient.createTable(builder.build()); } catch (Throwable throwable) { throw new IOException( String.format( "Failed to create table '%s'", desc.getTableName().getNameAsString()), throwable); } }</code><technical_language>for (byte[] splitKey : splitKeys) {</technical_language>

Target:
public void createTable(HTableDescriptor desc, byte[][] splitKeys) throws IOException { CreateTableRequest.Builder builder = CreateTableRequest.newBuilder(); clusterMetadataSetter.setMetadata(builder); builder.setTableId(desc.getTableName().getQualifierAsString()); builder.setTable(tableAdapter.adapt(desc)); if (splitKeys != null) { for (byte[] splitKey : splitKeys) { builder.addInitialSplitKeys(Bytes.toString(splitKey)); } } try { bigtableTableAdminClient.createTable(builder.build()); } catch (Throwable throwable) { throw new IOException( String.format( "Failed to create table '%s'", desc.getTableName().getNameAsString()), throwable); } }
Source:
<code>public SubnetSelectionResult selectForPrivateEndpoint(Collection<CloudSubnet> subnetMetas, boolean existingNetwork) { List<CloudSubnet> suitableCloudSubnet; if (existingNetwork) { suitableCloudSubnet = subnetMetas.stream() .filter(sn -> azureCloudSubnetParametersService.isPrivateEndpointNetworkPoliciesDisabled(sn)) .collect(Collectors.toList()); } else { suitableCloudSubnet = new ArrayList<>(subnetMetas); } return suitableCloudSubnet.isEmpty() ? new SubnetSelectionResult("No suitable subnets found for placing a private endpoint") : new SubnetSelectionResult(suitableCloudSubnet); <START> } <END></code><technical_language>is worth adding: ...because of network policy enabled</technical_language>

Target:
public SubnetSelectionResult selectForPrivateEndpoint(Collection<CloudSubnet> subnetMetas, boolean existingNetwork) { List<CloudSubnet> suitableCloudSubnet; if (existingNetwork) { LOGGER.debug("Selecting subnets for private endpoint, existing network"); suitableCloudSubnet = subnetMetas.stream() .filter(sn -> azureCloudSubnetParametersService.isPrivateEndpointNetworkPoliciesDisabled(sn)) .collect(Collectors.toList()); } else { LOGGER.debug("Selecting subnets for private endpoint, new network - all subnets are suitable"); suitableCloudSubnet = new ArrayList<>(subnetMetas); } return suitableCloudSubnet.isEmpty() ? new SubnetSelectionResult("No suitable subnets found for placing a private endpoint") : new SubnetSelectionResult(suitableCloudSubnet); }
Source:
<code>public WebpackDevServerPortView() { Span unique = new Span(String.valueOf(uuid)); unique.setId(UUID_ID); add(unique); DevModeHandler handler = DevModeHandler.getDevModeHandler(); Span portSpan = new Span(String.valueOf(handler.getPort())); portSpan.setId(WEBPACK_PORT_ID); add(portSpan); final NativeButton triggerButton = new NativeButton("Trigger reload", <START> e -> { <END> try { touch(new File( System.getProperty("jetty.scantrigger"))); } catch (IOException ioException) { throw new UncheckedIOException(ioException); } }); triggerButton.setId(TRIGGER_RELOAD_ID); add(triggerButton); }</code><technical_language>Minor : please avoid letter variable . Fix if other fix well..</technical_language>

Target:
public WebpackDevServerPortView() { Span unique = new Span(String.valueOf(uuid)); unique.setId(UUID_ID); add(unique); DevModeHandler handler = DevModeHandler.getDevModeHandler(); Span portSpan = new Span(String.valueOf(handler.getPort())); portSpan.setId(WEBPACK_PORT_ID); add(portSpan); final NativeButton triggerButton = new NativeButton("Trigger reload", event -> { try { touch(new File( System.getProperty("jetty.scantrigger"))); } catch (IOException ioException) { throw new UncheckedIOException(ioException); } }); triggerButton.setId(TRIGGER_RELOAD_ID); add(triggerButton); }
Source:
<code>public synchronized void loadImage(Entity entity, int secondaryPos) { Image base = mechTileset.imageFor(entity, boardview, secondaryPos); Image wreck = wreckTileset.imageFor(entity, boardview, secondaryPos); IPlayer player = entity.getOwner(); int tint = PlayerColors.getColorRGB(player.getColorIndex()); Image camo = CamoManager.getPlayerCamoImage(player); <START> if (entity.getCamoCategory() != null && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) { <END> camo = CamoManager.getEntityCamoImage(entity); } EntityImage entityImage = null; for (Iterator<EntityImage> j = mechImageList.iterator(); j.hasNext();) { EntityImage onList = j.next(); if ((onList.getBase() != null) && onList.getBase().equals(base) && (onList.tint == tint) && (onList.getCamo() != null) && onList.getCamo().equals(camo) && onList.getDmgLvl() == entity.getDamageLevel(false)) { entityImage = onList; break; } } if (entityImage == null) { entityImage = new EntityImage(base, wreck, tint, camo, boardview, entity, secondaryPos); mechImageList.add(entityImage); entityImage.loadFacings(); for (int j = 0; j < 6; j++) { tracker.addImage(entityImage.getFacing(j), 1); } } ArrayList<Integer> temp = new ArrayList<Integer>(); temp.add(entity.getId()); temp.add(secondaryPos); mechImages.put(temp, entityImage); }</code><technical_language>suggestion if ((entity.getCamoCategory() != null) && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) {</technical_language>

Target:
public synchronized void loadImage(Entity entity, int secondaryPos) { Image base = mechTileset.imageFor(entity, boardview, secondaryPos); Image wreck = wreckTileset.imageFor(entity, boardview, secondaryPos); IPlayer player = entity.getOwner(); int tint = PlayerColors.getColorRGB(player.getColorIndex()); Image camo = CamoManager.getPlayerCamoImage(player); if ((entity.getCamoCategory() != null) && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) { camo = CamoManager.getEntityCamoImage(entity); } EntityImage entityImage = null; for (Iterator<EntityImage> j = mechImageList.iterator(); j.hasNext();) { EntityImage onList = j.next(); if ((onList.getBase() != null) && onList.getBase().equals(base) && (onList.tint == tint) && (onList.getCamo() != null) && onList.getCamo().equals(camo) && onList.getDmgLvl() == entity.getDamageLevel(false)) { entityImage = onList; break; } } if (entityImage == null) { entityImage = new EntityImage(base, wreck, tint, camo, boardview, entity, secondaryPos); mechImageList.add(entityImage); entityImage.loadFacings(); for (int j = 0; j < 6; j++) { tracker.addImage(entityImage.getFacing(j), 1); } } ArrayList<Integer> temp = new ArrayList<Integer>(); temp.add(entity.getId()); temp.add(secondaryPos); mechImages.put(temp, entityImage); }
Source:
<code>public byte[] toBytes() { byte[] buf = new byte[size()]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); <START> bufWrap.putShort(getVersion()); <END> bufWrap.putShort((short) getType().ordinal()); bufWrap.putLong(getBytesRead()); Utils.serializeNullableString(bufWrap, startContinuationToken); Utils.serializeNullableString(bufWrap, endContinuationToken); bufWrap.putInt(index); bufWrap.putInt(totalItems); Utils.serializeNullableString(bufWrap, cacheSessionId); return buf; }</code><technical_language>Please consistent getters (getVersion()) straight reference (index, totalItems). I prefer latter</technical_language>

Target:
public byte[] toBytes() { byte[] buf = new byte[size()]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort(version); bufWrap.putShort((short) type.ordinal()); bufWrap.putLong(bytesRead); serializeNullableString(bufWrap, startContinuationToken); serializeNullableString(bufWrap, endContinuationToken); bufWrap.putInt(index); bufWrap.putInt(totalItems); serializeNullableString(bufWrap, cacheSessionId); return buf; }
Source:
<code>private void writeRewrittenHashes() throws RevisionSyntaxException, IOException { File currentCommitFile = rebaseState.getFile(CURRENT_COMMIT); if (!currentCommitFile.exists()) return; <START> ObjectId headId = repo.resolve(Constants.HEAD); if (headId == null) { return; } <END> String head = headId.getName(); String currentCommits = rebaseState.readFile(CURRENT_COMMIT); for (String current : currentCommits.split("\n")) RebaseState .createFile(rebaseState.getRewrittenDir(), current, head); FileUtils.delete(currentCommitFile); }</code><technical_language>caller is processStep. In call(): - ABORT call processStep - reads HEAD throws exception if absent in initFilesAndRewind. - CONTINUE reads HEAD throws exception if absent in continueRebase. - SKIP reads HEAD throws exception if absent in checkoutCurrentHead. - PROCESS_STEPS check HEAD this a behavior change in PROCESS_STEPS case. throw exception HEAD resolve (e.g., calling getHead)</technical_language>

Target:
private void writeRewrittenHashes() throws RevisionSyntaxException, IOException, RefNotFoundException { File currentCommitFile = rebaseState.getFile(CURRENT_COMMIT); if (!currentCommitFile.exists()) return; ObjectId headId = repo.resolve(Constants.HEAD); if (headId == null) { headId = getHead().getObjectId(); } String head = headId.getName(); String currentCommits = rebaseState.readFile(CURRENT_COMMIT); for (String current : currentCommits.split("\n")) RebaseState .createFile(rebaseState.getRewrittenDir(), current, head); FileUtils.delete(currentCommitFile); }
Source:
<code>public void testRun() throws Exception { runIndexTask(); final Builder builder = new Builder( DATA_SOURCE, getObjectMapper(), AuthTestUtils.TEST_AUTHORIZER_MAPPER, null, rowIngestionMetersFactory, coordinatorClient, segmentLoaderFactory, RETRY_POLICY_FACTORY, appenderatorsManager ); final CompactionTask compactionTask = builder .interval(Intervals.of("2014-01-01/2014-01-02")) .build(); final Pair<TaskStatus, List<DataSegment>> resultPair = runTask(compactionTask); Assert.assertTrue(resultPair.lhs.isSuccess()); final List<DataSegment> segments = resultPair.rhs; Assert.assertEquals(3, segments.size()); for (int i = 0; i < 3; i++) { Assert.assertEquals( Intervals.of("2014-01-01T0%d:00:00/2014-01-01T0%d:00:00", i, i + 1), segments.get(i).getInterval() ); Assert.assertEquals( <START> new DynamicPartitionsSpec(5000000, Long.MAX_VALUE), <END> segments.get(i).getCompactionPartitionsSpec() ); if (lockGranularity == LockGranularity.SEGMENT) { Assert.assertEquals( new NumberedOverwriteShardSpec(32768, 0, 2, (short) 1, (short) 1), segments.get(i).getShardSpec() ); } else { Assert.assertEquals(new NumberedShardSpec(0, 0), segments.get(i).getShardSpec()); } } }</code><technical_language>save this a named constant a lot</technical_language>

Target:
public void testRun() throws Exception { runIndexTask(); final Builder builder = new Builder( DATA_SOURCE, getObjectMapper(), AuthTestUtils.TEST_AUTHORIZER_MAPPER, null, rowIngestionMetersFactory, coordinatorClient, segmentLoaderFactory, RETRY_POLICY_FACTORY, appenderatorsManager ); final CompactionTask compactionTask = builder .interval(Intervals.of("2014-01-01/2014-01-02")) .build(); final Pair<TaskStatus, List<DataSegment>> resultPair = runTask(compactionTask); Assert.assertTrue(resultPair.lhs.isSuccess()); final List<DataSegment> segments = resultPair.rhs; Assert.assertEquals(3, segments.size()); for (int i = 0; i < 3; i++) { Assert.assertEquals( Intervals.of("2014-01-01T0%d:00:00/2014-01-01T0%d:00:00", i, i + 1), segments.get(i).getInterval() ); Assert.assertEquals(DEFAULT_COMPACTION_STATE, segments.get(i).getLastCompactionState()); if (lockGranularity == LockGranularity.SEGMENT) { Assert.assertEquals( new NumberedOverwriteShardSpec(32768, 0, 2, (short) 1, (short) 1), segments.get(i).getShardSpec() ); } else { Assert.assertEquals(new NumberedShardSpec(0, 0), segments.get(i).getShardSpec()); } } }
Source:
<code>public final void refreshItems() { final HashSet<Integer> issuesWithNewComments = updateIssueCommentCounts(Qualifier.hasUpdatedQualifier(getCurrentFilterExpression())); listView.setCellFactory(list -> new ListPanelCell(this, panelIndex, issuesWithNewComments)); listView.saveSelection(); listView.setItems(null); listView.setItems(getElementsList()); issueCount = getElementsList().size(); listView.restoreSelection(); this.setId(guiController.getDefaultRepo() + "_col" + panelIndex); totalLabel.setText(String.format("Total: %d ", issueCount)); <START> <END> }</code><technical_language>For benefits of generalising other statistics in future, this line extracted another method called updateFooter updateStatistics for example. (updateFooter in this case more UI oriented)</technical_language>

Target:
public final void refreshItems() { final HashSet<Integer> issuesWithNewComments = updateIssueCommentCounts(Qualifier.hasUpdatedQualifier(getCurrentFilterExpression())); listView.setCellFactory(list -> new ListPanelCell(this, panelIndex, issuesWithNewComments)); listView.saveSelection(); listView.setItems(null); listView.setItems(getElementsList()); issueCount = getElementsList().size(); listView.restoreSelection(); this.setId(guiController.getDefaultRepo() + "_col" + panelIndex); updateFooter(); }
Source:
<code>protected synchronized void loadCatalog() { if (catalog!=null) return; BasicBrooklynCatalog catalog; try { String catalogUrl = getConfig().getConfig(BROOKLYN_CATALOG_URL); catalog = new BasicBrooklynCatalog(this, CatalogDtoUtils.newDtoFromUrl(catalogUrl)); if (log.isDebugEnabled()) log.debug("Loaded catalog from "+catalogUrl+": "+catalog); } catch (Exception e) { Object nonDefaultUrl = getConfig().getRawConfig(BROOKLYN_CATALOG_URL); <START> if (nonDefaultUrl!=null && !"".equals(nonDefaultUrl)) <END> log.warn("Could not read catalog.xml at "+nonDefaultUrl+"; using default (local classpath) catalog. Error was: "+e, e); catalog = new BasicBrooklynCatalog(this, CatalogDtoUtils.newDefaultLocalScanningDto(CatalogScanningModes.TYPES)); if (log.isDebugEnabled()) log.debug("Loaded default (local classpath) catalog: "+catalog); } catalog.getCatalog().load(this, null); this.catalog = catalog; }</code><technical_language>log exception if "default scanner"</technical_language>

Target:
protected synchronized void loadCatalog() { if (catalog!=null) return; BasicBrooklynCatalog catalog; try { String catalogUrl = getConfig().getConfig(BROOKLYN_CATALOG_URL); catalog = new BasicBrooklynCatalog(this, CatalogDtoUtils.newDtoFromUrl(catalogUrl)); if (log.isDebugEnabled()) log.debug("Loaded catalog from "+catalogUrl+": "+catalog); } catch (Exception e) { Object nonDefaultUrl = getConfig().getRawConfig(BROOKLYN_CATALOG_URL); if (nonDefaultUrl!=null && !"".equals(nonDefaultUrl)) { log.warn("Could not read catalog.xml at "+nonDefaultUrl+"; using default (local classpath) catalog. Error was: "+e, e); } else { if (log.isDebugEnabled()) log.debug("No default catalog file available; trying again using local classpath to populate catalog. Error was: "+e); } catalog = new BasicBrooklynCatalog(this, CatalogDtoUtils.newDefaultLocalScanningDto(CatalogScanningModes.TYPES)); if (log.isDebugEnabled()) log.debug("Loaded default (local classpath) catalog: "+catalog); } catalog.getCatalog().load(this, null); this.catalog = catalog; }
Source:
<code>public static boolean isTypeOf(Class<?> type, Object instance) { <START> return instance.getClass().isAssignableFrom(type); <END> }</code><technical_language>fine this server side classes, in this case for ClassUtils, is core-common module, correct, class is visible GWT compiler, I emulate isAssignableFrom method JRE... reason I remember do comparison classname, method is emulated compare js strings... feel free test guys, if wrong lemme agree this change</technical_language>

Target:
public static boolean isTypeOf(Class<?> type, Object instance) { return instance.getClass().getName().equals(type.getName()); }
Source:
<code><START> PieChart getTimeRangePC() { <END> return fTimeRangePC; }</code><technical_language>needs synchronized</technical_language>

Target:
synchronized PieChart getTimeRangePC() { return fTimeRangePC; }
Source:
<code>private int getSpreadIndex(ZonedDateTime atTime) { <START> int dstCorrection = determineDstCorrectionMinutes(atTime); <END> return (int) ((Duration.between(getStartTime(), atTime).toMinutes() - dstCorrection) / 15); }</code><technical_language>easier satisfy tests following: LocalTime localTime = atTime.toLocalTime(); return localTime.getHour() * 4 + localTime.getMinute() / 15;</technical_language>

Target:
private int getSpreadIndex(ZonedDateTime atTime) { LocalDateTime atLocalTime = atTime.toLocalDateTime(); return (int) (Duration.between(getStartTime().toLocalDateTime(), atLocalTime).toMinutes() / 15); }
Source:
<code>public void bind(RpcModule module) throws Exception { if (module != null) { final RpcModule<RpcRequest,RpcResponse> rpcModule = (RpcModule<RpcRequest,RpcResponse>)module; if (routeIdsByModule.containsKey(rpcModule)) { LOG.warn("RpcModule ({}) was already registered", rpcModule.getId(), rpcModule.hashCode()); } else { final DynamicRpcRouteBuilder routeBuilder = new DynamicRpcRouteBuilder(context, identity, rpcModule); context.addRoutes(routeBuilder); routeIdsByModule.put(rpcModule, routeBuilder.getRouteId()); LOG.info("Registered RpcModule ({}) on queue {}", rpcModule.getId(), rpcModule.hashCode(), routeBuilder.getQueueName()); <START> new Exception().printStackTrace(); <END> } } }</code><technical_language>guessing forgot remove this</technical_language>

Target:
public void bind(RpcModule module) throws Exception { if (module != null) { final RpcModule<RpcRequest,RpcResponse> rpcModule = (RpcModule<RpcRequest,RpcResponse>)module; final String routeId = getRouteId(rpcModule); final Route existingRoute = context.getRoute(routeId); if (routeIdsByModule.containsKey(rpcModule)) { if (existingRoute == null) { LOG.error("RpcModule ({}) was marked as registered but its route cannot be found in the Camel context", rpcModule.getId(), Integer.toHexString(rpcModule.hashCode()), routeId ); } else { LOG.warn("RpcModule ({}) was already registered on route {}: {}", rpcModule.getId(), Integer.toHexString(rpcModule.hashCode()), routeId, existingRoute ); } } else { if (existingRoute == null) { final DynamicRpcRouteBuilder routeBuilder = new DynamicRpcRouteBuilder(context, identity, rpcModule); context.addRoutes(routeBuilder); routeIdsByModule.put(rpcModule, routeId); LOG.info("Registered RpcModule ({}) on route with queue {}", rpcModule.getId(), Integer.toHexString(rpcModule.hashCode()), routeId, routeBuilder.getQueueName() ); } else { LOG.warn("RpcModule ({}) cannot be registered, route is already present: {}", rpcModule.getId(), Integer.toHexString(rpcModule.hashCode()), routeId, existingRoute ); } } } }
Source:
<code>public void duplicateParameterPathRegistration_throwsException() { ConfigureRoutes mutable = new ConfigureRoutes(); mutable.setRoute(":param", ParamTarget.class); Assert.assertTrue(mutable.hasRouteTarget(ParamTarget.class)); Assert.assertEquals(ParamTarget.class, mutable .getNavigationRouteTarget("123").getRouteTarget().getTarget()); try { <START> mutable.setRoute(":param", ParamTarget.class); <END> Assert.fail("Parameter route is already registered"); } catch (InvalidRouteConfigurationException e) { } }</code><technical_language>exceptionRule more possibilities expected, for instance message exceptionRule.expectMessage("Navigation targets unique routes, navigation targets 'ParamTarget' 'ParamTarget' route."); good check fails for correct version. checked exceptionRule.expectCause(CoreMatchers.isA(TheCauseClassWeWouldExpect.class)) correct exception AmbiguousRouteConfigurationException InvalidRouteConfiguratioException</technical_language>

Target:
public void duplicateParameterPathRegistration_throwsException() { ConfigureRoutes mutable = new ConfigureRoutes(); mutable.setRoute(":param", ParamTarget.class); Assert.assertTrue(mutable.hasRouteTarget(ParamTarget.class)); Assert.assertEquals(ParamTarget.class, mutable .getNavigationRouteTarget("123").getRouteTarget().getTarget()); exceptionRule.expect(AmbiguousRouteConfigurationException.class); exceptionRule.reportMissingExceptionWithMessage( "Duplicate parameter routes shouldn't be accepted."); exceptionRule.expectMessage( "Navigation targets must have unique routes, found navigation targets 'com.vaadin.flow.router.internal.ConfigureRoutesTest$ParamTarget' and 'com.vaadin.flow.router.internal.ConfigureRoutesTest$ParamTarget' with parameter have the same route."); mutable.setRoute(":param", ParamTarget.class); }
Source:
<code>public void actionPerformed(ActionEvent e) { String chosenfile = e.getActionCommand(); <START> File nodeFile = new File(chosenfile); <END> if (chosenfile.endsWith(".nwk")) { System.out.println("phylo tree"); FileSelector.lastopened.add(nodeFile); application.makePhyloTree(nodeFile); } else if (chosenfile.endsWith(".node.graph")) { FileSelector.lastopened.add(nodeFile); File edgeFile = FileSelector.getOtherExtension(nodeFile, ".node.graph", ".edge.graph"); application.makeGraph(nodeFile, edgeFile, null); } else { FileSelector.lastopened.add(nodeFile); File[] files = FileSelector.getFilesFromFolder(nodeFile, ".node.graph", ".edge.graph", ".nwk"); application.makeGraph(files[0], files[1], files[2]); } }</code><technical_language>this file a folder, nwk tree node/edge file. naming nodeFile is logic</technical_language>

Target:
public void actionPerformed(ActionEvent e) { String chosenfile = e.getActionCommand(); File file = new File(chosenfile); if (chosenfile.endsWith(".nwk")) { FileSelector.lastopened.add(file); application.makePhyloTree(file); } else if (chosenfile.endsWith(".node.graph")) { FileSelector.lastopened.add(file); File edgeFile = FileSelector.getOtherExtension(file, ".node.graph", ".edge.graph"); application.makeGraph(file, edgeFile, null); } else { FileSelector.lastopened.add(file); File[] files = FileSelector.getFilesFromFolder(file, ".node.graph", ".edge.graph", ".nwk"); application.makeGraph(files[0], files[1], files[2]); } }
Source:
<code>public void stopTerminal() { if (connected) { Jso jso = Jso.create(); <START> jso.addField("type", "kill"); <END> socket.send(jso.serialize()); } }</code><technical_language>please rename close</technical_language>

Target:
public void stopTerminal() { if (connected) { Jso jso = Jso.create(); jso.addField("type", "close"); socket.send(jso.serialize()); } }
Source:
<code>public Builder setCell( String family, ByteString columnQualifier, ByteString value ) { final com.google.bigtable.v2.Mutation.SetCell.Builder setCell = com.google.bigtable.v2.Mutation.SetCell .newBuilder() .setFamilyName(family) .setColumnQualifier(columnQualifier) <START> .setTimestampMicros(TimeUnit.MILLISECONDS.toMicros(DateTime.now().getMillis())) <END> .setValue(value); mutations.add( com.google.bigtable.v2.Mutation .newBuilder() .setSetCell(setCell) .build() ); return this; }</code><technical_language>set this -1 bigtable server time - <LINK_0></technical_language>

Target:
public Builder setCell( String family, ByteString columnQualifier, ByteString value ) { final com.google.bigtable.v2.Mutation.SetCell.Builder setCell = com.google.bigtable.v2.Mutation.SetCell .newBuilder() .setFamilyName(family) .setColumnQualifier(columnQualifier) .setTimestampMicros(-1) .setValue(value); mutations.add( com.google.bigtable.v2.Mutation .newBuilder() .setSetCell(setCell) .build() ); return this; }
Source:
<code>public AirGoogleMapOptions useViewLifecycleInFragment(boolean useViewLifecycleInFragment) { <START> return this; <END> }</code><technical_language>set options</technical_language>

Target:
public AirGoogleMapOptions useViewLifecycleInFragment(boolean useViewLifecycleInFragment) { options.useViewLifecycleInFragment(useViewLifecycleInFragment); return this; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; GlusterVolumeAdvancedDetails other = (GlusterVolumeAdvancedDetails) obj; <START> if (capacityInfo == null) { <END> if (other.capacityInfo != null) return false; } else if (!capacityInfo.equals(other.capacityInfo)) return false; if (serviceInfo == null) { if (other.serviceInfo != null) return false; } else if (!serviceInfo.equals(other.serviceInfo)) return false; if (volumeId == null) { if (other.volumeId != null) return false; } else if (!volumeId.equals(other.volumeId)) return false; return true; }</code><technical_language>ObjectUtils.objectsEqual instead</technical_language>

Target:
public boolean equals(Object obj) { if (!(obj instanceof GlusterVolumeAdvancedDetails)) { return false; } if (this == obj) return true; GlusterVolumeAdvancedDetails otherVolumeAdvancedDetails = (GlusterVolumeAdvancedDetails) obj; if (!ObjectUtils.objectsEqual(capacityInfo, otherVolumeAdvancedDetails.getCapacityInfo())) { return false; } if (!ObjectUtils.objectsEqual(serviceInfo, otherVolumeAdvancedDetails.getServiceInfo())) { return false; } if (!ObjectUtils.objectsEqual(updatedAt, otherVolumeAdvancedDetails.getUpdatedAt())) { return false; } if (!ListUtils.listsEqual(brickDetails, otherVolumeAdvancedDetails.getBrickDetails())) { return false; } if (!ObjectUtils.objectsEqual(volumeId, otherVolumeAdvancedDetails.getVolumeId())) { return false; } return true; }
Source:
<code>public double getAvailableRAMInGB() { OperatingSystemMXBean bean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); <START> double totRAMAvailable = bean.getTotalPhysicalMemorySize() / GIGABYTE; <END> double totalRAMUsed = 0; for (LocalNode localNode : ProActiveRuntimeImpl.getProActiveRuntime().getLocalNodes()) { if (localNode.getProperty(RamSchedulingPolicy.RAM_VARIABLE_NAME) != null) { totalRAMUsed += Double .parseDouble(localNode.getProperty(RamSchedulingPolicy.RAM_VARIABLE_NAME)); } } double ramInBytes = totRAMAvailable - totalRAMUsed; return ramInBytes; }</code><technical_language>add a cast : ((double) bean.getTotalPhysicalMemorySize()) / GIGABYTE</technical_language>

Target:
public double getAvailableRAMInGB() { OperatingSystemMXBean bean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); double totRAMAvailable = ((double) bean.getTotalPhysicalMemorySize()) / GIGABYTE; double totalRAMUsed = 0; for (LocalNode localNode : ProActiveRuntimeImpl.getProActiveRuntime().getLocalNodes()) { if (localNode.getProperty(RamSchedulingPolicy.RAM_VARIABLE_NAME) != null) { totalRAMUsed += Double .parseDouble(localNode.getProperty(RamSchedulingPolicy.RAM_VARIABLE_NAME)); } } double ramInBytes = totRAMAvailable - totalRAMUsed; return ramInBytes; }
Source:
<code>public void updateBlog(Blog blog) throws ClientServicesException { if (null == blog){ throw new ClientServicesException(null,"null blog"); } try { if(blog.getFieldsMap().get(AtomXPath.title)== null) blog.setTitle(blog.getTitle()); if(blog.getFieldsMap().get(AtomXPath.summary)== null) blog.setSummary(blog.getSummary()); if(!blog.getFieldsMap().toString().contains(BlogXPath.tags.toString())) blog.setTags(blog.getTags()); BlogSerializer serializer = new BlogSerializer(blog); String payload = serializer.updatePayload(); Map<String, String> headers = new HashMap<String, String>(); <START> headers.put("Content-Type", "application/atom+xml"); <END> String updateBlogUrl = BlogUrls.GET_UPDATE_REMOVE_BLOG.format(this, BlogUrlParts.blogHandle.get(defaultHomepageHandle), BlogUrlParts.entryAnchor.get(blog.getUid())); getClientService().put(updateBlogUrl, null,headers, payload,ClientService.FORMAT_NULL); } catch (Exception e) { throw new ClientServicesException(e, "error updating blog"); } }</code><technical_language>Replace 2 lines (and do if more occurrences of this class) getAtomHeaders()</technical_language>

Target:
public void updateBlog(Blog blog) throws ClientServicesException { if (null == blog){ throw new ClientServicesException(null,"null blog"); } try { if(blog.getFieldsMap().get(AtomXPath.title)== null) blog.setTitle(blog.getTitle()); if(blog.getFieldsMap().get(AtomXPath.summary)== null) blog.setSummary(blog.getSummary()); if(!blog.getFieldsMap().toString().contains(BlogXPath.tags.toString())) blog.setTags(blog.getTags()); BlogSerializer serializer = new BlogSerializer(blog); String payload = serializer.updatePayload(); String updateBlogUrl = BlogUrls.GET_UPDATE_REMOVE_BLOG.format(this, BlogUrlParts.blogHandle.get(defaultHomepageHandle), BlogUrlParts.entryAnchor.get(blog.getUid())); getClientService().put(updateBlogUrl, null, getAtomHeaders(), payload,ClientService.FORMAT_NULL); } catch (Exception e) { throw new ClientServicesException(e, "error updating blog"); } }
Source:
<code>public void testRegistrationOk() throws WebconnectionException { authenticator.performCatrobatRegister(testEmail, "de", "at", sharedPreferences.edit()); verify(listenerMock, never()).onError(anyInt(), anyString()); verify(listenerMock, atLeastOnce()).onSuccess(); token = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); <START> boolean tokenOk = new CatrobatServerCalls().checkToken(token, testUser, BASE_URL_TEST_HTTPS); <END> assertTrue(tokenOk); }</code><technical_language>need introduce extra local var for this. assertTrue assign tokenOk saves a line</technical_language>

Target:
public void testRegistrationOk() throws WebconnectionException { authenticator.performCatrobatRegister(testEmail, "de", "at"); verify(listenerMock, never()).onError(anyInt(), anyString()); verify(listenerMock, atLeastOnce()).onSuccess(); token = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); assertTrue(new CatrobatServerCalls().checkToken(token, testUser, BASE_URL_TEST_HTTPS)); }
Source:
<code>public boolean equals(Object other) { if (other == this) { return true; } if (other instanceof NuxeoGroupImpl) { String name = getName(); String otherName = ((NuxeoGroupImpl) other).getName(); if (name == null) { return otherName == null; } else { return name.equals(otherName); <START> } <END> } return false; }</code><technical_language>Objects.equals</technical_language>

Target:
public boolean equals(Object other) { if (other == this) { return true; } if (other instanceof NuxeoGroupImpl) { String name = getName(); String otherName = ((NuxeoGroupImpl) other).getName(); return Objects.equals(name, otherName); } return false; }
Source:
<code>private void handleOnDemandRegistration(Class<?>... classes) { ArrayList<Class<?>> notIndexedYet = new ArrayList<>(classes.length); for (Class<?> type : classes) { if (!clusterRegistry.containsKey(type)) { notIndexedYet.add(type); } } if (!notIndexedYet.isEmpty()) { Class<?>[] toAdd = notIndexedYet.toArray(new Class[notIndexedYet.size()]); updateSearchFactory(toAdd); updateClusterRegistry(toAdd); <START> } <END> }</code><technical_language>I this snippet is crying for some java 8 love :smile:, I understand if is for eventual new backports</technical_language>

Target:
private void handleOnDemandRegistration(Class<?>... classes) { List<Class<?>> reducedSet = new ArrayList<>(classes.length); for (Class<?> type : classes) { if (!clusterRegistry.containsKey(type)) { reducedSet.add(type); } } if (!reducedSet.isEmpty()) { Class<?>[] toAdd = reducedSet.toArray(new Class[reducedSet.size()]); updateSearchFactory(toAdd); updateClusterRegistry(toAdd); } }
Source:
<code>public Mono<Closeable> start(ConnectionAcceptor acceptor) { Mono<? extends NettyContext> serverMono = server .newHandler((in, out) -> { in.context().addHandler("server-length-codec", new RSocketLengthCodec()); NettyDuplexConnection connection = new NettyDuplexConnection(in, out, in.context()); acceptor.apply(connection).subscribe(); return out.neverComplete(); }); <START> serverMono.map(s -> s.address()).subscribe(address); <END> return serverMono.map(NettyContextClosable::new); }</code><technical_language>If provide port of "0", time call start(), generates a new NettyContext, a "address" - "port" value. if caller calls start(..) asks for "address" value, while another caller calls start(..) asks for address value, a race condition. Other that, call start(..) of a single thread, address of initial call lost. need "address" if pass port of "0", address created merging "bindAddress" "port"? If so, a overload method provides address back? If caller needs address back, caller call this overloaded one. need class member ok for multithreading</technical_language>

Target:
public Mono<NettyContextCloseable> start(ConnectionAcceptor acceptor) { return server.newHandler((in, out) -> { in.context().addHandler("server-length-codec", new RSocketLengthCodec()); NettyDuplexConnection connection = new NettyDuplexConnection(in, out, in.context()); acceptor.apply(connection).subscribe(); return out.neverComplete(); }).map(NettyContextCloseable::new); }
Source:
<code>public void configureFieldMetadata(String name, FieldMetadataBuilder builder) { builder.field( "dynamicField", FieldType.OBJECT ) .mappedOn( Elasticsearch.class ) .dynamic( DynamicType.TRUE ); <START> builder.field( "dynamicStrict", FieldType.OBJECT ); <END> }</code><technical_language>a bit perplexed: "dynamicStrict" match field name... I this works. Anyway... bridges here? feels a bit strange name parameter in configureFieldMetadata is ignored. before: I agree work is, more in case copy/pastes this code</technical_language>

Target:
public void configureFieldMetadata(String name, FieldMetadataBuilder builder) { FieldMetadataCreationContext field = builder.field( name, FieldType.OBJECT ); if ( dynamicType != null ) { field.mappedOn( Elasticsearch.class ) .dynamic( dynamicType ); } }
Source:
<code>public Iterable<Object> hydrate() { MutableInt counter = new MutableInt(0); List<Object> queryResults = getResults().stream() .map((result) -> { return result instanceof Object[] ? (Object []) result : new Object[] { result }; }) .map((result) -> coerceObjectToEntity(result, counter)) .collect(Collectors.toList()); if (getStitchList().shouldStitch()) { populateObjectLookupTable(); <START> getStitchList().stitch(); <END> } return queryResults; }</code><technical_language>getStitchList().stitch() populateObjectLookupTable(), this moved populateObjectLookupTable()</technical_language>

Target:
public Iterable<Object> hydrate() { MutableInt counter = new MutableInt(0); List<Object> queryResults = getResults().stream() .map((result) -> coerceObjectToEntity(result, counter)) .collect(Collectors.toList()); if (getStitchList().shouldStitch()) { populateObjectLookupTable(); getStitchList().stitch(); } return queryResults; }
Source:
<code>private void setupQueries() { Set<GeoHashQuery> oldQueries = (this.queries == null) ? new HashSet<GeoHashQuery>() : this.queries; <START> Set<GeoHashQuery> newQueries = GeoHashQuery.queriesAtLocation(center.latitude, center.longitude, radius); <END> this.queries = newQueries; for (GeoHashQuery query: oldQueries) { if (!newQueries.contains(query)) { firebaseQueries.get(query).removeEventListener(this.childEventLister); firebaseQueries.remove(query); outstandingQueries.remove(query); } } for (final GeoHashQuery query: newQueries) { if (!oldQueries.contains(query)) { outstandingQueries.add(query); Firebase firebase = this.geoFire.getFirebase(); Query firebaseQuery = firebase.startAt(query.getStartValue()).endAt(query.getEndValue()); firebaseQuery.addChildEventListener(this.childEventLister); addValueToReadyListener(firebaseQuery, query); firebaseQueries.put(query, firebaseQuery); } } for(Map.Entry<String, LocationInfo> info: this.locationInfos.entrySet()) { LocationInfo oldLocationInfo = info.getValue(); this.updateLocationInfo(info.getKey(), oldLocationInfo.location); } Iterator<Map.Entry<String, LocationInfo>> it = this.locationInfos.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, LocationInfo> entry = it.next(); if (!this.geoHashQueriesContainGeoHash(entry.getValue().geoHash)) { it.remove(); } } checkAndFireReady(); }</code><technical_language>Suggestion: queriesAtLocation() a GeoLocation object instead of doubles</technical_language>

Target:
private void setupQueries() { Set<GeoHashQuery> oldQueries = (this.queries == null) ? new HashSet<GeoHashQuery>() : this.queries; Set<GeoHashQuery> newQueries = GeoHashQuery.queriesAtLocation(center, radius); this.queries = newQueries; for (GeoHashQuery query: oldQueries) { if (!newQueries.contains(query)) { firebaseQueries.get(query).removeEventListener(this.childEventLister); firebaseQueries.remove(query); outstandingQueries.remove(query); } } for (final GeoHashQuery query: newQueries) { if (!oldQueries.contains(query)) { outstandingQueries.add(query); Firebase firebase = this.geoFire.getFirebase(); Query firebaseQuery = firebase.startAt(query.getStartValue()).endAt(query.getEndValue()); firebaseQuery.addChildEventListener(this.childEventLister); addValueToReadyListener(firebaseQuery, query); firebaseQueries.put(query, firebaseQuery); } } for(Map.Entry<String, LocationInfo> info: this.locationInfos.entrySet()) { LocationInfo oldLocationInfo = info.getValue(); this.updateLocationInfo(info.getKey(), oldLocationInfo.location); } Iterator<Map.Entry<String, LocationInfo>> it = this.locationInfos.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, LocationInfo> entry = it.next(); if (!this.geoHashQueriesContainGeoHash(entry.getValue().geoHash)) { it.remove(); } } checkAndFireReady(); }
Source:
<code>private String getThreeWayOverlay(final Diff diff) { final Conflict conflict = diff.getConflict(); final DifferenceKind diffKind = diff.getKind(); final DifferenceSource source = diff.getSource(); ConflictKind conflictKind = null; if (hasDirectOrIndirectConflict(REAL).apply(diff)) { conflictKind = REAL; <START> } else if (or(hasConflict(PSEUDO), allRefining(hasConflict(PSEUDO))).apply(diff)) { <END> conflictKind = PSEUDO; } String path = ""; if (conflict != null || conflictKind != null) { if ((conflict != null && conflict.getKind() == PSEUDO) || conflictKind == PSEUDO) { path += "p"; } path += "conf"; if (source == DifferenceSource.RIGHT) { path += "r_"; } } else { switch (source) { case LEFT: path += "r_out"; break; case RIGHT: path += "r_in"; break; default: break; } } switch (diffKind) { case ADD: path += ADD_OV; break; case DELETE: path += DEL_OV; break; case CHANGE: case MOVE: path += CHG_OV; break; default: break; } return path; }</code><technical_language>Please existing 'allAtomicRefining' method</technical_language>

Target:
private String getThreeWayOverlay(final Diff diff) { final Conflict conflict = diff.getConflict(); final DifferenceKind diffKind = diff.getKind(); final DifferenceSource source = diff.getSource(); ConflictKind conflictKind = null; if (hasDirectOrIndirectConflict(REAL).apply(diff)) { conflictKind = REAL; } else if (or(hasConflict(PSEUDO), allAtomicRefining(hasConflict(PSEUDO))).apply(diff)) { conflictKind = PSEUDO; } String path = ""; if (conflict != null || conflictKind != null) { if ((conflict != null && conflict.getKind() == PSEUDO) || conflictKind == PSEUDO) { path += "p"; } path += "conf"; if (source == DifferenceSource.RIGHT) { path += "r_"; } } else { switch (source) { case LEFT: path += "r_out"; break; case RIGHT: path += "r_in"; break; default: break; } } switch (diffKind) { case ADD: path += ADD_OV; break; case DELETE: path += DEL_OV; break; case CHANGE: case MOVE: path += CHG_OV; break; default: break; } return path; }
Source:
<code>public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } <START> ChangeControl control = req.getControl(); <END> ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> oldHashtags = notes.getHashtags(); Set<String> hashtags = new HashSet<String>(); if (oldHashtags != null) { hashtags.addAll(oldHashtags); } hashtags.addAll(Arrays.asList(input.hashtags.split(","))); update.setHashtags(hashtags); update.commit(); return Response.ok(hashtags); }</code><technical_language>Logic for DeleteHashtags PutHashTags similar. re-use some code? null check :)</technical_language>

Target:
public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); if (!control.canEditHashtags()) { throw new AuthException("Editing hashtags not permitted"); } ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> oldHashtags = notes.getHashtags(); Set<String> hashtags = new HashSet<String>(); if (oldHashtags != null) { hashtags.addAll(oldHashtags); } hashtags.addAll(Arrays.asList(input.hashtags.split(","))); update.setHashtags(hashtags); update.commit(); return Response.ok(hashtags); }
Source:
<code>public boolean deleteAllExpiredObjects() { try { <START> this.persistenceEntryManager.remove(String.format("%s,%s", new Object[]{getExpiredObjOu(), getOxdDn()}), ExpiredObject.class, null, 100); <END> LOG.debug("Removed all expired_objects successfully. "); return true; } catch (Exception e) { LOG.error("Failed to remove expired_objects. ", e); } return false; }</code><technical_language>need configuration property persistence-manager-remove-count: 1000</technical_language>

Target:
public boolean deleteAllExpiredObjects() { try { final Calendar cal = Calendar.getInstance(); final Date currentTime = cal.getTime(); Filter exirationDateFilter = Filter.createLessOrEqualFilter("exp", this.persistenceEntryManager.encodeTime(baseDn, currentTime)); this.persistenceEntryManager.remove(String.format("%s,%s", new Object[]{getExpiredObjOu(), getOxdDn()}), ExpiredObject.class, exirationDateFilter, this.configuration.getPersistenceManagerRemoveCount()); LOG.debug("Removed all expired_objects successfully. "); return true; } catch (Exception e) { LOG.error("Failed to remove expired_objects. ", e); } return false; }
Source:
<code>protected String getBlockNameForDirection(EnumFacing direction) { Block b = cb.getBundleWorldObj().getBlockState(cb.getLocation().getLocation(direction).getBlockPos()).getBlock(); <START> if (b != null && b != Blocks.air) { <END> return b.getLocalizedName(); } return null; }</code><technical_language>Please world.isAirBlock(), LightNode show here, too. conduits filtered out, too</technical_language>

Target:
protected String getBlockNameForDirection(EnumFacing direction) { World world = cb.getBundleWorldObj(); BlockPos blockPos = cb.getLocation().getLocation(direction).getBlockPos(); if (world.isAirBlock(blockPos)) { return null; } Block b = world.getBlockState(blockPos).getBlock(); if (b != null && b != EnderIO.blockConduitBundle) { return b.getLocalizedName(); } return null; }
Source:
<code>private RepoCollection updateCollection(InputCollection inputCollection, Timestamp timestamp, RepoCollection existingRepoCollection, Timestamp creationDate) throws RepoException { if (areCollectionsSimilar(inputCollection.getKey(), inputCollection.getBucketName(), inputCollection.getObjects(), inputCollection.getTag(), existingRepoCollection)){ return existingRepoCollection; } try{ <START> return createCollection(inputCollection.getKey(), inputCollection.getBucketName(), timestamp, existingRepoCollection.getBucketId(), inputCollection.getObjects(), inputCollection.getTag(), creationDate, inputCollection.getUserMetadata()); <END> } catch(SQLIntegrityConstraintViolationException e){ log.debug("Error trying to version a collection, key: " + inputCollection.getKey() + " . SQLIntegrityConstraintViolationException: " + e.getMessage()); throw new RepoException(RepoException.Type.CantCreateCollectionVersionWithNoOrig); } catch(SQLException e){ log.debug("SQLException: " + e.getMessage()); throw new RepoException(e); } }</code><technical_language>is this more compact? pass in object</technical_language>

Target:
private RepoCollection updateCollection(InputCollection inputCollection, Timestamp timestamp, RepoCollection existingRepoCollection, Timestamp creationDate) throws RepoException { if (areCollectionsSimilar(inputCollection, existingRepoCollection)){ return existingRepoCollection; } RepoCollection repoCollection = new RepoCollection(inputCollection.getKey(), existingRepoCollection.getBucketId(), inputCollection.getBucketName(), Status.USED); repoCollection.setTimestamp(timestamp); repoCollection.setTag(inputCollection.getTag()); repoCollection.setCreationDate(creationDate); repoCollection.setUserMetadata(inputCollection.getUserMetadata()); try{ return createCollection(repoCollection, inputCollection.getObjects()); } catch(SQLIntegrityConstraintViolationException e){ log.debug("Error trying to version a collection, key: " + inputCollection.getKey() + " . SQLIntegrityConstraintViolationException: " + e.getMessage()); throw new RepoException(RepoException.Type.CantCreateCollectionVersionWithNoOrig); } catch(SQLException e){ log.debug("SQLException: " + e.getMessage()); throw new RepoException(e); } }
Source:
<code>boolean isCacheable() { <START> return true; <END> }</code><technical_language>isCacheable is true? I guess this supposed false for generic extractors. I wrong</technical_language>

Target:
boolean isCacheable() { return false; }
Source:
<code>public void record(Trace trace) { if (trace.getNodes() != null && trace.getNodes().size() > 0) { Node rootNode = trace.getNodes().get(0); if (this.deploymentMetaData != null) { <START> if (!rootNode.hasProperty(Constants.PROP_SERVICE_NAME) <END> && this.deploymentMetaData.getServiceName() != null) { rootNode.getProperties().add(new Property(Constants.PROP_SERVICE_NAME, this.deploymentMetaData.getServiceName())); } if (!rootNode.hasProperty(Constants.PROP_BUILD_STAMP) && this.deploymentMetaData.getBuildStamp() != null) { rootNode.getProperties().add(new Property(Constants.PROP_BUILD_STAMP, this.deploymentMetaData.getBuildStamp())); } } } backingTraceRecorder.record(trace); }</code><technical_language>is more efficient test null != this.deploymentMetaData.getServiceName() iterate props. line 45</technical_language>

Target:
public void record(Trace trace) { if (trace.getNodes() != null && trace.getNodes().size() > 0) { Node rootNode = trace.getNodes().get(0); if (this.deploymentMetaData != null) { if (this.deploymentMetaData.getServiceName() != null && !rootNode.hasProperty(Constants.PROP_SERVICE_NAME)) { rootNode.getProperties().add(new Property(Constants.PROP_SERVICE_NAME, this.deploymentMetaData.getServiceName())); } if (this.deploymentMetaData.getBuildStamp() != null && !rootNode.hasProperty(Constants.PROP_BUILD_STAMP)) { rootNode.getProperties().add(new Property(Constants.PROP_BUILD_STAMP, this.deploymentMetaData.getBuildStamp())); } } } backingTraceRecorder.record(trace); }
Source:
<code>public InterpreterResult interpret(String markdownText, InterpreterContext interpreterContext) { String html; try { html = parser.render(markdownText); <START> } catch (Exception e) { <END> LOGGER.error("Exception in MarkdownInterpreter while interpret ", e); return new InterpreterResult(Code.ERROR, InterpreterUtils.getMostRelevantMessage(e)); } return new InterpreterResult(Code.SUCCESS, "%html " + html); }</code><technical_language>Is a reason catch general Exception instead of more specific sub-classes</technical_language>

Target:
public InterpreterResult interpret(String markdownText, InterpreterContext interpreterContext) { String html; try { html = parser.render(markdownText); } catch (RuntimeException e) { LOGGER.error("Exception in MarkdownInterpreter while interpret ", e); return new InterpreterResult(Code.ERROR, InterpreterUtils.getMostRelevantMessage(e)); } return new InterpreterResult(Code.SUCCESS, "%html " + html); }