auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public RestApiManager(Context context, OkHttpClient oauthBasedClient) { this.context = context; <START> this.oauthBasedClient = new OkHttpClient(); <END> RestAdapter restAdapter = new RestAdapter.Builder() .setClient(new OkClient(oauthBasedClient)) .setEndpoint(getBaseUrl()) .setRequestInterceptor(new OfflineRequestInterceptor(context)) .build(); oauthRestApi = restAdapter.create(OauthRestApi.class); client = new OkHttpClient(); client.interceptors().add(new LoggingInterceptor()); restAdapter = new RestAdapter.Builder() .setClient(new OkClient(client)) .setEndpoint(getBaseUrl()) .build(); restApi = restAdapter.create(PublicRestApi.class); }</code><technical_language>initialize this a new OkHttpClient instance is used</technical_language>

Target:
public RestApiManager(Context context, OkHttpClient oauthBasedClient) { this.context = context; this.oauthBasedClient = oauthBasedClient; RestAdapter restAdapter = new RestAdapter.Builder() .setClient(new OkClient(oauthBasedClient)) .setEndpoint(getBaseUrl()) .setRequestInterceptor(new OfflineRequestInterceptor(context)) .build(); oauthRestApi = restAdapter.create(OauthRestApi.class); client = new OkHttpClient(); client.interceptors().add(new LoggingInterceptor()); restAdapter = new RestAdapter.Builder() .setClient(new OkClient(client)) .setEndpoint(getBaseUrl()) .build(); restApi = restAdapter.create(PublicRestApi.class); }
Source:
<code>public static synchronized void createNewView(LamiAnalysisReport report) throws PartInitException { currentReport = report; int mode = IWorkbenchPage.VIEW_ACTIVATE; final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); <START> page.showView(LamiReportView.VIEW_ID, String.valueOf(secondaryViewId++), mode); <END> currentReport = null; }</code><technical_language>create a 'setInput()' method in LamiReportView call provide report, instead of relying static getCurrentReport</technical_language>

Target:
public static synchronized void createNewView(LamiAnalysisReport report) throws PartInitException { currentReport = report; final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); page.showView(LamiReportView.VIEW_ID, String.valueOf(secondaryViewId), IWorkbenchPage.VIEW_VISIBLE); page.activate(page.findView(LamiReportView.VIEW_ID)); secondaryViewId++; currentReport = null; }
Source:
<code>public ListPanel(UI ui, GUIController guiController, PanelControl parentPanelControl, int panelIndex) { super(ui, guiController, parentPanelControl, panelIndex); this.ui = ui; this.guiController = guiController; <START> totalLabel = new Label("Total : - "); <END> listView = new IssueListView(); setupListView(); getChildren().add(listView); getChildren().add(createPanelFooter()); }</code><technical_language>This of createPanelFooter method? a subcomponent of footer</technical_language>

Target:
public ListPanel(UI ui, GUIController guiController, PanelControl parentPanelControl, int panelIndex) { super(ui, guiController, parentPanelControl, panelIndex); this.ui = ui; this.guiController = guiController; listView = new IssueListView(); setupListView(); getChildren().add(listView); getChildren().add(createPanelFooter()); }
Source:
<code>void create(List<CodeReviewCommit> commits, PersonIdent author) throws MergeException { try { this.commits = commits; this.author = author; setBase(); setOurs(); int remainingLockFailureCalls = MAX_LOCK_FAILURE_CALLS; RefUpdate refUpdate = createRefUpdate(oursCommit, baseCommit); for (;;) { Result result = refUpdate.update(); if (result == Result.LOCK_FAILURE) { if (--remainingLockFailureCalls > 0) { Thread.sleep(SLEEP_ON_LOCK_FAILURE_MS); } else { throw new MergeException( "Couldn't create code review notes. Failed to lock the ref: " + REFS_NOTES_SUBMITTED); } } else if (result == Result.REJECTED) { RevCommit theirsCommit = revWalk.parseCommit(refUpdate.getOldObjectId()); NoteMap theirs = NoteMap.read(revWalk.getObjectReader(), theirsCommit); NoteMapMerger merger = new NoteMapMerger(db); NoteMap merged = merger.merge(base, ours, theirs); RevCommit mergeCommit = createCommit(merged, gerritIdent, "Merged note commits\n", theirsCommit, oursCommit); refUpdate = createRefUpdate(mergeCommit, theirsCommit); remainingLockFailureCalls = MAX_LOCK_FAILURE_CALLS; } else if (result == Result.IO_FAILURE) { throw new MergeException( "Couldn't create code review notes because of IO_FAILURE"); } else { break; } } } catch (IOException e) { throw new MergeException("Couldn't create code review notes", e); } catch (InterruptedException e) { throw new MergeException("Couldn't create code review notes", e); <START> } <END> }</code><technical_language>Release inserter RevWalk done: } finally { inserter.release(); revWalk.release(); }</technical_language>

Target:
public void create(List<CodeReviewCommit> commits, PersonIdent author) throws CodeReviewNoteCreationException { try { this.commits = commits; this.author = author; setBase(); setOurs(); int remainingLockFailureCalls = MAX_LOCK_FAILURE_CALLS; RefUpdate refUpdate = createRefUpdate(oursCommit, baseCommit); for (;;) { Result result = refUpdate.update(); if (result == Result.LOCK_FAILURE) { if (--remainingLockFailureCalls > 0) { Thread.sleep(SLEEP_ON_LOCK_FAILURE_MS); } else { throw new CodeReviewNoteCreationException( "Failed to lock the ref: " + REFS_NOTES_SUBMITTED); } } else if (result == Result.REJECTED) { RevCommit theirsCommit = revWalk.parseCommit(refUpdate.getOldObjectId()); NoteMap theirs = NoteMap.read(revWalk.getObjectReader(), theirsCommit); NoteMapMerger merger = new NoteMapMerger(db); NoteMap merged = merger.merge(base, ours, theirs); RevCommit mergeCommit = createCommit(merged, gerritIdent, "Merged note commits\n", theirsCommit, oursCommit); refUpdate = createRefUpdate(mergeCommit, theirsCommit); remainingLockFailureCalls = MAX_LOCK_FAILURE_CALLS; } else if (result == Result.IO_FAILURE) { throw new CodeReviewNoteCreationException( "Couldn't create code review notes because of IO_FAILURE"); } else { break; } } } catch (IOException e) { throw new CodeReviewNoteCreationException(e); } catch (InterruptedException e) { throw new CodeReviewNoteCreationException(e); } finally { reader.release(); inserter.release(); revWalk.release(); } }
Source:
<code>public NetworkSubTabPanelView(OvirtBreadCrumbsPresenterWidget<NetworkView, NetworkListModel> breadCrumbs, NetworkActionPanelPresenterWidget actionPanel, DetailTabLayout detailTabLayout) { tabPanel = new SimpleTabPanel(breadCrumbs, actionPanel, detailTabLayout); initWidget(getTabPanel()); <START> actionPanel.hideButton(actionPanel.getNewButtonDefinition()); <END> actionPanel.hideButton(actionPanel.getImportButtonDefinition()); }</code><technical_language>actionPanel.hideButtons(actionPanel.getButtonsToHideOnDetails()) similar</technical_language>

Target:
public NetworkSubTabPanelView(OvirtBreadCrumbsPresenterWidget<NetworkView, NetworkListModel> breadCrumbs, NetworkActionPanelPresenterWidget actionPanel, DetailTabLayout detailTabLayout) { tabPanel = new SimpleTabPanel(breadCrumbs, actionPanel, detailTabLayout); initWidget(getTabPanel()); actionPanel.removeButton(actionPanel.getNewButtonDefinition()); actionPanel.removeButton(actionPanel.getImportButtonDefinition()); }
Source:
<code>private void checkInstanceInfo(String instanceName, String hostName, int port, String[] tags, String[] pools, int[] poolValues) { <START> checkInstanceInfo(instanceName, hostName, port, tags, pools, poolValues, NOT_SET_GRPC_PORT_VALUE); <END> }</code><technical_language>Remove static import suggestion checkInstanceInfo(instanceName, hostName, port, tags, pools, poolValues, Instance.NOT_SET_GRPC_PORT_VALUE);</technical_language>

Target:
private void checkInstanceInfo(String instanceName, String hostName, int port, String[] tags, String[] pools, int[] poolValues) { checkInstanceInfo(instanceName, hostName, port, tags, pools, poolValues, Instance.NOT_SET_GRPC_PORT_VALUE); }
Source:
<code>public void setUp() throws Exception { tenant = getRandomTenantId(); <START> findGuageMetricsUrl = "http://" + BASE_URI + "/" + tenant + "/metrics?type=guage"; <END> assumeCollectdIsPresent(); configureCollectd(); assertCollectdConfIsValid(); configurePTrans(); }</code><technical_language>Typo "guage" (is this of Travis failures?) Note other places in this file in other files typo</technical_language>

Target:
public void setUp() throws Exception { tenant = getRandomTenantId(); findGuageMetricsUrl = "http://" + BASE_URI + "/" + tenant + "/metrics?type=gauge"; assumeCollectdIsPresent(); configureCollectd(); assertCollectdConfIsValid(); configurePTrans(); }
Source:
<code><START> private ProteinSequence readGenbankProteinResource(final String resource) throws Exception { <END> ProteinSequence sequence = null; InputStream inputStream = null; try { inputStream = getClass().getResourceAsStream(resource); GenbankReader<ProteinSequence, AminoAcidCompound> genbankProtein = new GenbankReader<>( inputStream, new GenericGenbankHeaderParser<>(), new ProteinSequenceCreator(AminoAcidCompoundSet.getAminoAcidCompoundSet()) ); LinkedHashMap<String, ProteinSequence> proteinSequences = genbankProtein.process(); sequence = proteinSequences.values().iterator().next(); } finally { try { inputStream.close(); } catch (Exception e) { } } return sequence; }</code><technical_language>Declare specific exceptions</technical_language>

Target:
private ProteinSequence readGenbankProteinResource(final String resource) throws IOException, CompoundNotFoundException { InputStream inputStream = getClass().getResourceAsStream(resource); GenbankReader<ProteinSequence, AminoAcidCompound> genbankProtein = new GenbankReader<>( inputStream, new GenericGenbankHeaderParser<>(), new ProteinSequenceCreator(AminoAcidCompoundSet.getAminoAcidCompoundSet()) ); LinkedHashMap<String, ProteinSequence> proteinSequences = genbankProtein.process(); return proteinSequences.values().iterator().next(); }
Source:
<code>public void demonstrateRecovery() throws Exception { System.out.println("Entries at the start: " + entriesService.getAll()); recoveryManagerService.addXAResourceRecovery(new DummyXAResourceRecovery()); Thread.sleep(5000); <START> System.out.println("Entries at the end: " + entriesService.getAll()); <END> }</code><technical_language>I suggest checks count of entries if increases recovery happens</technical_language>

Target:
public void demonstrateRecovery() throws Exception { List<Entry> entriesBefore = entriesService.getAll(); System.out.println("Entries at the start: " + entriesBefore); recoveryManagerService.addXAResourceRecovery(new DummyXAResourceRecovery()); waitForRecovery(entriesBefore); System.out.println("Entries at the end: " + entriesService.getAll()); }
Source:
<code>private ForeignHost getPrimary(ImmutableCollection<ForeignHost> fhosts, int hostId) { ForeignHost fhost = null; for (ForeignHost f : fhosts) { if (f.isPrimary()) { fhost = f; break; } } if (fhost == null) { m_networkLog.warn("Attempted to deliver a message to foreign host with id" + hostId + " but there is no primary connection to the host."); <START> return null; <END> } return fhost; }</code><technical_language>"return null" is needed</technical_language>

Target:
private ForeignHost getPrimary(ImmutableCollection<ForeignHost> fhosts, int hostId) { ForeignHost fhost = null; for (ForeignHost f : fhosts) { if (f.isPrimary()) { fhost = f; break; } } if (fhost == null) { m_networkLog.warn("Attempted to deliver a message to host " + hostId + " but there is no primary connection to the host."); } return fhost; }
Source:
<code>public void storeSavePoints(OseeConnection connection, int importIdIndex) throws OseeCoreException { List<Object[]> data = new ArrayList<Object[]>(); for (SavePoint savePoint : savePoints.values()) { int status = 1; String comment = ""; if (savePoint.hasErrors()) { status = -1; StringBuilder builder = new StringBuilder(); for (Throwable ex : savePoint.getErrors()) { builder.append(Lib.exceptionToString(ex).replaceAll("\n", " ")); } if (builder.length() < IOseeDatabaseService.MAX_VARCHAR_LENGTH) { comment = builder.toString(); } else { <START> comment = builder.substring(0, 3999); <END> } } data.add(new Object[] {importIdIndex, savePoint.getName(), status, comment}); } getDatabaseService().runBatchUpdate(connection, INSERT_INTO_IMPORT_SAVE_POINT, data); }</code><technical_language>do want for 3999</technical_language>

Target:
public void storeSavePoints(OseeConnection connection, int importIdIndex) throws OseeCoreException { List<Object[]> data = new ArrayList<Object[]>(); for (SavePoint savePoint : savePoints.values()) { int status = 1; String comment = ""; if (savePoint.hasErrors()) { status = -1; StringBuilder builder = new StringBuilder(); for (Throwable ex : savePoint.getErrors()) { builder.append(Lib.exceptionToString(ex).replaceAll("\n", " ")); } if (builder.length() < MAX_VARCHAR_LENGTH) { comment = builder.toString(); } else { comment = builder.substring(0, MAX_VARCHAR_LENGTH); } } data.add(new Object[] {importIdIndex, savePoint.getName(), status, comment}); } getDatabaseService().runBatchUpdate(connection, INSERT_INTO_IMPORT_SAVE_POINT, data); }
Source:
<code>private void validate() { <START> assertThat(serializer, <END> Objects::nonNull, () -> new AxonConfigurationException( "The Serializer is a hard requirement and should be provided")); assertThat(routingKeyResolver, Objects::nonNull, () -> new AxonConfigurationException( "The RoutingKeyResolver is a hard requirement and should be provided")); }</code><technical_language>extract assertThat... separate methods: assertRoutingKeyResolver for example. If requirement is fulfilled, a message provided for AxonConfigurationException (I argue message for purposes: invoking build method validate method)</technical_language>

Target:
protected void validate() { assertNonNull(serializer, "The Serializer is a hard requirement and should be provided"); assertNonNull(routingKeyResolver, "The RoutingKeyResolver is a hard requirement and should be provided"); }
Source:
<code>public PaymentStateContext buildPaymentStateContext(final boolean isApiPayment, final TransactionType transactionType, final Account account, @Nullable final UUID attemptId, @Nullable final UUID paymentMethodId, @Nullable final UUID paymentId, @Nullable final UUID transactionId, @Nullable final String paymentExternalKey, final String paymentTransactionExternalKey, @Nullable final BigDecimal amount, @Nullable final Currency currency, final boolean shouldLockAccount, final OperationResult overridePluginOperationResult, final Iterable<PluginProperty> properties, final CallContext callContext, final InternalCallContext internalCallContext) throws PaymentApiException { final UUID effectivePaymentId = paymentId != null ? paymentId : retrievePaymentId(paymentExternalKey, paymentTransactionExternalKey, internalCallContext); <START> verifyPaymentMethodExistsForRefund(effectivePaymentId, transactionType, internalCallContext); <END> return new PaymentStateContext(isApiPayment, effectivePaymentId, transactionId, attemptId, paymentExternalKey, paymentTransactionExternalKey, transactionType, account, paymentMethodId, amount, currency, shouldLockAccount, overridePluginOperationResult, properties, internalCallContext, callContext); }</code><technical_language>do need this here? done payment system retrieves plugin name (in PaymentAutomatonDAOHelper and/or in ProcessorBase)</technical_language>

Target:
public PaymentStateContext buildPaymentStateContext(final boolean isApiPayment, final TransactionType transactionType, final Account account, @Nullable final UUID attemptId, @Nullable final UUID paymentMethodId, @Nullable final UUID paymentId, @Nullable final UUID transactionId, @Nullable final String paymentExternalKey, final String paymentTransactionExternalKey, @Nullable final BigDecimal amount, @Nullable final Currency currency, final boolean shouldLockAccount, final OperationResult overridePluginOperationResult, final Iterable<PluginProperty> properties, final CallContext callContext, final InternalCallContext internalCallContext) throws PaymentApiException { final UUID effectivePaymentId = paymentId != null ? paymentId : retrievePaymentId(paymentExternalKey, paymentTransactionExternalKey, internalCallContext); return new PaymentStateContext(isApiPayment, effectivePaymentId, transactionId, attemptId, paymentExternalKey, paymentTransactionExternalKey, transactionType, account, paymentMethodId, amount, currency, shouldLockAccount, overridePluginOperationResult, properties, internalCallContext, callContext); }
Source:
<code>default Publisher<MarshalledEntry<K, V>> publishEntries(IntSet segments, Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata) { <START> return null; <END> }</code><technical_language>right</technical_language>

Target:
default Publisher<MarshalledEntry<K, V>> publishEntries(IntSet segments, Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata) { return publishEntries(filter, fetchValue, fetchMetadata); }
Source:
<code>public Map<String, Object> getProperties() { <START> return properties; <END> }</code><technical_language>Is this needed? I I idea getProperties returns unmodifiable map, while getMutableProperies returns actual mutable map. Is a problem this</technical_language>

Target:
public Map<String, Object> getProperties() { return Collections.unmodifiableMap(properties); }
Source:
<code>public void testEmptyConfig() throws Exception { final AmazonEC2Cloud ec2Cloud = (AmazonEC2Cloud) Jenkins.get().getCloud("ec2-"); assertNotNull(ec2Cloud); <START> assertEquals(ec2Cloud.getTemplates().size(), 0); <END> }</code><technical_language>suggestion assertEquals(0, ec2Cloud.getTemplates().size()); assertions ordered assertEquals(expected, actual)</technical_language>

Target:
public void testEmptyConfig() throws Exception { final AmazonEC2Cloud ec2Cloud = (AmazonEC2Cloud) Jenkins.get().getCloud("ec2-"); assertNotNull(ec2Cloud); assertEquals(0, ec2Cloud.getTemplates().size()); }
Source:
<code>protected void createAndDispatchThreadSwitchedEvent(String tid) { IContainerDMContext parentContainer = fProcesses.createContainerContextFromThreadId(fCommandControl.getContext(), tid); IProcessDMContext processDmc = DMContexts.getAncestorOfType(parentContainer, IProcessDMContext.class); IThreadDMContext threadDmc = fProcesses.createThreadContext(processDmc, tid); IExecutionDMContext execDmc = fProcesses.createExecutionContext(parentContainer, threadDmc, tid); AbstractDMEvent<IExecutionDMContext> event = null; event = new ThreadSwitchedEvent(execDmc); <START> fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); <END> }</code><technical_language>need define create "event" separate lines, simply new ..Event disptatchEvent</technical_language>

Target:
protected void createAndDispatchThreadSwitchedEvent(String tid) { IContainerDMContext parentContainer = fProcesses.createContainerContextFromThreadId(fCommandControl.getContext(), tid); IProcessDMContext processDmc = DMContexts.getAncestorOfType(parentContainer, IProcessDMContext.class); IThreadDMContext threadDmc = fProcesses.createThreadContext(processDmc, tid); IExecutionDMContext execDmc = fProcesses.createExecutionContext(parentContainer, threadDmc, tid); fCommandControl.getSession().dispatchEvent(new ThreadSwitchedEvent(execDmc), fCommandControl.getProperties()); }
Source:
<code>private static byte[] compress(String data) { byte[] compressed = null; try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); GZIPOutputStream gzip = new GZIPOutputStream(bos);) { <START> gzip.write(data.getBytes(StandardCharsets.ISO_8859_1)); <END> gzip.close(); compressed = bos.toByteArray(); } catch (Exception ex) { System.out.println(ex.getLocalizedMessage()); } return compressed; }</code><technical_language>.. convert a byte array StandardCharsets.UTF_8</technical_language>

Target:
private static byte[] compress(String data) { byte[] compressed = null; try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); GZIPOutputStream gzip = new GZIPOutputStream(bos);) { gzip.write(data.getBytes(StandardCharsets.UTF_8)); gzip.close(); compressed = bos.toByteArray(); } catch (Exception ex) { System.out.println(ex.getLocalizedMessage()); } return compressed; }
Source:
<code>public void start() throws IOException, KeeperException { if (!running.compareAndSet(false, true)) { return; } LOG.trace("Starting assignment manager"); startAssignmentThread(); try (RegionScanner scanner = masterRegion.getScanner(new Scan().addFamily(HConstants.CATALOG_FAMILY))) { List<Cell> cells = new ArrayList<>(); boolean moreRows; do { moreRows = scanner.next(cells); if (cells.isEmpty()) { continue; } Result result = Result.create(cells); cells.clear(); RegionStateStore .visitMetaEntry((r, regionInfo, state, regionLocation, lastHost, openSeqNum) -> { RegionStateNode regionNode = regionStates.getOrCreateRegionStateNode(regionInfo); regionNode.lock(); try { regionNode.setState(state); regionNode.setLastHost(lastHost); regionNode.setRegionLocation(regionLocation); regionNode.setOpenSeqNum(openSeqNum); if (regionNode.getProcedure() != null) { regionNode.getProcedure().stateLoaded(this, regionNode); } if (RegionReplicaUtil.isDefaultReplica(regionInfo)) { setMetaAssigned(regionInfo, state == State.OPEN); } } finally { regionNode.unlock(); } if (regionInfo.isFirst()) { <START> try { <END> regionStateStore.mirrorMetaLocation(regionInfo, regionLocation, state); } catch (IOException e) { LOG.warn("Failed to mirror region location for to zk", regionNode.toShortString()); } } }, result); } while (moreRows); if (!regionStates.hasTableRegionStates(TableName.META_TABLE_NAME)) { regionStates.createRegionStateNode(RegionInfoBuilder.FIRST_META_REGIONINFO); } } }</code><technical_language>MasterRegistry put meta location in zk? If not, mirror zk if MasterRegistry</technical_language>

Target:
public void start() throws IOException, KeeperException { if (!running.compareAndSet(false, true)) { return; } LOG.trace("Starting assignment manager"); startAssignmentThread(); try (RegionScanner scanner = masterRegion.getScanner(new Scan().addFamily(HConstants.CATALOG_FAMILY))) { List<Cell> cells = new ArrayList<>(); boolean moreRows; do { moreRows = scanner.next(cells); if (cells.isEmpty()) { continue; } Result result = Result.create(cells); cells.clear(); RegionStateStore .visitMetaEntry((r, regionInfo, state, regionLocation, lastHost, openSeqNum) -> { RegionStateNode regionNode = regionStates.getOrCreateRegionStateNode(regionInfo); regionNode.setState(state); regionNode.setLastHost(lastHost); regionNode.setRegionLocation(regionLocation); regionNode.setOpenSeqNum(openSeqNum); if (regionNode.getProcedure() != null) { regionNode.getProcedure().stateLoaded(this, regionNode); } if (regionLocation != null) { regionStates.addRegionToServer(regionNode); } if (RegionReplicaUtil.isDefaultReplica(regionInfo)) { setMetaAssigned(regionInfo, state == State.OPEN); } if (regionInfo.isFirst()) { try { regionStateStore.mirrorMetaLocation(regionInfo, regionLocation, state); } catch (IOException e) { LOG.warn("Failed to mirror region location for to zk", regionNode.toShortString()); } } }, result); } while (moreRows); if (!regionStates.hasTableRegionStates(TableName.META_TABLE_NAME)) { regionStates.createRegionStateNode(RegionInfoBuilder.FIRST_META_REGIONINFO); } } }
Source:
<code><START> private boolean updatePostObject() { <END> boolean isFirstTimePublish = PostStatus.fromPost(mPost) == PostStatus.PUBLISHED && (mPost.isLocalDraft() || PostStatus.fromPost(mOriginalPost) == PostStatus.DRAFT); try { updatePostObject(false); } catch (IllegalEditorStateException e) { AppLog.e(T.EDITOR, "Impossible to save and publish the post, we weren't able to update it."); } return isFirstTimePublish; }</code><technical_language>Hey @0nko ! This version of updatePostObject is updatePostObject(boolean) one. * calculates returns a boolean internally * other version of updatePostObject return a of these, I suggest splitting this a boolean isFirstTimePublish() a void updatePostObject() for clearer functionality. Also, catches IllegalEditorStateException, allowing caller continue normally, a user notification. this point but, confirm this is intended behaviour here? other version of updatePostObject throw it. Thanks</technical_language>

Target:
private boolean updatePostObject() { try { updatePostObject(false); } catch (IllegalEditorStateException e) { AppLog.e(T.EDITOR, "Impossible to save and publish the post, we weren't able to update it."); return false; } return true; }
Source:
<code>protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); long t = event.getTimestamp().toNanos(); String phase = event.getContent().getFieldValue(String.class, ITraceEventConstants.PHASE); if (ss == null || !ACCEPTED.contains(phase)) { return; } String nameField = event.getContent().getFieldValue(String.class, <START> ITraceEventConstants.NAME); String idField = event.getContent().getFieldValue(String.class, ITraceEventConstants.ID); String catField = event.getContent().getFieldValue(String.class, ITraceEventConstants.CATEGORY); <END> if (Objects.equals(phase, TraceEventPhases.CONTEXT_START)) { int quark = ss.getQuarkAbsoluteAndAdd(catField, nameField, idField); ss.modifyAttribute(t, 1, quark); } if (Objects.equals(phase, TraceEventPhases.CONTEXT_END)) { int quark = ss.getQuarkAbsoluteAndAdd(catField, nameField, idField); ss.modifyAttribute(t, (Object) null, quark); } }</code><technical_language>order varargs in getQuarkAbsoluteAndAdd please</technical_language>

Target:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); long t = event.getTimestamp().toNanos(); String phase = event.getContent().getFieldValue(String.class, ITraceEventConstants.PHASE); if (ss == null || !ACCEPTED.contains(phase)) { return; } String catField = event.getContent().getFieldValue(String.class, ITraceEventConstants.CATEGORY); String nameField = event.getContent().getFieldValue(String.class, ITraceEventConstants.NAME); String idField = event.getContent().getFieldValue(String.class, ITraceEventConstants.ID); int quark = ss.getQuarkAbsoluteAndAdd(catField, nameField, idField); if (Objects.equals(phase, TraceEventPhases.CONTEXT_START)) { ss.modifyAttribute(t, 1, quark); } if (Objects.equals(phase, TraceEventPhases.CONTEXT_END)) { ss.modifyAttribute(t, (Object) null, quark); } }
Source:
<code><START> public List<ByteArrayInputStream> getAllGatewayPublishedAPIArtifacts(String label) throws APIManagementException { <END> List<ByteArrayInputStream> baip = new ArrayList<>(); try (Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement statement = connection.prepareStatement(SQLConstants.GET_ALL_API_ARTIFACT)) { statement.setString(1, label); statement.setString(2, APIConstants.GatewayArtifactSynchronizer.GATEWAY_INSTRUCTION_PUBLISH); ResultSet rs = statement.executeQuery(); while (rs.next()) { byte[] st = (byte[]) rs.getObject(1); ByteArrayInputStream byteArrayInputStream= new ByteArrayInputStream(st); baip.add(byteArrayInputStream); log.info("Retrieved an api from DB"); } return baip; } catch (SQLException e) { handleException("Failed to get artifacts " , e); } return baip; }</code><technical_language>Removed in latest Version</technical_language>

Target:
public List<ByteArrayInputStream> getAllGatewayPublishedAPIArtifacts(String label) throws APIManagementException { List<ByteArrayInputStream> baip = new ArrayList<>(); try (Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement statement = connection.prepareStatement(SQLConstants.GET_ALL_API_ARTIFACT)) { statement.setString(1, label); statement.setString(2, APIConstants.GatewayArtifactSynchronizer.GATEWAY_INSTRUCTION_PUBLISH); ResultSet rs = statement.executeQuery(); while (rs.next()) { byte[] st = (byte[]) rs.getObject(1); ByteArrayInputStream byteArrayInputStream= new ByteArrayInputStream(st); baip.add(byteArrayInputStream); } return baip; } catch (SQLException e) { handleException("Failed to get artifacts " , e); } return baip; }
Source:
<code>public void testPushForMasterWithApprovals() throws GitAPIException, IOException, RestApiException { PushOneCommit.Result r = pushTo("refs/for/master/%l=Code-Review"); r.assertOkStatus(); ChangeInfo ci = get(r.getChangeId()); LabelInfo cr = ci.labels.get("Code-Review"); assertEquals(1, cr.all.size()); assertEquals("Administrator", cr.all.get(0).name); assertEquals(1, cr.all.get(0).value.intValue()); <START> PushOneCommit push = pushFactory.create(db, admin.getIdent(), PushOneCommit.SUBJECT, "b.txt", "anotherContent", r.getChangeId()); <END> r = pushTo("refs/for/master/%l=Code-Review+2"); ci = get(r.getChangeId()); cr = ci.labels.get("Code-Review"); assertEquals(1, cr.all.size()); assertEquals("Administrator", cr.all.get(0).name); assertEquals(2, cr.all.get(0).value.intValue()); }</code><technical_language>push is more</technical_language>

Target:
public void testPushForMasterWithApprovals() throws GitAPIException, IOException, RestApiException { PushOneCommit.Result r = pushTo("refs/for/master/%l=Code-Review"); r.assertOkStatus(); ChangeInfo ci = get(r.getChangeId()); LabelInfo cr = ci.labels.get("Code-Review"); assertEquals(1, cr.all.size()); assertEquals("Administrator", cr.all.get(0).name); assertEquals(1, cr.all.get(0).value.intValue()); r = pushTo("refs/for/master/%l=Code-Review+2"); ci = get(r.getChangeId()); cr = ci.labels.get("Code-Review"); assertEquals(1, cr.all.size()); assertEquals("Administrator", cr.all.get(0).name); assertEquals(2, cr.all.get(0).value.intValue()); }
Source:
<code>public void checkPool() throws Exception { AbstractPool pool = getPool(); assertEquals(pool.getManagedConnectionPools().size(), 0); SimpleConnection[] simpleConnections = fillPoolToSize(5); <START> String[] mcHashes = new String[5]; <END> for (int i = 0; i < 5; i++) { SimpleConnection sc = simpleConnections[i]; SimpleConnectionImpl sci = (SimpleConnectionImpl) sc; mcHashes[i] = sci.getManagedConnection().toString(); } assertEquals(pool.getManagedConnectionPools().size(), 1); PoolStatistics ps = pool.getStatistics(); checkStatistics(ps, 5, 0, 5); ManagedConnectionPool mcp = pool.getManagedConnectionPools().values().iterator().next(); callRemoveIdleConnections(mcp); checkStatistics(ps, 5, 0, 2, 3); callRemoveIdleConnections(mcp); checkStatistics(ps, 5, 0, 2, 3); simpleConnections = fillPoolToSize(5); String[] mcHashesAfterIdleConnectionCleanup = new String[5]; for (int i = 0; i < 5; i++) { SimpleConnection sc = simpleConnections[i]; SimpleConnectionImpl sci = (SimpleConnectionImpl) sc; mcHashesAfterIdleConnectionCleanup[i] = sci.getManagedConnection().toString(); } assertEquals(mcHashes[3], mcHashesAfterIdleConnectionCleanup[0]); assertEquals(mcHashes[4], mcHashesAfterIdleConnectionCleanup[1]); }</code><technical_language>toString's - hashes</technical_language>

Target:
public void checkPool() throws Exception { AbstractPool pool = getPool(); assertEquals(pool.getManagedConnectionPools().size(), 0); String[] mcsIds = fillPoolToSize(5);; assertEquals(pool.getManagedConnectionPools().size(), 1); PoolStatistics ps = pool.getStatistics(); checkStatistics(ps, 5, 0, 5); ManagedConnectionPool mcp = pool.getManagedConnectionPools().values().iterator().next(); callRemoveIdleConnections(mcp); checkStatistics(ps, 5, 0, 2, 3); callRemoveIdleConnections(mcp); checkStatistics(ps, 5, 0, 2, 3); String[] mcsIdsAfterIdleConnectionCleanup = fillPoolToSize(5);; assertEquals(mcsIds[3], mcsIdsAfterIdleConnectionCleanup[0]); assertEquals(mcsIds[4], mcsIdsAfterIdleConnectionCleanup[1]); assertEquals("SimpleManagedConnection #5", mcsIdsAfterIdleConnectionCleanup[2]); assertEquals("SimpleManagedConnection #6", mcsIdsAfterIdleConnectionCleanup[3]); assertEquals("SimpleManagedConnection #7", mcsIdsAfterIdleConnectionCleanup[4]); }
Source:
<code>public void setupMocks() { MockitoAnnotations.initMocks(this); <START> doReturn(macPoolManagerStrategy).when(vmInterfaceManager).getMacPoolManager(Mockito.any(Guid.class)); <END> doReturn(vmNetworkStatisticsDAO).when(vmInterfaceManager).getVmNetworkStatisticsDao(); doReturn(vmNetworkInterfaceDAO).when(vmInterfaceManager).getVmNetworkInterfaceDao(); doReturn(vmNicDao).when(vmInterfaceManager).getVmNicDao(); doReturn(vmDAO).when(vmInterfaceManager).getVmDAO(); doNothing().when(vmInterfaceManager).auditLogMacInUseUnplug(any(VmNic.class)); doNothing().when(vmInterfaceManager).removeFromExternalNetworks(anyList()); doNothing().when(vmInterfaceManager).log(any(AuditLogableBase.class), any(AuditLogType.class)); }</code><technical_language>Mockito.any is imported statically "any" save Mockito import</technical_language>

Target:
public void setupMocks() { MockitoAnnotations.initMocks(this); doReturn(vmNetworkStatisticsDAO).when(vmInterfaceManager).getVmNetworkStatisticsDao(); doReturn(vmNetworkInterfaceDAO).when(vmInterfaceManager).getVmNetworkInterfaceDao(); doReturn(vmNicDao).when(vmInterfaceManager).getVmNicDao(); doReturn(vmDAO).when(vmInterfaceManager).getVmDAO(); doNothing().when(vmInterfaceManager).auditLogMacInUseUnplug(any(VmNic.class)); doNothing().when(vmInterfaceManager).removeFromExternalNetworks(anyList()); doNothing().when(vmInterfaceManager).log(any(AuditLogableBase.class), any(AuditLogType.class)); vmInterfaceManager.setMacPool(macPoolManagerStrategy); }
Source:
<code>public AlleleFractionSegmenter(final int initialNumStates, final AllelicCountCollection acc, final AllelicPanelOfNormals allelicPoN) { super(initialNumStates, acc.getCounts().stream().map(AllelicCount::getInterval).collect(Collectors.toList()), acc.getCounts(), initialMinorFractions(initialNumStates)); this.allelicPoN = Utils.nonNull(allelicPoN); biasParameters = new AlleleFractionGlobalParameters(INITIAL_MEAN_ALLELIC_BIAS, INITIAL_ALLELIC_BIAS_VARIANCE, INITIAL_OUTLIER_PROBABILITY); <START> <END> }</code><technical_language>White space</technical_language>

Target:
public AlleleFractionSegmenter(final int initialNumStates, final AllelicCountCollection acc, final AllelicPanelOfNormals allelicPoN) { super(acc.getCounts().stream().map(AllelicCount::getInterval).collect(Collectors.toList()), acc.getCounts(), NEUTRAL_MINOR_ALLELE_FRACTION, initialNonConstantMinorFractions(initialNumStates - 1)); this.allelicPoN = Utils.nonNull(allelicPoN); globalParameters = new AlleleFractionGlobalParameters(INITIAL_MEAN_ALLELIC_BIAS, INITIAL_ALLELIC_BIAS_VARIANCE, INITIAL_OUTLIER_PROBABILITY); }
Source:
<code>public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { String groupKey = this.target.name(); String commandKey = method.getName(); HystrixCommand.Setter setter = HystrixCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); HystrixCommand<Object> hystrixCommand = new HystrixCommand<Object>(setter) { @Override protected Object run() throws Exception { try { return HystrixInvocationHandler.this.dispatch.get(method).invoke(args); } catch (Exception e) { throw e; } catch (Throwable t) { throw (Error)t; } } }; if (HystrixCommand.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand; } else if (Observable.class.isAssignableFrom(method.getReturnType())) { <START> return hystrixCommand.toObservable(); <END> } return hystrixCommand.execute(); }</code><technical_language>Good idea</technical_language>

Target:
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { String groupKey = this.target.name(); String commandKey = method.getName(); HystrixCommand.Setter setter = HystrixCommand.Setter .withGroupKey(HystrixCommandGroupKey.Factory.asKey(groupKey)) .andCommandKey(HystrixCommandKey.Factory.asKey(commandKey)); HystrixCommand<Object> hystrixCommand = new HystrixCommand<Object>(setter) { @Override protected Object run() throws Exception { try { return HystrixInvocationHandler.this.dispatch.get(method).invoke(args); } catch (Exception e) { throw e; } catch (Throwable t) { throw (Error)t; } } }; if (HystrixCommand.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand; } else if (Observable.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand.toObservable(); } else if (Single.class.isAssignableFrom(method.getReturnType())) { return hystrixCommand.toObservable().toSingle(); } return hystrixCommand.execute(); }
Source:
<code><START> public void setPushShuffleListener(final PushShuffleListener pushShuffleListener) { <END> this.pushShuffleListener = pushShuffleListener; }</code><technical_language>add synchronized keyword other methods of this class</technical_language>

Target:
public synchronized void setPushShuffleListener(final PushShuffleListener pushShuffleListener) { this.pushShuffleListener = pushShuffleListener; }
Source:
<code>public BranchConfigurationDialog(Shell shell, String branchName, Repository repository) { super(shell); myBranchName = branchName; myRepository = repository; myConfig = myRepository.getConfig(); setShellStyle(getShellStyle() | SWT.SHELL_TRIM); <START> myTitle = "Branch Configuration"; END> setHelpAvailable(false); }</code><technical_language>externalize string</technical_language>

Target:
public BranchConfigurationDialog(Shell shell, String branchName, Repository repository) { super(shell); myBranchName = branchName; myRepository = repository; myConfig = myRepository.getConfig(); setShellStyle(getShellStyle() | SWT.SHELL_TRIM); myTitle = UIText.BranchConfigurationDialog_BranchConfiguration; setHelpAvailable(false); }
Source:
<code>private static GeneratedHttpRequest stripExpectHeaderIfContentZero(GeneratedHttpRequest request) { boolean isBodyEmpty = false; if (request.getPayload() != null) { Long length = request.getPayload().getContentMetadata().getContentLength(); if (length != null && length == 0) { <START> isBodyEmpty = true; <END> } } else { isBodyEmpty = true; } if (isBodyEmpty) { request = request.toBuilder().removeHeader("Expect").build(); } return request; }</code><technical_language>This a bit cleaner: java boolean isBodyEmpty = true; if (request.getPayload() != null) { Long length = request.getPayload().getContentMetadata().getContentLength(); isBodyEmpty = (length == null || length == 0); }</technical_language>

Target:
private static GeneratedHttpRequest stripExpectHeaderIfContentZero(GeneratedHttpRequest request) { boolean isBodyEmpty = true; if (request.getPayload() != null) { Long length = request.getPayload().getContentMetadata().getContentLength(); isBodyEmpty = length != null && length == 0; } if (isBodyEmpty) { request = request.toBuilder().removeHeader("Expect").build(); } return request; }
Source:
<code>public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { onBackPressed(); return true; } else if (item.getItemId() == R.id.remove_person) { confirmRemovePerson(); return true; } else if (item.getItemId() == R.id.invite) { FragmentManager fragmentManager = getFragmentManager(); Fragment peopleInviteFragment = fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); if (peopleInviteFragment == null) { Blog blog = WordPress.getCurrentBlog(); String dotComBlogId = blog.getDotComBlogId(); <START> if (dotComBlogId != null && !dotComBlogId.isEmpty()) { <END> peopleInviteFragment = PeopleInviteFragment.newInstance(dotComBlogId); } else { AppLog.e(T.PEOPLE, "getDotComBlogId() returned null or empty string!"); ToastUtils.showToast(this, R.string.error_generic).show(); } } if (peopleInviteFragment != null && !peopleInviteFragment.isAdded()) { FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, peopleInviteFragment, KEY_PEOPLE_INVITE_FRAGMENT); fragmentTransaction.addToBackStack(null); fragmentTransaction.commit(); } } else if (item.getItemId() == R.id.send_invitation) { FragmentManager fragmentManager = getFragmentManager(); Fragment peopleInviteFragment = fragmentManager.findFragmentByTag(KEY_PEOPLE_INVITE_FRAGMENT); if (peopleInviteFragment != null) { ((InvitationSender) peopleInviteFragment).send(); } } return super.onOptionsItemSelected(item); }</code><technical_language>if(!TextUtils.isEmpty(dotComBlogId)) simplify a bit</technical_language>

Target:
public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { onBackPressed(); return true; } else if (item.getItemId() == R.id.remove_person) { confirmRemovePerson(); return true; } else if (item.getItemId() == R.id.invite) { FragmentManager fragmentManager = getFragmentManager(); Fragment peopleInviteFragment = fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); if (peopleInviteFragment == null) { Blog blog = WordPress.getCurrentBlog(); String dotComBlogId = blog.getDotComBlogId(); if (!TextUtils.isEmpty(dotComBlogId)) { peopleInviteFragment = PeopleInviteFragment.newInstance(dotComBlogId); } else { String blogUrl = blog.getUrl(); AppLog.e(T.PEOPLE, "getDotComBlogId() returned null or empty string! Blog URL: " + (blogUrl == null ? "null" : blogUrl)); ToastUtils.showToast(this, R.string.error_generic).show(); } } if (peopleInviteFragment != null && !peopleInviteFragment.isAdded()) { FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.fragment_container, peopleInviteFragment, KEY_PEOPLE_INVITE_FRAGMENT); fragmentTransaction.addToBackStack(null); fragmentTransaction.commit(); } } else if (item.getItemId() == R.id.send_invitation) { FragmentManager fragmentManager = getFragmentManager(); Fragment peopleInviteFragment = fragmentManager.findFragmentByTag(KEY_PEOPLE_INVITE_FRAGMENT); if (peopleInviteFragment != null) { ((InvitationSender) peopleInviteFragment).send(); } } return super.onOptionsItemSelected(item); }
Source:
<code>public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { if (stream == null || stream.getSource() == null) { throw new DatastreamValidationException("Failed to get source from datastream."); } <START> stream.getMetadata().putAll(_config); <END> }</code><technical_language>add a check if metadata is present (stream.hasMetadata()), if create metadata</technical_language>

Target:
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { if (stream == null || stream.getSource() == null) { throw new DatastreamValidationException("Failed to get source from datastream."); } if (!stream.hasMetadata()) { stream.getMetadata().putAll(_config); } }
Source:
<code>public static List<LogEntry> toSlowLogPayloads( final HBaseProtos.LogEntry logEntry) { try { final String logClassName = logEntry.getLogClassName(); Class<?> logClass = Class.forName(logClassName).asSubclass(Message.class); Method method = logClass.getMethod("parseFrom", ByteString.class); <START> if (logClassName.contains("SlowLogResponses")) { <END> AdminProtos.SlowLogResponses slowLogResponses = (AdminProtos.SlowLogResponses) method .invoke(null, logEntry.getLogInitializerMessage()); return slowLogResponses.getSlowLogPayloadsList().stream() .map(ProtobufUtil::getSlowLogRecord).collect(Collectors.toList()); } } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Error while retrieving response from server"); } throw new RuntimeException("Invalid response from server"); }</code><technical_language>This is fine leaves client if empty list is SlowLogResponses if returned valid protobuf else besides expected entry type. throw exception if expected type is encoded? catch future changes break compat</technical_language>

Target:
public static List<LogEntry> toSlowLogPayloads( final HBaseProtos.LogEntry logEntry) { try { final String logClassName = logEntry.getLogClassName(); Class<?> logClass = Class.forName(logClassName).asSubclass(Message.class); Method method = logClass.getMethod("parseFrom", ByteString.class); if (logClassName.contains("SlowLogResponses")) { AdminProtos.SlowLogResponses slowLogResponses = (AdminProtos.SlowLogResponses) method .invoke(null, logEntry.getLogMessage()); return slowLogResponses.getSlowLogPayloadsList().stream() .map(ProtobufUtil::getSlowLogRecord).collect(Collectors.toList()); } } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Error while retrieving response from server"); } throw new RuntimeException("Invalid response from server"); }
Source:
<code>public DecoratedCache(AdvancedCache<K, V> delegate, ClassLoader classLoader) { <START> this(delegate, classLoader, null, null); <END> }</code><technical_language>null is interpreted a null Flag, a null Flag[], is causing some NPEs in test suite: <LINK_0></technical_language>

Target:
public DecoratedCache(AdvancedCache<K, V> delegate, ClassLoader classLoader) { this(delegate, classLoader, null); }
Source:
<code>static String encodeUriParts(final String uri) throws UnsupportedEncodingException { String[] uriParts = uri.split("/"); <START> for (int i = 3; i < uriParts.length; i++) { <END> uriParts[i] = URLEncoder.encode(uriParts[i], SFTP_URL_ENCODING); } return StringUtils.join(uriParts, "/"); }</code><technical_language>nice replace a magic number 3 a constant</technical_language>

Target:
static String encodeUriParts(final String uri) throws UnsupportedEncodingException { String[] uriParts = uri.split("/"); for (int i = FIRST_SUB_PATH_INDEX; i < uriParts.length; i++) { uriParts[i] = URLEncoder.encode(uriParts[i], SFTP_URL_ENCODING); } return StringUtils.join(uriParts, "/"); }
Source:
<code>public String getLocationPayload() { Location deviceLocation = locationService.getLastKnownLocation(); String locationString = null; if (deviceLocation != null) { double latitude = deviceLocation.getLatitude(); double longitude = deviceLocation.getLongitude(); if (latitude != 0 && longitude != 0) { <START> locationString = "{" + Constants.LocationInfo.LATITUDE + ":" + latitude + "," + Constants.LocationInfo.LONGITUDE + <END> ":" + longitude + "," + Constants.LocationInfo.TIME_STAMP + ":" + new Date().getTime() + "}"; } } return locationString; }</code><technical_language>JSONObject in building json string hand</technical_language>

Target:
public String getLocationPayload() { Location deviceLocation = locationService.getLastKnownLocation(); String locationString = null; if (deviceLocation != null) { double latitude = deviceLocation.getLatitude(); double longitude = deviceLocation.getLongitude(); if (latitude != 0 && longitude != 0) { JSONObject locationObject = new JSONObject(); try { locationObject.put(Constants.LocationInfo.LATITUDE, latitude); locationObject.put(Constants.LocationInfo.LONGITUDE, longitude); locationObject.put(Constants.LocationInfo.TIME_STAMP, new Date().getTime()); locationString = locationObject.toString(); } catch (JSONException e) { Log.e(TAG, "Error occured while creating a location payload for location event publishing", e); } } } return locationString; }
Source:
<code>public void insert(DbSession session, AnalysisPropertyDto analysisPropertyDto) { <START> checkArgument(analysisPropertyDto.getUuid() != null, "uuid cannot be null"); <END> checkArgument(analysisPropertyDto.getKey() != null, "key cannot be null"); checkArgument(analysisPropertyDto.getSnapshotUuid() != null, "snapshot uuid cannot be null"); checkArgument(analysisPropertyDto.getValue() != null, "value cannot be null"); String value = analysisPropertyDto.getValue(); long now = system2.now(); if (isEmpty(value)) { getMapper(session).insertAsEmpty(analysisPropertyDto, now); } else if (mustBeStoredInClob(value)) { getMapper(session).insertAsClob(analysisPropertyDto, now); } else { getMapper(session).insertAsText(analysisPropertyDto, now); } }</code><technical_language>simply Objects.requireNonNull</technical_language>

Target:
public void insert(DbSession session, AnalysisPropertyDto analysisPropertyDto) { requireNonNull(analysisPropertyDto.getUuid(), "uuid cannot be null"); requireNonNull(analysisPropertyDto.getKey(), "key cannot be null"); requireNonNull(analysisPropertyDto.getSnapshotUuid(), "snapshot uuid cannot be null"); requireNonNull(analysisPropertyDto.getValue(), "value cannot be null"); String value = analysisPropertyDto.getValue(); long now = system2.now(); if (isEmpty(value)) { getMapper(session).insertAsEmpty(analysisPropertyDto, now); } else if (mustBeStoredInClob(value)) { getMapper(session).insertAsClob(analysisPropertyDto, now); } else { getMapper(session).insertAsText(analysisPropertyDto, now); } }