auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Optional<JsonNode> convertFromStringToJSONNode(String json) { if (json == null || json.isEmpty()) { return Optional.empty(); } try { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(json); return Optional.of(jsonNode); } catch (IOException e) { <START> return Optional.empty(); <END> } }</code><technical_language>@yesamer swallowing this exception way: if get rawValue is expected a valid json, if throws exception, bad happened, IMO. "Given a json in String format, try convert in a <code>JsonNode</code>. In case of success, i.e. string is a valid json"...: a "json in String format" invalid json</technical_language>

Target:
public static Optional<JsonNode> convertFromStringToJSONNode(String json) { if (json == null || json.isEmpty()) { return Optional.empty(); } try { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(json); return Optional.of(jsonNode); } catch (JsonParseException e) { return Optional.empty(); } catch (IOException e) { throw new IllegalArgumentException("Generic error during json parsing: " + json, e); } }
Source:
<code>public static Sensor activeBufferedRecordsSensor(final String threadId, final String taskId, final StreamsMetricsImpl streamsMetrics) { <START> final String name = ACTIVE_TASK_PREFIX + BUFFERED + StreamsMetricsImpl.RECORDS_SUFFIX; <END> final Sensor sensor = streamsMetrics.taskLevelSensor(threadId, taskId, name, Sensor.RecordingLevel.DEBUG); addValueMetricToSensor( sensor, TASK_LEVEL_GROUP, streamsMetrics.taskLevelTagMap(threadId, taskId), name, NUM_BUFFERED_RECORDS_DESCRIPTION ); return sensor; }</code><technical_language>prop: For suppression buffer, -count a suffix instead of -records measure number of records</technical_language>

Target:
public static Sensor activeBufferedRecordsSensor(final String threadId, final String taskId, final StreamsMetricsImpl streamsMetrics) { final String name = ACTIVE_TASK_PREFIX + BUFFER_COUNT; final Sensor sensor = streamsMetrics.taskLevelSensor(threadId, taskId, name, Sensor.RecordingLevel.DEBUG); addValueMetricToSensor( sensor, TASK_LEVEL_GROUP, streamsMetrics.taskLevelTagMap(threadId, taskId), name, NUM_BUFFERED_RECORDS_DESCRIPTION ); return sensor; }
Source:
<code>public String save() { if (this.template != null && this.template.getTitle() != null) { if (!this.template.getTitle().equals(this.title) && this.title != null && !renameAfterProcessTitleChanged()) { return null; } try { if (this.template.getTasks().isEmpty()) { Reader reader = new Reader(this.template.getWorkflow().getFileName()); this.template = reader.convertWorkflowToTemplate(this.template); } } catch (IOException e) { <START> logger.error("Problem with diagram"); <END> } try { serviceManager.getTemplateService().save(this.template); } catch (DataException e) { Helper.setErrorMessage("errorSaving", new Object[] {Helper.getTranslation("template") }, logger, e); } } else { Helper.setErrorMessage("titleEmpty"); } return null; }</code><technical_language>please provide a more meaningful message this message locate real error reason. inform user error</technical_language>

Target:
public String save() { if (this.template != null && this.template.getTitle() != null) { if (!this.template.getTitle().equals(this.title) && this.title != null && !renameAfterProcessTitleChanged()) { return null; } try { if (this.template.getTasks().isEmpty()) { Reader reader = new Reader(this.template.getWorkflow().getFileName()); this.template = reader.convertWorkflowToTemplate(this.template); } } catch (IOException e) { Helper.setErrorMessage("errorDiagram", new Object[] {this.template.getWorkflow().getId() }, logger, e); } try { serviceManager.getTemplateService().save(this.template); } catch (DataException e) { Helper.setErrorMessage("errorSaving", new Object[] {Helper.getTranslation("template") }, logger, e); } } else { Helper.setErrorMessage("titleEmpty"); } return null; }
Source:
<code>public static String processTemplateContents(String templateContents, EntityDriver driver, Map<String,? extends Object> extraSubstitutions) { Map<String, Object> config = driver.getEntity().getApplication().getManagementContext().getConfig().asMapWithStringKeys(); Map<String, Object> substitutions = ImmutableMap.<String, Object>builder() .putAll(config) .put("driver", driver) .put("entity", driver.getEntity()) <START> .put("location", driver.getLocation()) <END> .put("config", ((EntityInternal) driver.getEntity()).getConfigMap().asMapWithStringKeys()) .putAll(extraSubstitutions) .build(); return processTemplateContents(templateContents, substitutions); }</code><technical_language>This NPE if driver.getLocation() returns null. more defensive, put if non-null? genuinely exception</technical_language>

Target:
public static String processTemplateContents(String templateContents, EntityDriver driver, Map<String,? extends Object> extraSubstitutions) { Map<String, Object> config = driver.getEntity().getApplication().getManagementContext().getConfig().asMapWithStringKeys(); ImmutableMap.Builder<String, Object> builder = ImmutableMap.<String, Object>builder() .putAll(config) .put("driver", driver) .put("entity", driver.getEntity()) .put("config", ((EntityInternal) driver.getEntity()).getConfigMap().asMapWithStringKeys()); if (driver.getLocation() != null) builder.put("location", driver.getLocation()); builder.putAll(extraSubstitutions); return processTemplateContents(templateContents, builder.build()); }
Source:
<code>public void Distinct_OrderBy2() { QCat cat = QCat.cat; <START> assertEquals(4, query() <END> .distinct() .from(cat) .orderBy(cat.mate.id.asc()) .list(cat.id, cat.mate.id).size()); }</code><technical_language>do expect this return 4 previous (looks identical) query return 6</technical_language>

Target:
public void Distinct_OrderBy2() { QCat cat = QCat.cat; List<Tuple> result = query() .distinct() .from(cat) .orderBy(cat.mate.id.asc().nullsFirst()) .list(cat.id, cat.mate.id); assertThat(result, Matchers.<Tuple>contains( new MockTuple(new Object[]{2, 1}), new MockTuple(new Object[]{3, 2}), new MockTuple(new Object[]{4, 3}), new MockTuple(new Object[]{5, 4}) )); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mSceneView = (SceneView) findViewById(sceneView); ArcGISScene agsScene = new ArcGISScene(); agsScene.setBasemap(Basemap.createImagery()); mSceneView.setScene(agsScene); ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource( getResources().getString(R.string.elevation_image_service)); Surface surface = new Surface(); surface.getElevationSources().add(elevationSource); <START> agsScene.setBaseSurface(surface); <END> Camera camera = new Camera(28.4, 83.9, 10010.0, 10.0, 80.0, 300.0); mSceneView.setViewpointCamera(camera); }</code><technical_language>A new ArcGISScene a Surface, add new elevation source existing surface</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mSceneView = (SceneView) findViewById(R.id.sceneView); ArcGISScene agsScene = new ArcGISScene(); agsScene.setBasemap(Basemap.createImagery()); mSceneView.setScene(agsScene); ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource( getResources().getString(R.string.elevation_image_service)); agsScene.getBaseSurface().getElevationSources().add(elevationSource); Camera camera = new Camera(28.4, 83.9, 10010.0, 10.0, 80.0, 300.0); mSceneView.setViewpointCamera(camera); }
Source:
<code>public int getDownloadableVideosCount(IStorage storage) { int downloadableCount = 0; List<HasDownloadEntry> videos = getVideos(); int size = videos.size(); <START> for (int i = 0; i < size; i++) { <END> if (!videos.get(i).getDownloadEntry(storage).isVideoForWebOnly()) { downloadableCount++; } } return downloadableCount; }</code><technical_language>This converted a for-each loop: java for (HasDownloadEntry video : getVideos()) {</technical_language>

Target:
public int getDownloadableVideosCount(IStorage storage) { int downloadableCount = 0; List<HasDownloadEntry> videos = getVideos(); for (int i = 0, size = videos.size(); i < size; i++) { if (!videos.get(i).getDownloadEntry(storage).isVideoForWebOnly()) { downloadableCount++; } } return downloadableCount; }
Source:
<code>private boolean alreadyContainsBatch(CompletedDownloadBatch completedDownloadBatch) { <START> return downloadBatchMap.get(completedDownloadBatch.downloadBatchId()) != null; <END> }</code><technical_language>This is downloadBatchMap.containsKey(completedDownloadBatch.downloadBatchId())</technical_language>

Target:
private boolean alreadyContainsBatch(CompletedDownloadBatch completedDownloadBatch) { return downloadBatchMap.containsKey(completedDownloadBatch.downloadBatchId()); }
Source:
<code>public void setUserVisibleHint(boolean visible) { super.setUserVisibleHint(visible); if (!isAdded()) { return; } if (visible) { funnel.enter(); <START> feedAdapter.notifyDataSetChanged(); <END> } else { funnel.exit(); } }</code><technical_language>bus events, do need this anymore? (The idea send events individual cards, avoid rebuild view hierarchy of RecyclerView.)</technical_language>

Target:
public void setUserVisibleHint(boolean visible) { super.setUserVisibleHint(visible); if (!isAdded()) { return; } if (visible) { funnel.enter(); } else { funnel.exit(); } }
Source:
<code>void sendMessage(final String message) { Preconditions.checkState(!closed); if (!client.isOpen()) { try { Awaitility.await() .atMost(connectTimeoutMillis, TimeUnit.MILLISECONDS) .until(() -> client.isOpen()); } catch (final ConditionTimeoutException ignored) { throw new CouldNotConnect(serverUri); } <START> } <END> client.send(message); }</code><technical_language>IIRC reason introduced complex logic in place avoid kind of blocking behaviour. UI call this method directly? If recommend making awaitUntilOpen a separate method, UI spawn a Thread waits connection is open enables UI components send stuff, this method a precondition checks if method is open. This avoid a UI freeze. If this method is invoked other Thread besides EDT, this is perfectly fine</technical_language>

Target:
void sendMessage(final String message) { Preconditions.checkState(!closed); if (!client.isOpen()) { try { Awaitility.await() .atMost(connectTimeoutMillis, TimeUnit.MILLISECONDS) .until(client::isOpen); } catch (final ConditionTimeoutException ignored) { throw new CouldNotConnect(serverUri); } } client.send(message); }
Source:
<code>public static Expression rewrite(Expression expression, Session session, Metadata metadata, SqlParser sqlParser, SymbolAllocator symbolAllocator) { requireNonNull(metadata, "metadata is null"); <START> requireNonNull(sqlParser, "sqlParser is null"); <END> if (expression instanceof SymbolReference) { return expression; } return new AnalyzedExpressionRewriter(session, metadata, sqlParser, symbolAllocator.getTypes()).rewriteWith(Visitor::new, expression); }</code><technical_language>@hellium01 a ? :)</technical_language>

Target:
public static Expression rewrite(Expression expression, Session session, Metadata metadata, SqlParser sqlParser, SymbolAllocator symbolAllocator) { requireNonNull(metadata, "metadata is null"); requireNonNull(sqlParser, "sqlParser is null"); return new AnalyzedExpressionRewriter(session, metadata, sqlParser, symbolAllocator.getTypes()).rewriteWith(Visitor::new, expression); }
Source:
<code>public void shouldFailWhenCreateDuplicateEntries() { try { Session session = directoryService.open("continentDirectory"); Map<String, Object> continent = Map.of("id", "middle-earth", "label", "Middle Earth"); <START> List<Map<String, Object>> entries = Arrays.asList(continent, continent); <END> entries.forEach(session::createEntry); fail(); } catch (DirectoryException de) { assertEquals("Entry with id middle-earth already exists in directory 'continentDirectory'", de.getMessage()); } }</code><technical_language>List.of, Map.of</technical_language>

Target:
public void shouldFailWhenCreateDuplicateEntries() { try { Session session = directoryService.open("continentDirectory"); Map<String, Object> continent = Map.of("id", "middle-earth", "label", "Middle Earth"); List<Map<String, Object>> entries = List.of(continent, continent); entries.forEach(session::createEntry); fail("Should raise a DirectoryException"); } catch (DirectoryException de) { assertEquals("Entry with id middle-earth already exists in directory continentDirectory", de.getMessage()); } }
Source:
<code><START> public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { <END> if(changeContext.getType() == NotificationContext.Type.INIT){ _listenerInitiated = true; } if(_lastEventTimestamp == null || _lastEventTimestamp <= changeContext.getCreationTime()) { _liveInstances = liveInstances; _lastEventTimestamp = changeContext.getCreationTime(); } }</code><technical_language>a lock for onLiveInstanceChange getLiveInstances</technical_language>

Target:
public synchronized void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { if (changeContext.getType() == NotificationContext.Type.INIT) { _listenerInitiated = true; } if(_lastEventTimestamp > changeContext.getCreationTime()) { LOGGER.warn("RECEIVED OUT OF ORDER EVENT"); } if (_lastEventTimestamp <= changeContext.getCreationTime()) { _liveInstances = liveInstances; _lastEventTimestamp = changeContext.getCreationTime(); } }
Source:
<code>private Map<String, String> createFileExtensionsMap() { <START> Map<String, String> extensionContentTypeMap = new HashMap(); <END> extensionContentTypeMap.put(".xml", "application/xml"); extensionContentTypeMap.put(".js", "application/javascript"); extensionContentTypeMap.put(".css", "text/css"); extensionContentTypeMap.put(".html", "text/html"); extensionContentTypeMap.put(".sql", "text/plain"); extensionContentTypeMap.put(".xsd", "Schema"); extensionContentTypeMap.put(".xsl", "application/xsl+xml"); extensionContentTypeMap.put(".xslt", "application/xslt+xml"); extensionContentTypeMap.put(".dmc", "application/datamapper"); extensionContentTypeMap.put(".zip", "application/zip"); extensionContentTypeMap.put(".wsdl", "WSDL"); return extensionContentTypeMap; }</code><technical_language>suggestion Map<String, String> extensionContentTypeMap = new HashMap<>();</technical_language>

Target:
private Map<String, String> createFileExtensionsMap() { Map<String, String> extensionContentTypeMap = new HashMap<>(); extensionContentTypeMap.put(".xml", "application/xml"); extensionContentTypeMap.put(".js", "application/javascript"); extensionContentTypeMap.put(".css", "text/css"); extensionContentTypeMap.put(".html", "text/html"); extensionContentTypeMap.put(".sql", "text/plain"); extensionContentTypeMap.put(".xsd", "Schema"); extensionContentTypeMap.put(".xsl", "application/xsl+xml"); extensionContentTypeMap.put(".xslt", "application/xslt+xml"); extensionContentTypeMap.put(".dmc", "application/datamapper"); extensionContentTypeMap.put(".zip", "application/zip"); extensionContentTypeMap.put(".wsdl", "WSDL"); return extensionContentTypeMap; }
Source:
<code>private List<Ref> getBranches() { List<Ref> ref = new ArrayList<Ref>(); try { ref.addAll(db.getRefDatabase().getRefs(Constants.R_HEADS).values()); ref.addAll(db.getRefDatabase().getRefs(Constants.R_REMOTES).values()); } catch (IOException e) { <START> e.printStackTrace(); <END> } return ref; }</code><technical_language>log this rethrow exception (if get branches user this)</technical_language>

Target:
private List<Ref> getBranches() { List<Ref> ref = new ArrayList<Ref>(); try { ref.addAll(db.getRefDatabase().getRefs(Constants.R_HEADS).values()); ref.addAll(db.getRefDatabase().getRefs(Constants.R_REMOTES).values()); } catch (IOException e) { Activator.logError(e.getMessage(), e); } return ref; }
Source:
<code>private void findAllPresenters(PresenterDefinitions presenterDefinitions) throws UnableToCompleteException { <START> <END> for (JClassType type : getTypeOracle().getTypes()) { if (type.isAnnotationPresent(ProxyStandard.class)) { presenterDefinitions.addStandardPresenter(type.getEnclosingType()); } else if (type.isAnnotationPresent(ProxyCodeSplit.class)) { presenterDefinitions.addCodeSplitPresenter(type.getEnclosingType()); } else if (type.isAnnotationPresent(ProxyCodeSplitBundle.class)) { presenterDefinitions.addCodeSplitBundlePresenter(type.getAnnotation(ProxyCodeSplitBundle.class).value(), type.getEnclosingType()); } if (type.isAnnotationPresent(UseGatekeeper.class)) { final String gkName = type.getAnnotation(UseGatekeeper.class).value().getName(); try { presenterDefinitions.addGatekeeper(getTypeOracle().getType(gkName)); } catch (NotFoundException e) { getTreeLogger().log(TreeLogger.ERROR, "Cannot find Gatekeeper " + gkName, e); throw new UnableToCompleteException(); } } } }</code><technical_language>rm 120</technical_language>

Target:
private void findAllPresenters(PresenterDefinitions presenterDefinitions) throws UnableToCompleteException { for (JClassType type : getTypeOracle().getTypes()) { if (type.isAnnotationPresent(ProxyStandard.class)) { presenterDefinitions.addStandardPresenter(type.getEnclosingType()); } else if (type.isAnnotationPresent(ProxyCodeSplit.class)) { presenterDefinitions.addCodeSplitPresenter(type.getEnclosingType()); } else if (type.isAnnotationPresent(ProxyCodeSplitBundle.class)) { ProxyCodeSplitBundle annotation = type.getAnnotation(ProxyCodeSplitBundle.class); verifyCodeSplitBundleConfiguration(type.getName(), annotation); presenterDefinitions.addCodeSplitBundlePresenter(annotation.value(), type.getEnclosingType()); } if (type.isAnnotationPresent(UseGatekeeper.class)) { presenterDefinitions.addGatekeeper(getType(type.getAnnotation(UseGatekeeper.class).value().getName())); } } }
Source:
<code>public void testExtend() { final TestSubscriber<Object> subscriber = new TestSubscriber<Object>(); final Object value = new Object(); <START> Observable.just(value).x(new ConversionFunc<Object,Object>(){ <END> @Override public Object convert(OnSubscribe<Object> onSubscribe) { onSubscribe.call(subscriber); subscriber.assertNoErrors(); subscriber.assertCompleted(); subscriber.assertValue(value); return subscriber.getOnNextEvents().get(0); }}); }</code><technical_language>This is essentially as: java Observable.just(value).to(o -> { o.subscribe(subscriber); subscriber.assertNoErrors(); subscriber.assertCompleted(); subscriber.assertValue(value); return subscriber.getOnNextEvents().get(0); });</technical_language>

Target:
public void testExtend() { final TestSubscriber<Object> subscriber = new TestSubscriber<Object>(); final Object value = new Object(); Observable.just(value).x(new Func1<OnSubscribe<Object>,Object>(){ @Override public Object call(OnSubscribe<Object> onSubscribe) { onSubscribe.call(subscriber); subscriber.assertNoErrors(); subscriber.assertCompleted(); subscriber.assertValue(value); return subscriber.getOnNextEvents().get(0); }}); }
Source:
<code>public synchronized void releaseTimer() { int count = refCount.decrementAndGet(); if (count > 0) { LOGGER.log(Level.FINEST, "Outstanding references still exist so not closing shared Timer"); } else if (count == 0) { LOGGER.log(Level.FINEST, "No outstanding references to shared Timer, will cancel and close it"); if (timer != null) { timer.cancel(); timer = null; } } else { <START> LOGGER.log(Level.FINE, <END> "releaseTimer() called too many times; there is probably a bug in the calling code"); refCount.set(0); } }</code><technical_language>1 this happen, message highlights fishy</technical_language>

Target:
public synchronized void releaseTimer() { int count = refCount.decrementAndGet(); if (count > 0) { LOGGER.log(Level.FINEST, "Outstanding references still exist so not closing shared Timer"); } else if (count == 0) { LOGGER.log(Level.FINEST, "No outstanding references to shared Timer, will cancel and close it"); if (timer != null) { timer.cancel(); timer = null; } } else { LOGGER.log(Level.WARNING, "releaseTimer() called too many times; there is probably a bug in the calling code"); refCount.set(0); } }
Source:
<code>public final MaxentModel train(ObjectStream<Event> events) throws IOException { if (!isValid()) { throw new IllegalArgumentException("trainParams are not valid!"); } HashSumEventStream hses = new HashSumEventStream(events); DataIndexer indexer = getDataIndexer(hses); <START> MaxentModel model = doTrain(indexer); <END> parameters.addToReport("Training-Eventhash", hses.calculateHashSum().toString(16)); parameters.addToReport(AbstractTrainer.TRAINER_TYPE_PARAM, EventTrainer.EVENT_VALUE); return model; }</code><technical_language>call new train method here</technical_language>

Target:
public final MaxentModel train(ObjectStream<Event> events) throws IOException { if (!isValid()) { throw new IllegalArgumentException("trainParams are not valid!"); } HashSumEventStream hses = new HashSumEventStream(events); DataIndexer indexer = getDataIndexer(hses); return train(indexer); }
Source:
<code>public Set<String> getRequiredColumns() { <START> return null; <END> }</code><technical_language>Collections.emptySet()</technical_language>

Target:
public Set<String> getRequiredColumns() { return Collections.emptySet(); }
Source:
<code>public synchronized void close() { <START> synchronized (this) { <END> if (timerID >= 0) { client.getVertx().cancelTimer(timerID); timerID = -1; } } endpointMap.clear(); for (HttpClientConnection conn : connectionMap.values()) { conn.close(); } }</code><technical_language>synchronize(this) method is synchronized</technical_language>

Target:
public void close() { synchronized (this) { if (timerID >= 0) { client.getVertx().cancelTimer(timerID); timerID = -1; } } endpointMap.clear(); for (HttpClientConnection conn : connectionMap.values()) { conn.close(); } }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: prepareToFinish(true); break; case R.id.send: checkToSendMessage(); break; case R.id.save: checkToSaveDraftAndSave(); break; case R.id.discard: askBeforeDiscard(); break; case R.id.add_from_contacts: recipientPresenter.onMenuAddFromContacts(); break; case R.id.openpgp_inline_enable: recipientPresenter.onMenuSetPgpInline(true); updateMessageFormat(); break; case R.id.openpgp_inline_disable: recipientPresenter.onMenuSetPgpInline(false); updateMessageFormat(); break; case R.id.openpgp_sign_only: recipientPresenter.onMenuSetSignOnly(true); break; case R.id.openpgp_sign_only_disable: recipientPresenter.onMenuSetSignOnly(false); break; case R.id.add_attachment: attachmentPresenter.onClickAddAttachment(recipientPresenter); break; case R.id.read_receipt: onReadReceipt(); break; case R.id.is_urgent: <START> if (!isHighPriority) { <END> item.setTitle("Normal"); this.isHighPriority = true; setTitle(getTitle() + ":U"); } else { item.setTitle("Urgent"); this.isHighPriority = false; setTitle(getTitle().toString().split(":")[0]); } break; default: return super.onOptionsItemSelected(item); } return true; }</code><technical_language>handled in a method</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: prepareToFinish(true); break; case R.id.send: checkToSendMessage(); break; case R.id.save: checkToSaveDraftAndSave(); break; case R.id.discard: askBeforeDiscard(); break; case R.id.add_from_contacts: recipientPresenter.onMenuAddFromContacts(); break; case R.id.openpgp_inline_enable: recipientPresenter.onMenuSetPgpInline(true); updateMessageFormat(); break; case R.id.openpgp_inline_disable: recipientPresenter.onMenuSetPgpInline(false); updateMessageFormat(); break; case R.id.openpgp_sign_only: recipientPresenter.onMenuSetSignOnly(true); break; case R.id.openpgp_sign_only_disable: recipientPresenter.onMenuSetSignOnly(false); break; case R.id.add_attachment: attachmentPresenter.onClickAddAttachment(recipientPresenter); break; case R.id.read_receipt: onReadReceipt(); break; case R.id.is_high_priority: onHighPriority(item); break; default: return super.onOptionsItemSelected(item); } return true; }
Source:
<code>public void attachments_with_different_media_types_can_be_created() throws IOException { given().a_report_model(); attachments .and().an_attachment_with_content_$_and_mediaType(JSON_SAMPLE, MediaType.JSON_UTF_8) .and().file_name("jsonfile") .and().an_attachment_with_binary_content_$_and_mediaType(BINARY_SAMPLE, MediaType.PNG) .and().file_name("pngfile"); given() .and().the_attachments_are_added_to_step_$_of_case_$(1,1); jsonReports .and().the_report_exist_as_JSON_file(); when().the_HTML_Report_Generator_is_executed(); <START> String folder = "data/attachments/Test".replaceAll("/", File.separator.replaceAll("\\\\","\\\\\\\\")); <END> then().a_file_$_exists_in_folder_$("jsonfile.json", folder) .with().content(JSON_SAMPLE) .and().a_file_$_exists_in_folder_$("pngfile.png", folder) .with().binary_content(BINARY_SAMPLE); }</code><technical_language>ah, I hate replacement string problem forget that. Matcher.quoteReplacement method instead, code more clear :-)</technical_language>

Target:
public void attachments_with_different_media_types_can_be_created() throws IOException { given().a_report_model(); attachments .and().an_attachment_with_content_$_and_mediaType(JSON_SAMPLE, MediaType.JSON_UTF_8) .and().file_name("jsonfile") .and().an_attachment_with_binary_content_$_and_mediaType(BINARY_SAMPLE, MediaType.PNG) .and().file_name("pngfile"); given() .and().the_attachments_are_added_to_step_$_of_case_$(1,1); jsonReports .and().the_report_exist_as_JSON_file(); when().the_HTML_Report_Generator_is_executed(); String folder = "data/attachments/Test".replaceAll("/", Matcher.quoteReplacement(File.separator)); then().a_file_$_exists_in_folder_$("jsonfile.json", folder) .with().content(JSON_SAMPLE) .and().a_file_$_exists_in_folder_$("pngfile.png", folder) .with().binary_content(BINARY_SAMPLE); }
Source:
<code>private void register(Type javaType, JdbcType jdbcType, TypeHandler<?> handler) { if (javaType != null) { Map<JdbcType, TypeHandler<?>> map = typeHandlerMap.get(javaType); if (map == null || map == NULL_TYPE_HANDLER_MAP) { map = new HashMap<>(); map.put(jdbcType, handler); typeHandlerMap.put(javaType, map); } else { map.put(jdbcType, handler); <START> } <END> } allTypeHandlersMap.put(handler.getClass(), handler); }</code><technical_language>Wow...did this happen production? change, updating typeHandlerMap end? i.e. java Map<JdbcType, TypeHandler<?>> map = typeHandlerMap.get(javaType); if (map == null || map == NULL_TYPE_HANDLER_MAP) { map = new HashMap<>(); } map.put(jdbcType, handler); typeHandlerMap.put(javaType, map);</technical_language>

Target:
private void register(Type javaType, JdbcType jdbcType, TypeHandler<?> handler) { if (javaType != null) { Map<JdbcType, TypeHandler<?>> map = typeHandlerMap.get(javaType); if (map == null || map == NULL_TYPE_HANDLER_MAP) { map = new HashMap<>(); } map.put(jdbcType, handler); typeHandlerMap.put(javaType, map); } allTypeHandlersMap.put(handler.getClass(), handler); }
Source:
<code>public void cloneForRevision_shouldSetAllTheRelevantFields() throws Exception { OrderTest.assertThatAllFieldsAreCopied(new DrugOrder(), "cloneForRevision", "creator", "dateCreated", "action", <START> "changedBy", "concept", "dateChanged", "voided", "dateVoided", "voidedBy", "voidReason", "encounter", <END> "orderNumber", "orderer", "previousOrder", "startDate", "dateStopped", "accessionNumber"); }</code><technical_language>here, concepts excludes fields technically</technical_language>

Target:
public void cloneForRevision_shouldSetAllTheRelevantFields() throws Exception { DrugOrder drugOrder = new DrugOrder(); Drug drug = new Drug(); drug.setConcept(new Concept()); drugOrder.setDrug(drug); OrderTest.assertThatAllFieldsAreCopied(drugOrder, "cloneForRevision", "creator", "dateCreated", "action", "changedBy", "dateChanged", "voided", "dateVoided", "voidedBy", "voidReason", "encounter", "orderNumber", "orderer", "previousOrder", "startDate", "dateStopped", "accessionNumber"); }
Source:
<code>public Stream<Issue> getUpstreamReferences() throws NameNotFoundException { if (upstreamReferences == null) { <START> JiraIssueHomeImpl home = new JiraIssueHomeImpl(); <END> upstreamReferences = home.findUpstreamReferences(this); } return upstreamReferences; }</code><technical_language>creates a new instance instead of issue home implementation container</technical_language>

Target:
public Stream<Issue> getUpstreamReferences() throws NameNotFoundException { if (upstreamReferences == null) { upstreamReferences = super.getUpstreamReferences(); } return upstreamReferences; }
Source:
<code>public void onStopped() { if (wasHiding && getUserVisibleHint()) { try { wasHiding = false; youTubePlayer.play(); } catch (Exception error) { initializeYoutubePlayer(); } } <START> else if (!getUserVisibleHint()) { <END> youTubePlayer.release(); } }</code><technical_language>is need release youtuebe player here, of releasing player in setUserVisibleHint method</technical_language>

Target:
public void onStopped() { if (!isInForeground && getUserVisibleHint()) { try { isInForeground = true; youTubePlayer.play(); } catch (Exception error) { initializeYoutubePlayer(); } } }
Source:
<code>public void start(BundleContext context) throws Exception { super.start(context); PreferencesHint.registerPreferenceStore(DiagramUIPlugin.DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); dynamicPreferences = new DynamicDiagramUIPreferences(getPreferenceStore()); adapterFactory = createAdapterFactory(); descriptorsToImages = new HashMap<ImageWithDimensionDescriptor, Image>(); ressourceMissingDocumentProvider = new ResourceMissingDocumentProvider(); workspaceImageFigureRefresher = new WorkspaceImageFigureRefresher(); workspaceImageFigureRefresher.init(); imageSelectorDescriptorRegistryListener = new ImageSelectorDescriptorRegistryListener(); imageSelectorDescriptorRegistryListener.init(); formatDataManagerRegistryListener = new FormatDataManagerRegistryListener(); formatDataManagerRegistryListener.init(); layoutDataManagerRegistryListener = new LayoutDataManagerRegistryListener(); layoutDataManagerRegistryListener.init(); <START> registerDecorationProviders(); <END> }</code><technical_language>registerCoreDecorationProviders register core decoration providers (contrary unregisterDecorationProviders decoration providers unregistered)</technical_language>

Target:
public void start(BundleContext context) throws Exception { super.start(context); PreferencesHint.registerPreferenceStore(DiagramUIPlugin.DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); dynamicPreferences = new DynamicDiagramUIPreferences(getPreferenceStore()); adapterFactory = createAdapterFactory(); descriptorsToImages = new HashMap<ImageWithDimensionDescriptor, Image>(); ressourceMissingDocumentProvider = new ResourceMissingDocumentProvider(); workspaceImageFigureRefresher = new WorkspaceImageFigureRefresher(); workspaceImageFigureRefresher.init(); imageSelectorDescriptorRegistryListener = new ImageSelectorDescriptorRegistryListener(); imageSelectorDescriptorRegistryListener.init(); formatDataManagerRegistryListener = new FormatDataManagerRegistryListener(); formatDataManagerRegistryListener.init(); layoutDataManagerRegistryListener = new LayoutDataManagerRegistryListener(); layoutDataManagerRegistryListener.init(); registerCoreDecorationProviders(); }
Source:
<code>public void testCountWindowedStream() { final WindowOperatorStream<Tuple2<String, Integer>> countWindowedStream = <START> (WindowOperatorStream)mappedStream <END> .window(new CountWindowInformation(windowSize, windowEmissionInterval)); Assert.assertEquals(countWindowedStream.getBasicType(), StreamType.BasicType.WINDOWED); Assert.assertEquals(countWindowedStream.getOperatorType(), StreamType.OperatorType.COUNT_WINDOW); final FixedSizeWindowInformation windowInfo = (FixedSizeWindowInformation) countWindowedStream.getWindowInfo(); Assert.assertEquals(windowInfo.getWindowSize(), windowSize); Assert.assertEquals(windowInfo.getWindowEmissionInterval(), windowEmissionInterval); checkEdges(queryBuilder.build().getDAG(), 2, mappedStream, countWindowedStream, StreamType.Direction.LEFT); }</code><technical_language>type casting</technical_language>

Target:
public void testCountWindowedStream() { final WindowOperatorStream<Tuple2<String, Integer>> countWindowedStream = mappedStream .window(new CountWindowInformation(windowSize, windowEmissionInterval)); Assert.assertEquals(countWindowedStream.getBasicType(), StreamType.BasicType.WINDOWED); Assert.assertEquals(countWindowedStream.getOperatorType(), StreamType.OperatorType.COUNT_WINDOW); final FixedSizeWindowInformation windowInfo = (FixedSizeWindowInformation) countWindowedStream.getWindowInfo(); Assert.assertEquals(windowInfo.getWindowSize(), windowSize); Assert.assertEquals(windowInfo.getWindowEmissionInterval(), windowEmissionInterval); checkEdges(queryBuilder.build().getDAG(), 2, mappedStream, countWindowedStream, StreamType.Direction.LEFT); }
Source:
<code>public void testCharTrailingSpace() throws Exception { execute("CREATE TABLE tpch.char_trailing_space (x char(10))"); assertUpdate("INSERT INTO char_trailing_space VALUES ('test')", 1); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test'", "VALUES 'test'"); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test '", "VALUES 'test'"); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test '", "VALUES 'test'"); assertEquals(getQueryRunner().execute("SELECT * FROM char_trailing_space WHERE x = char ' test'").getRowCount(), 0); <START> QueryRunner queryRunner = createQueryRunnerWithLegacyCoercion(); <END> assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test'").getRowCount(), 0); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '").getRowCount(), 0); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '").getRowCount(), 0); MaterializedResult result = queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '"); assertEquals(result.getRowCount(), 1); assertEquals(result.getMaterializedRows().get(0).getField(0), "test "); assertUpdate("DROP TABLE char_trailing_space"); }</code><technical_language>nice! Thank you</technical_language>

Target:
public void testCharTrailingSpace() throws Exception { execute("CREATE TABLE tpch.char_trailing_space (x char(10))"); assertUpdate("INSERT INTO char_trailing_space VALUES ('test')", 1); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test'", "VALUES 'test'"); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test '", "VALUES 'test'"); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test '", "VALUES 'test'"); assertEquals(getQueryRunner().execute("SELECT * FROM char_trailing_space WHERE x = char ' test'").getRowCount(), 0); Map<String, String> properties = ImmutableMap.of("deprecated.legacy-char-to-varchar-coercion", "true"); Map<String, String> connectorProperties = ImmutableMap.of("connection-url", postgreSqlServer.getJdbcUrl()); try (QueryRunner queryRunner = new DistributedQueryRunner(getSession(), 3, properties);) { queryRunner.installPlugin(new PostgreSqlPlugin()); queryRunner.createCatalog("postgresql", "postgresql", connectorProperties); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test'").getRowCount(), 0); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '").getRowCount(), 0); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '").getRowCount(), 0); MaterializedResult result = queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '"); assertEquals(result.getRowCount(), 1); assertEquals(result.getMaterializedRows().get(0).getField(0), "test "); } assertUpdate("DROP TABLE char_trailing_space"); }
Source:
<code>public CollisionMask getBoundingArea() { <START> return (CollisionMask) boundingArea; <END> }</code><technical_language>Unnecessary cast. change type of boundingArea attribute ICollisionArea CollisionMask. <logic</technical_language>

Target:
public CollisionMask getBoundingArea() { return boundingArea; }
Source:
<code>public VoltTable[] run(SystemProcedureExecutionContext ctx, String exportSource, String[] targets, String operationMode) throws Exception { VoltTable results = new VoltTable( new ColumnInfo("SOURCE", VoltType.STRING), new ColumnInfo("TARGET", VoltType.STRING), new ColumnInfo("PARTITIONID", VoltType.BIGINT), new ColumnInfo("STATUS", VoltType.BIGINT), new ColumnInfo("MESSAGE", VoltType.STRING)); try { OperationMode.valueOf(operationMode.toUpperCase()); } catch (IllegalArgumentException e){ results.addRow("", "", -1, VoltSystemProcedure.STATUS_FAILURE, e.getMessage()); return new VoltTable[] {results}; } exportSource = exportSource == null ? "" : exportSource; LOG.info("Export " + operationMode + " source:" + exportSource + " targets:" + Arrays.toString(targets)); <START> if (!"".equals(exportSource)) { <END> RealVoltDB volt = (RealVoltDB)VoltDB.instance(); Set<String> exportStreams = CatalogUtil.getExportTableNames( volt.getCatalogContext().database); boolean isThere = exportStreams.stream().anyMatch(exportSource::equalsIgnoreCase); if (!isThere) { results.addRow(exportSource, "", -1,VoltSystemProcedure.STATUS_FAILURE, "Export stream " + exportSource + " does not exist."); return new VoltTable[] {results}; } } return performExportControl(exportSource, targets, operationMode); }</code><technical_language>Huh? exportSource.isEmpty</technical_language>

Target:
public VoltTable[] run(SystemProcedureExecutionContext ctx, String exportSource, String[] targets, String operationMode) throws Exception { VoltTable results = new VoltTable( new ColumnInfo("SOURCE", VoltType.STRING), new ColumnInfo("TARGET", VoltType.STRING), new ColumnInfo("PARTITIONID", VoltType.BIGINT), new ColumnInfo("STATUS", VoltType.BIGINT), new ColumnInfo("MESSAGE", VoltType.STRING)); try { OperationMode.valueOf(operationMode.toUpperCase()); } catch (IllegalArgumentException e){ results.addRow("", "", -1, VoltSystemProcedure.STATUS_FAILURE, e.getMessage()); return new VoltTable[] {results}; } exportSource = exportSource == null ? "" : exportSource; LOG.info("Export " + operationMode + " source:" + exportSource + " targets:" + Arrays.toString(targets)); if (!StringUtil.isEmpty(exportSource)) { RealVoltDB volt = (RealVoltDB)VoltDB.instance(); Set<String> exportStreams = CatalogUtil.getExportTableNames( volt.getCatalogContext().database); boolean isThere = exportStreams.stream().anyMatch(exportSource::equalsIgnoreCase); if (!isThere) { results.addRow(exportSource, "", -1,VoltSystemProcedure.STATUS_FAILURE, "Export stream " + exportSource + " does not exist."); return new VoltTable[] {results}; } } return performExportControl(exportSource, targets, operationMode); }
Source:
<code><START> public String getType(Uri uri) { <END> return "application/xml"; }</code><technical_language>affect mail sharing option, I try open ZIP in mail client (Thunderbird) opens a text editor archive tool. mail source shows a type of application/xml for ZIP attachment: ------NBUC58F9SIXAUMV2UF11EAMGBWUN0X Content-Type: application/xml; name="2017-07-16_11-40-37.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="2017-07-16_11-40-37.zip"; size=-1 UEsDBBQACAgIACFd8EoAAAAAAAAAAAAAAAAXAAAAMjAxNy0wNy0xNl8xMS00MC0zNy5ncHi91ttu 2yAYAODr9imY723AxqfIcVVt2m5arVIzqVpVTcyhDosDEaaLH2BPskfbkwzsTq2d5tBK81UI/vn5 wBycnTWrCvxkquZSTB3sIQcwUcg5F+XU+TL76CYOOMtPs3LdABMq6qmz0Ho9gXCz2XharmWp6D1v ..</technical_language>

Target:
public String getType(Uri uri) { ExportAndShareTask.FileTypes type = ExportAndShareTask.sharedFiles.get(uri.getLastPathSegment()).fileType; return (type == ExportAndShareTask.FileTypes.ZIP) ? "application/zip" : "application/xml"; }
Source:
<code>public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); FeedbackSessionInfo.FeedbackSessionSaveRequest saveRequest = getAndValidateRequestBody(FeedbackSessionInfo.FeedbackSessionSaveRequest.class); feedbackSession.setInstructions(saveRequest.getInstructions()); feedbackSession.setStartTime(saveRequest.getSubmissionStartTime()); feedbackSession.setEndTime(saveRequest.getSubmissionEndTimestamp()); feedbackSession.setGracePeriodMinutes(saveRequest.getGracePeriod()); feedbackSession.setSessionVisibleFromTime(saveRequest.getSessionVisibleFromTime()); feedbackSession.setResultsVisibleFromTime(saveRequest.getResultsVisibleFromTime()); feedbackSession.setClosingEmailEnabled(saveRequest.isClosingEmailEnabled()); feedbackSession.setPublishedEmailEnabled(saveRequest.isPublishedEmailEnabled()); try { logic.updateFeedbackSession(feedbackSession); } catch (InvalidParametersException | EntityDoesNotExistException e) { <START> throw new InvalidHttpRequestBodyException(e.getMessage(), e); <END> } return new JsonResult(new FeedbackSessionInfo.FeedbackSessionResponse(feedbackSession)); }</code><technical_language>Similarly here; InvalidHttpRequestBodyException? 400 404 depending case</technical_language>

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); FeedbackSessionInfo.FeedbackSessionSaveRequest saveRequest = getAndValidateRequestBody(FeedbackSessionInfo.FeedbackSessionSaveRequest.class); feedbackSession.setInstructions(saveRequest.getInstructions()); feedbackSession.setStartTime(saveRequest.getSubmissionStartTime()); feedbackSession.setEndTime(saveRequest.getSubmissionEndTimestamp()); feedbackSession.setGracePeriodMinutes(saveRequest.getGracePeriod()); feedbackSession.setSessionVisibleFromTime(saveRequest.getSessionVisibleFromTime()); feedbackSession.setResultsVisibleFromTime(saveRequest.getResultsVisibleFromTime()); feedbackSession.setClosingEmailEnabled(saveRequest.isClosingEmailEnabled()); feedbackSession.setPublishedEmailEnabled(saveRequest.isPublishedEmailEnabled()); try { logic.updateFeedbackSession(feedbackSession); } catch (InvalidParametersException ipe) { throw new InvalidHttpRequestBodyException(ipe.getMessage(), ipe); } catch (EntityDoesNotExistException ednee) { return new JsonResult(ednee.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } return new JsonResult(new FeedbackSessionInfo.FeedbackSessionResponse(feedbackSession)); }
Source:
<code>public SearchResult search(Market market, Category category, String queryText, IProgressMonitor monitor) throws CoreException { SearchResult result = new SearchResult(); if (queryText == null || queryText.trim().length() == 0) { result.setMatchCount(0); result.setNodes(new ArrayList<Node>()); } else { String relativeUrl; try { relativeUrl = API_URI_SUFFIX + "/search/apachesolr_search/" + URLEncoder.encode(queryText.trim(), UTF_8); <START> String queryString = ""; END> if (market != null || category != null) { queryString += "filters="; if (category != null) { queryString += "tid:" + URLEncoder.encode(category.getId(), UTF_8); if (market != null) { queryString += "%20"; } } if (market != null) { queryString += "tid:" + URLEncoder.encode(market.getId(), UTF_8); } } if (queryString.length() > 0) { relativeUrl += '?' + queryString; } } catch (UnsupportedEncodingException e) { throw new IllegalStateException(); } Marketplace marketplace = processRequest(relativeUrl, monitor); Search search = marketplace.getSearch(); if (search == null) { throw new CoreException(createErrorStatus(Messages.DefaultMarketplaceService_unexpectedResponse, null)); } result.setMatchCount(search.getCount()); result.setNodes(search.getNode()); } return result; }</code><technical_language>I ti's time pull url creation out a seperate method a testcase for it</technical_language>

Target:
public SearchResult search(Market market, Category category, String queryText, IProgressMonitor monitor) throws CoreException { SearchResult result = new SearchResult(); if (queryText == null || queryText.trim().length() == 0) { result.setMatchCount(0); result.setNodes(new ArrayList<Node>()); } else { String relativeUrl = computeRelativeSearchUrl(market, category, queryText); Marketplace marketplace = processRequest(relativeUrl, monitor); Search search = marketplace.getSearch(); if (search == null) { throw new CoreException(createErrorStatus(Messages.DefaultMarketplaceService_unexpectedResponse, null)); } result.setMatchCount(search.getCount()); result.setNodes(search.getNode()); } return result; }
Source:
<code><START> public List<Object> identifyPutGarbage(Object locator, K key, V value) { <END> List<Object> garbage = new ArrayList<>(); garbage.addAll(locatorStore.addUnsafe(key, (SMRRecordLocator) locator)); return garbage; }</code><technical_language>consistent CorfuTable</technical_language>

Target:
public List<Object> identifyPutGarbage(Object locator, K key, V value) { return new ArrayList<>(locatorStore.addUnsafe(key, (SMRRecordLocator) locator)); }
Source:
<code>protected void executeCommand() { GlusterVolumeEntity volume = getGlusterVolume(); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), <START> volume.getBricks(), <END> volume.getReplicaCount())); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_FAILED, returnValue.getVdsError().getMessage()); return; } endStepJob(); releaseVolumeLock(); getReturnValue().setActionReturnValue(returnValue.getReturnValue()); }</code><technical_language>bricks parameters class</technical_language>

Target:
protected void executeCommand() { GlusterVolumeEntity volume = getGlusterVolume(); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), getParameters().getBricks())); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_FAILED, returnValue.getVdsError().getMessage()); return; } endStepJob(); releaseVolumeLock(); getReturnValue().setActionReturnValue(returnValue.getReturnValue()); }
Source:
<code>public static JTabbedPane newJTabbedPane(final int width, final int height) { <START> final JTabbedPane tabbedPane = new JTabbedPaneWithFixedWidthTabs(); <END> tabbedPane.setPreferredSize(new Dimension(width, height)); return tabbedPane; }</code><technical_language>this line supposed newJTabbedPane()? a bit confused I thought removing fixed width tabs, around. Wondering missing</technical_language>

Target:
public static JTabbedPane newJTabbedPane(final int width, final int height) { final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.setPreferredSize(new Dimension(width, height)); return tabbedPane; }
Source:
<code>private void initGlusterPeerProcess() { List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), getVds())) { try { glusterPeerProbe(upServer.getId(), getVds().gethost_name()); } catch (Exception e) { log.errorFormat("Could not peer probe the gluster server {0}. Error: {1}", <START> getVds().getvds_name(), <END> e.getMessage()); } } } } }</code><technical_language>log host_name instead of vds_name</technical_language>

Target:
private void initGlusterPeerProcess() { List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), getVds())) { try { glusterPeerProbe(upServer.getId(), getVds().gethost_name()); } catch (Exception e) { log.errorFormat("Could not peer probe the gluster server {0}. Error: {1}", getVds().gethost_name(), e.getMessage()); } } } } }