auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testBlobIdNotValid() throws Exception { ifServerRespond = true; initialize("9"); future = router.deleteBlob("123", new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Exception is expected."); } catch (ExecutionException e) { <START> assertEquals("RouterErrorCode should be InvalidBlobId", RouterErrorCode.InvalidBlobId, <END> ((RouterException) e.getCause()).getErrorCode()); } future = router.deleteBlob("", new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Error is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be InvalidBlobId", RouterErrorCode.InvalidBlobId, ((RouterException) e.getCause()).getErrorCode()); } future = router.deleteBlob(null, new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Error is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be InvalidBlobId", RouterErrorCode.InvalidBlobId, ((RouterException) e.getCause()).getErrorCode()); } assertCloseCleanup(); }</code><technical_language>want verify exception is set in callback correctly future. (for tests)</technical_language>

Target:
public void testBlobIdNotValid() throws Exception { String[] input = {"123", "abcd", "", "/", null}; for (String s : input) { future = router.deleteBlob(s, new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Exception is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be InvalidBlobId", RouterErrorCode.InvalidBlobId, ((RouterException) e.getCause()).getErrorCode()); } } }
Source:
<code>public static <A, B> Ord<Either<A, B>> eitherOrd(final Ord<A> oa, final Ord<B> ob) { <START> return new Ord<Either<A, B>>(e1 -> e2 -> e1.isLeft() ? <END> e2.isLeft() ? oa.f.f(e1.left().value()).f(e2.left().value()) : Ordering.LT : e2.isLeft() ? Ordering.GT : ob.f.f(e1.right().value()).f(e2.right().value())); }</code><technical_language>Ord.ord starts beneficial type more complex</technical_language>

Target:
public static <A, B> Ord<Either<A, B>> eitherOrd(final Ord<A> oa, final Ord<B> ob) { return ord(e1 -> e2 -> e1.isLeft() ? e2.isLeft() ? oa.f.f(e1.left().value()).f(e2.left().value()) : Ordering.LT : e2.isLeft() ? Ordering.GT : ob.f.f(e1.right().value()).f(e2.right().value())); }
Source:
<code><START> public Mono<DocumentResultCollection<DetectLanguageResult>> detectLanguages(List<String> textInputs) { <END> return detectLanguagesWithResponse(textInputs, defaultCountryHint).flatMap(FluxUtil::toMono); }</code><technical_language>@JonathanGiles, guidance in Iterable Collection instead of List is more flexible</technical_language>

Target:
public Mono<DocumentResultCollection<DetectLanguageResult>> detectLanguages(List<String> textInputs) { try { return detectLanguagesWithResponse(textInputs, defaultCountryHint).flatMap(FluxUtil::toMono); } catch (RuntimeException ex) { return monoError(logger, ex); } }
Source:
<code>public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { SavedPage dummyPage = new SavedPage(callingFragment.getTitle(), null); String selection = SavedPage.PERSISTENCE_HELPER.getPrimaryKeySelection(dummyPage, SavedPage.PERSISTENCE_HELPER.SELECTION_KEYS); String[] selectionArgs = SavedPage.PERSISTENCE_HELPER.getPrimaryKeySelectionArgs(dummyPage); return new CursorLoader( <START> callingFragment.getActivity(), <END> Uri.parse(SavedPage.PERSISTENCE_HELPER.getBaseContentURI().toString()), null, selection, selectionArgs, null); }</code><technical_language>safer pass in Application context in constructor. if guaranteed Fragment added in this callback</technical_language>

Target:
public Loader<Cursor> onCreateLoader(int i, Bundle bundle) { SavedPage dummyPage = new SavedPage(callingFragment.getTitle(), null); String selection = SavedPage.PERSISTENCE_HELPER.getPrimaryKeySelection(dummyPage, SavedPage.PERSISTENCE_HELPER.SELECTION_KEYS); String[] selectionArgs = SavedPage.PERSISTENCE_HELPER.getPrimaryKeySelectionArgs(dummyPage); return new CursorLoader( context, Uri.parse(SavedPage.PERSISTENCE_HELPER.getBaseContentURI().toString()), null, selection, selectionArgs, null); }
Source:
<code>protected List<List<LongArrayList>> purgePLIEntries() { List<List<LongArrayList>> pliList = new ArrayList<>(); Iterator<HashMap<String, LongArrayList>> columnsIterator = columns.iterator(); while (columnsIterator.hasNext()) { List<LongArrayList> clusters = new ArrayList<>(); for (LongArrayList cluster : columnsIterator.next().values()) { if (cluster.size() < 2) { continue; } clusters.add(cluster); } <START> pliList.add(clusters); <END> columnsIterator.remove(); } return pliList; }</code><technical_language>this longer named pliList</technical_language>

Target:
protected List<List<LongArrayList>> purgePLIEntries() { List<List<LongArrayList>> rawPLIList = new ArrayList<>(); Iterator<HashMap<String, LongArrayList>> columnsIterator = columns.iterator(); while (columnsIterator.hasNext()) { List<LongArrayList> clusters = new ArrayList<>(); for (LongArrayList cluster : columnsIterator.next().values()) { if (cluster.size() < 2) { continue; } clusters.add(cluster); } rawPLIList.add(clusters); columnsIterator.remove(); } return rawPLIList; }
Source:
<code>public void testEnableRule() { SonarLintGlobalSettings settings = new SonarLintGlobalSettings(); settings.enableRule(RULE); <START> assertThat(settings.isRuleActive(RULE)).isEqualTo(true); <END> }</code><technical_language>isTrue()</technical_language>

Target:
public void testEnableRule() { SonarLintGlobalSettings settings = new SonarLintGlobalSettings(); settings.enableRule(RULE); assertThat(settings.isRuleExplicitlyDisabled(RULE)).isFalse(); }
Source:
<code>public void deleteRow(String component1) { SchemaApiTestTable.SchemaApiTestRow row = SchemaApiTestTable.SchemaApiTestRow.of(component1); byte[] rowBytes = row.persistToBytes(); <START> Set<Cell> cells = new HashSet<>(); <END> cells.add(Cell.create(rowBytes, PtBytes.toCachedBytes("c"))); cells.add(Cell.create(rowBytes, PtBytes.toCachedBytes("d"))); t.delete(tableRef, cells); }</code><technical_language>presize this set size</technical_language>

Target:
public void deleteRow(String component1) { SchemaApiTestTable.SchemaApiTestRow row = SchemaApiTestTable.SchemaApiTestRow.of(component1); byte[] rowBytes = row.persistToBytes(); Set<Cell> cells = Sets.newHashSetWithExpectedSize(2); cells.add(Cell.create(rowBytes, PtBytes.toCachedBytes("c"))); cells.add(Cell.create(rowBytes, PtBytes.toCachedBytes("d"))); t.delete(tableRef, cells); }
Source:
<code>public MapSqlParameterMapper<GlusterVolumeEntity> getBatchMapper() { <START> throw new RuntimeException("Unsupported operation"); <END> }</code><technical_language>please NotImplementedException()</technical_language>

Target:
public MapSqlParameterMapper<GlusterVolumeEntity> getBatchMapper() { throw new NotImplementedException("Unsupported operation"); }
Source:
<code>protected void removeItemFromArrayProperty(DocumentModel doc, Property property) { if (index != null) { Serializable[] value = (Serializable[]) property.getValue(); List<Serializable> list = new ArrayList<>(Arrays.asList(value)); list.remove(index.intValue()); <START> doc.setPropertyValue(xpath, list.toArray(new Serializable[0])); <END> } else { doc.setPropertyValue(xpath, null); } }</code><technical_language>check doc.setPropertyValue(xpath, list)? I level code conversion automatically expected type</technical_language>

Target:
protected void removeItemFromArrayProperty(DocumentModel doc, Property property) { if (index != null) { Serializable[] value = (Serializable[]) property.getValue(); List<Serializable> list = new ArrayList<>(Arrays.asList(value)); list.remove(index.intValue()); doc.setPropertyValue(xpath, (Serializable) list); } else { doc.setPropertyValue(xpath, null); } }
Source:
<code>public Void call() throws Exception { OzoneConfiguration ozoneConfiguration = createOzoneConfiguration(); OzoneConfigurationProvider.setConfiguration(ozoneConfiguration); <START> JooqConfigurationProvider.setConfiguration(sqlConfiguration); <END> injector = Guice.createInjector(new ReconControllerModule(), new ReconRestServletModule() { @Override protected void configureServlets() { rest("/api/*") .packages("org.apache.hadoop.ozone.recon.api"); } }); ReconGuiceServletContextListener.setInjector(injector); LOG.info("Initializing Recon server..."); try { StatsSchemaDefinition statsSchemaDefinition = injector.getInstance( StatsSchemaDefinition.class); statsSchemaDefinition.initializeSchema(); UtilizationSchemaDefinition utilizationSchemaDefinition = injector.getInstance(UtilizationSchemaDefinition.class); utilizationSchemaDefinition.initializeSchema(); ReconInternalSchemaDefinition reconInternalSchemaDefinition = injector.getInstance(ReconInternalSchemaDefinition.class); reconInternalSchemaDefinition.initializeSchema(); LOG.info("Recon server initialized successfully!"); } catch (Exception e) { LOG.error("Error during initializing Recon server.", e); } httpServer = injector.getInstance(ReconHttpServer.class); LOG.info("Starting Recon server"); httpServer.start(); scheduleReconTasks(); Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { stop(); } catch (Exception e) { LOG.error("Error during stop Recon server", e); } })); return null; }</code><technical_language>This is anti-pattern leads un-clean code. reason do this for OzoneConfiguration is of mixing DI code DI. member is provided injector, JooqConfiguration provided explicitly a module ReconController created Sql test classes</technical_language>

Target:
public Void call() throws Exception { OzoneConfiguration ozoneConfiguration = createOzoneConfiguration(); OzoneConfigurationProvider.setConfiguration(ozoneConfiguration); injector = Guice.createInjector(new ReconControllerModule(), new ReconRestServletModule() { @Override protected void configureServlets() { rest("/api/*") .packages("org.apache.hadoop.ozone.recon.api"); } }); ReconGuiceServletContextListener.setInjector(injector); LOG.info("Initializing Recon server..."); try { StatsSchemaDefinition statsSchemaDefinition = injector.getInstance( StatsSchemaDefinition.class); statsSchemaDefinition.initializeSchema(); UtilizationSchemaDefinition utilizationSchemaDefinition = injector.getInstance(UtilizationSchemaDefinition.class); utilizationSchemaDefinition.initializeSchema(); ReconInternalSchemaDefinition reconInternalSchemaDefinition = injector.getInstance(ReconInternalSchemaDefinition.class); reconInternalSchemaDefinition.initializeSchema(); LOG.info("Recon server initialized successfully!"); } catch (Exception e) { LOG.error("Error during initializing Recon server.", e); } httpServer = injector.getInstance(ReconHttpServer.class); LOG.info("Starting Recon server"); httpServer.start(); scheduleReconTasks(); Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { stop(); } catch (Exception e) { LOG.error("Error during stop Recon server", e); } })); return null; }
Source:
<code>PrimitiveLongArrayQueue( int capacity ) { if ( capacity == 0 || (capacity & (capacity - 1)) != 0 ) { <START> throw new IllegalArgumentException( "Capacity should be power of 2." ); <END> } initValues( capacity ); }</code><technical_language>add actual error message</technical_language>

Target:
PrimitiveLongArrayQueue( int capacity ) { if ( capacity == 0 || (capacity & (capacity - 1)) != 0 ) { throw new IllegalArgumentException( "Capacity should be power of 2. Requested capacity: " + capacity ); } initValues( capacity ); }
Source:
<code><START> public void writeTo(OutputStream out) throws IOException { <END> out.write(getBytesUnsafe(), offset, length); }</code><technical_language>do want eventually a writeTo(ByteBuffer)</technical_language>

Target:
public void writeTo(OutputStream out) throws IOException { if (value.hasArray()) { out.write(value.array(), value.arrayOffset() + offset, length); } else { out.write(getBytesUnsafe(), 0, length); } }
Source:
<code>public Response getStop (@PathParam("stopId") String stopIdString) { FeedScopedId stopId = GtfsLibrary.convertIdFromString(stopIdString); <START> ApiStop stop = StopMapper.mapStop(index.stopForId.get(stopId)); <END> if (stop != null) { return Response.status(Status.OK).entity(stop).build(); } else { return Response.status(Status.NOT_FOUND).entity(MSG_404).build(); } }</code><technical_language>This returning a "domain" Stop before, I StopAdapter play here. Or, I miss something? is a lot of types in play for stop this API, if "domain" stop is retuned need API type for dev-1.x Stop, too. I discuss this @abyrd community - is clean up</technical_language>

Target:
public Response getStop (@PathParam("stopId") String stopIdString) { FeedScopedId stopId = GtfsLibrary.convertIdFromString(stopIdString); Stop stop = getRoutingService().getStopForId().get(stopId); if (stop != null) { return Response.status(Status.OK).entity(stop).build(); } else { return Response.status(Status.NOT_FOUND).entity(MSG_404).build(); } }
Source:
<code>public List<Diagnosis> getDiagnoses(Patient patient, Date fromDate) { EncounterSearchCriteria encounterSearchCriteria = new EncounterSearchCriteriaBuilder().setPatient(patient) <START> .setFromDate(fromDate).createEncounterSearchCriteria(); <END> List<Encounter> encounters = Context.getEncounterService().getEncounters(encounterSearchCriteria); List<Diagnosis> diagnoses = new ArrayList<>(); for (Encounter encounter : encounters) { diagnoses.addAll(encounter.getDiagnoses()); } return diagnoses; }</code><technical_language>a HibernateDiagnosisDAO? service layer delegate data access layer fetches filtered data database instead of fetch filter in application memory</technical_language>

Target:
public List<Diagnosis> getDiagnoses(Patient patient, Date fromDate) { return diagnosisDAO.getActiveDiagnoses(patient, fromDate); }
Source:
<code><START> public void testCallService_attributes_all_OK() throws InstallatorException, NodeExecutionException, IOException, KeyManagementException, NoSuchAlgorithmException { <END> when(httpsClient.doHttpsPost(Mockito.anyString(), Mockito.anyString(),(Map<String,String>)Mockito.anyObject())).thenReturn(200); when(httpsClient.doHttpsGet(Mockito.anyString(), Mockito.anyString(),(Map<String,String>)Mockito.anyObject())).thenReturn(200); InputStream in = IOUtils.toInputStream(GET_NODES, "UTF-8"); when(entity.getContent()).thenReturn(in); puppetInstallator.callService(productInstance, host, attributeList, "install", "token"); }</code><technical_language>gt 120</technical_language>

Target:
public void testCallService_attributes_all_OK() throws InstallatorException, NodeExecutionException, IOException, KeyManagementException, NoSuchAlgorithmException { when( httpsClient.doHttps(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), (Map<String, String>) Mockito.anyObject())).thenReturn(200); InputStream in = IOUtils.toInputStream(GET_NODES, "UTF-8"); when(entity.getContent()).thenReturn(in); puppetInstallator.callService(productInstance, host, attributeList, "install", "token"); }
Source:
<code>public Object visit(ASTUserClass node, Object data) { if (Helper.isTestMethodOrClass(node)) { return data; } <START> collectBenignVariables(node); <END> List<ASTMethodCallExpression> methodCalls = node.findDescendantsOfType(ASTMethodCallExpression.class); for (ASTMethodCallExpression methodCall : methodCalls) { if (Helper.isMethodName(methodCall, CONFIGURATION, DISABLE_CRUD)) { addViolation(data, methodCall); } if (Helper.isMethodName(methodCall, SYSTEM, DEBUG)) { validateParameters(methodCall, data); } } return data; }</code><technical_language>careful here. A single rule instance analyze multiple files. means whiteListedVariables accumulate names previous files produce false negatives. clear set for class, move a local variable</technical_language>

Target:
public Object visit(ASTUserClass node, Object data) { if (Helper.isTestMethodOrClass(node)) { return data; } collectBenignVariables(node); List<ASTMethodCallExpression> methodCalls = node.findDescendantsOfType(ASTMethodCallExpression.class); for (ASTMethodCallExpression methodCall : methodCalls) { if (Helper.isMethodName(methodCall, CONFIGURATION, DISABLE_CRUD)) { addViolation(data, methodCall); } if (Helper.isMethodName(methodCall, SYSTEM, DEBUG)) { validateParameters(methodCall, data); } } whiteListedVariables.clear(); return data; }
Source:
<code>Page() throws IOException { Document hostDoc = HtmlDomUtil.clone(template); css = injectCssFile(hostDoc, "gerrit_sitecss", site.site_css); header = injectXmlFile(hostDoc, "gerrit_header", site.site_header); footer = injectXmlFile(hostDoc, "gerrit_footer", site.site_footer); final HostPageData pageData = new HostPageData(); <START> pageData.plugnisUrls =getPluginUrls(); <END> pageData.config = config; final StringWriter w = new StringWriter(); w.write("var " + HPD_ID + "="); json(pageData, w); w.write(";"); final Element data = HtmlDomUtil.find(hostDoc, HPD_ID); asScript(data); data.appendChild(hostDoc.createTextNode(w.toString())); data.appendChild(hostDoc.createComment(HPD_ID)); permutations = new HashMap<Permutation, Content>(); for (Permutation p : selector.getPermutations()) { final Document d = HtmlDomUtil.clone(hostDoc); Element nocache = HtmlDomUtil.find(d, "gerrit_module"); nocache.getParentNode().removeChild(nocache); p.inject(d); permutations.put(p, new Content(d)); } Element nocache = HtmlDomUtil.find(hostDoc, "gerrit_module"); asScript(nocache); nocache.setAttribute("src", noCacheName); permutations.put(null, new Content(hostDoc)); }</code><technical_language>s/plugnisUrls/pluginUrls - missing space =</technical_language>

Target:
Page() throws IOException { Document hostDoc = HtmlDomUtil.clone(template); css = injectCssFile(hostDoc, "gerrit_sitecss", site.site_css); header = injectXmlFile(hostDoc, "gerrit_header", site.site_header); footer = injectXmlFile(hostDoc, "gerrit_footer", site.site_footer); final HostPageData pageData = new HostPageData(); pageData.pluginUrls = getPluginUrls(); pageData.config = config; final StringWriter w = new StringWriter(); w.write("var " + HPD_ID + "="); json(pageData, w); w.write(";"); final Element data = HtmlDomUtil.find(hostDoc, HPD_ID); asScript(data); data.appendChild(hostDoc.createTextNode(w.toString())); data.appendChild(hostDoc.createComment(HPD_ID)); permutations = new HashMap<Permutation, Content>(); for (Permutation p : selector.getPermutations()) { final Document d = HtmlDomUtil.clone(hostDoc); Element nocache = HtmlDomUtil.find(d, "gerrit_module"); nocache.getParentNode().removeChild(nocache); p.inject(d); permutations.put(p, new Content(d)); } Element nocache = HtmlDomUtil.find(hostDoc, "gerrit_module"); asScript(nocache); nocache.setAttribute("src", noCacheName); permutations.put(null, new Content(hostDoc)); }
Source:
<code><START> private WriteRequestValues getValues(String pType, Object pCurrentValue, JolokiaWriteRequest pRequest) <END> throws AttributeNotFoundException, IllegalAccessException, InvocationTargetException { List<String> pathParts = pRequest.getPathParts(); Object newValue = pRequest.getValue(); if (pathParts != null && pathParts.size() > 0) { if (pCurrentValue == null ) { throw new IllegalArgumentException( "Cannot set value with path when parent object is not set"); } return context.getMandatoryService(Serializer.class).setInnerValue(pCurrentValue, newValue, pathParts); } else { return new WriteRequestValues(context.getMandatoryService(Serializer.class).deserialize(pType, newValue), pCurrentValue); } }</code><technical_language>I point avoid untyped Object[] array return value. However, I WriteRequestValue a class avoid in Serializer interface</technical_language>

Target:
private Object[] getValues(String pType, Object pCurrentValue, JolokiaWriteRequest pRequest) throws AttributeNotFoundException, IllegalAccessException, InvocationTargetException { List<String> pathParts = pRequest.getPathParts(); Object newValue = pRequest.getValue(); if (pathParts != null && pathParts.size() > 0) { if (pCurrentValue == null ) { throw new IllegalArgumentException( "Cannot set value with path when parent object is not set"); } return new Object[] { pCurrentValue, context.getMandatoryService(Serializer.class).setInnerValue(pCurrentValue, newValue, pathParts) }; } else { return new Object[] { context.getMandatoryService(Serializer.class).deserialize(pType, newValue), pCurrentValue }; } }
Source:
<code>public IStatus connect() { if (isConnected() && listener.secureStoreException == null) { return Status.OK_STATUS; } IStatus status = Status.OK_STATUS; listener.secureStoreException = null; try { <START> IConnection connection = <END> isNewConnection() ? createConnection(connectionFactory, connectionAuthenticationProvider) : this.selectedConnection; if(connection != null) { addConnectionListener(connection); if (connection.connect()) { connection.enablePromptCredentials(true); this.connection = connection; wizardModel.setConnection(connection); ConnectionsRegistrySingleton.getInstance().setRecent(connection); connection.notifyUsage(); } else { String message = NLS.bind("Unable to connect to {0}", connection.getHost()); OpenShiftCommonUIActivator.log(message, null); status = StatusFactory.errorStatus(OpenShiftCommonUIActivator.PLUGIN_ID, message); } } } catch (Exception e) { status = StatusFactory.errorStatus(OpenShiftCommonUIActivator.PLUGIN_ID, e.getMessage()); OpenShiftCommonUIActivator.log(e); } finally { removeConnectionListener(connection); } update(selectedConnection, connectionFactory, host, useDefaultHost, Status.OK_STATUS, status); return status; }</code><technical_language>this change breaks authentication. If existing connection stored password, authenticate. Reverting changes works</technical_language>

Target:
public IStatus connect() { if (isConnected() && listener.secureStoreException == null) { return Status.OK_STATUS; } IStatus status = Status.OK_STATUS; listener.secureStoreException = null; try { IConnection connection = createConnection(connectionFactory, connectionAuthenticationProvider); if(connection != null) { addConnectionListener(connection); if (connection.connect()) { connection.enablePromptCredentials(true); this.connection = connection; wizardModel.setConnection(connection); ConnectionsRegistrySingleton.getInstance().setRecent(connection); connection.notifyUsage(); } else { String message = NLS.bind("Unable to connect to {0}", connection.getHost()); OpenShiftCommonUIActivator.log(message, null); status = StatusFactory.errorStatus(OpenShiftCommonUIActivator.PLUGIN_ID, message); } } } catch (Exception e) { status = StatusFactory.errorStatus(OpenShiftCommonUIActivator.PLUGIN_ID, e.getMessage()); OpenShiftCommonUIActivator.log(e); } finally { removeConnectionListener(connection); } update(selectedConnection, connectionFactory, host, useDefaultHost, Status.OK_STATUS, status); return status; }
Source:
<code>public Response createStaffMemberAddress(@PathParam("STAFFMEMBERID") Long staffMemberId, fi.pyramus.rest.model.Address address) { if (address == null) { return Response.status(Status.BAD_REQUEST).build(); } StaffMember staffMember = userController.findStaffMemberById(staffMemberId); if (staffMember == null) { return Response.status(Status.NOT_FOUND).build(); } if (staffMember.getArchived()) { return Response.status(Status.NOT_FOUND).build(); } <START> if (!restSecurity.hasPermission(new String[] { UserPermissions.LIST_STAFFMEMBERADDRESES }, staffMember ) && !restSecurity.hasPermission(new String[] { PersonPermissions.PERSON_OWNER }, staffMember.getPerson() )) { <END> return Response.status(Status.FORBIDDEN).build(); } Long contactTypeId = address.getContactTypeId(); Boolean defaultAddress = address.getDefaultAddress(); String name = address.getName(); String streetAddress = address.getStreetAddress(); String postalCode = address.getPostalCode(); String country = address.getCountry(); String city = address.getCity(); if ((contactTypeId == null) || (defaultAddress == null)) { return Response.status(Status.BAD_REQUEST).build(); } ContactType contactType = commonController.findContactTypeById(contactTypeId); if (contactType == null) { return Response.status(Status.BAD_REQUEST).build(); } return Response.ok( objectFactory.createModel(userController.addStaffMemberAddress(staffMember, contactType, defaultAddress, name, streetAddress, postalCode, city, country))) .build(); }</code><technical_language>Wrong permission</technical_language>

Target:
public Response createStaffMemberAddress(@PathParam("STAFFMEMBERID") Long staffMemberId, fi.pyramus.rest.model.Address address) { if (address == null) { return Response.status(Status.BAD_REQUEST).build(); } StaffMember staffMember = userController.findStaffMemberById(staffMemberId); if (staffMember == null) { return Response.status(Status.NOT_FOUND).build(); } if (staffMember.getArchived()) { return Response.status(Status.NOT_FOUND).build(); } if (!restSecurity.hasPermission(new String[] { UserPermissions.CREATE_STAFFMEMBERADDRESS }, staffMember ) && !restSecurity.hasPermission(new String[] { PersonPermissions.PERSON_OWNER }, staffMember.getPerson() )) { return Response.status(Status.FORBIDDEN).build(); } Long contactTypeId = address.getContactTypeId(); Boolean defaultAddress = address.getDefaultAddress(); String name = address.getName(); String streetAddress = address.getStreetAddress(); String postalCode = address.getPostalCode(); String country = address.getCountry(); String city = address.getCity(); if ((contactTypeId == null) || (defaultAddress == null)) { return Response.status(Status.BAD_REQUEST).build(); } ContactType contactType = commonController.findContactTypeById(contactTypeId); if (contactType == null) { return Response.status(Status.BAD_REQUEST).build(); } return Response.ok( objectFactory.createModel(userController.addStaffMemberAddress(staffMember, contactType, defaultAddress, name, streetAddress, postalCode, city, country))) .build(); }
Source:
<code>public BitWriter(int initialCapacity, int pageSize, ByteBufferAllocator allocator) { <START> this.allocator = allocator; <END> this.baos = new CapacityByteArrayOutputStream(initialCapacity, pageSize, this.allocator); }</code><technical_language>attribute is</technical_language>

Target:
public BitWriter(int initialCapacity, int pageSize, ByteBufferAllocator allocator) { this.baos = new CapacityByteArrayOutputStream(initialCapacity, pageSize, allocator); }
Source:
<code>public int writeToFile(JDBCSequentialFile file, byte[] data, boolean append) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { Object largeObject = null; Long oid = getOID(file); try { connection.setAutoCommit(false); <START> largeObject = largeObjectManager.open(connection, oid, PostgresLargeObjectManager.WRITE); <END> if (append) { largeObjectManager.seek(largeObject, largeObjectManager.size(largeObject)); } else { largeObjectManager.truncate(largeObject, 0); } largeObjectManager.write(largeObject, data); largeObjectManager.close(largeObject); connection.commit(); } catch (Exception e) { connection.rollback(); throw e; } return data.length; } }</code><technical_language>declare largeObject instead of 4 lines (even if done before)</technical_language>

Target:
public int writeToFile(JDBCSequentialFile file, byte[] data, boolean append) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { Long oid = getOID(file); try { connection.setAutoCommit(false); Object largeObject = largeObjectManager.open(connection, oid, PostgresLargeObjectManager.WRITE); if (append) { largeObjectManager.seek(largeObject, largeObjectManager.size(largeObject)); } else { largeObjectManager.truncate(largeObject, 0); } largeObjectManager.write(largeObject, data); largeObjectManager.close(largeObject); connection.commit(); } catch (Exception e) { connection.rollback(); throw e; } return data.length; } }
Source:
<code>public void testPrintTreeOnMoreThanOneFile() throws Exception { exit.expectSystemExitWithStatus(-1); exit.checkAssertionAfterwards(() -> { assertEquals("Printing AST is allowed for only one file." + System.lineSeparator(), systemOut.getLog()); assertEquals("", systemErr.getLog()); }); Main.main("-t", getNonPackagePath( <START> "checks/metrics")); <END> }</code><technical_language>able input directory of MainTest for this is more 1 file in it</technical_language>

Target:
public void testPrintTreeOnMoreThanOneFile() throws Exception { exit.expectSystemExitWithStatus(-1); exit.checkAssertionAfterwards(() -> { assertEquals("Printing AST is allowed for only one file." + System.lineSeparator(), systemOut.getLog()); assertEquals("", systemErr.getLog()); }); Main.main("-t", getPath("")); }
Source:
<code>public void prenatalPhenotypeSetup(Set<String> enabledFields) throws Exception { String sectionName = "prenatalPhenotype"; String[] fieldIds = { "prenatal_phenotype", "prenatal_phenotype_code", "prenatal_phenotype_combined", "negative_prenatal_phenotype", "prenatal_phenotype_by_section" }; String[][] headerIds = { { "phenotype" }, { "code" }, { "phenotype", "code" }, { "negative" }, { "category" } }; Set<String> present = new HashSet<String>(); int counter = 0; for (String fieldId : fieldIds) { if (enabledFields.remove(fieldId)) { for (String headerId : headerIds[counter]) { present.add(headerId); } } counter++; } this.enabledHeaderIdsBySection.put(sectionName, present); this.prenatalPhenotypeHelper = new ConversionHelpers(); this.prenatalPhenotypeHelper <START> .featureSetUp(present.contains("phenotype"), present.contains("negative"), present.contains("category")); <END> }</code><technical_language>Discard whitespace change</technical_language>

Target:
public void prenatalPhenotypeSetup(Set<String> enabledFields) throws Exception { String sectionName = "prenatalPhenotype"; String[] fieldIds = { "prenatal_phenotype", "prenatal_phenotype_code", "prenatal_phenotype_combined", "negative_prenatal_phenotype", "prenatal_phenotype_by_section" }; String[][] headerIds = { { "phenotype" }, { "code" }, { "phenotype", "code" }, { "negative" }, { "category" } }; Set<String> present = addHeaders(fieldIds, headerIds, enabledFields); this.enabledHeaderIdsBySection.put(sectionName, present); this.prenatalPhenotypeHelper = new ConversionHelpers(); this.prenatalPhenotypeHelper .featureSetUp(present.contains("phenotype"), present.contains("negative"), present.contains("category")); }
Source:
<code>void closeRevision() throws IOException { if (rev.Model == null || rev.Format == null) { <START> if (page.Title.Text.endsWith(".js")) { <END> rev.Model = "javascript"; rev.Format = "text/javascript"; } else if (page.Title.Text.endsWith(".css")) { rev.Model = "css"; rev.Format = "text/css"; } else { rev.Model = "wikitext"; rev.Format = "text/x-wiki"; } } writer.writeRevision(rev); rev = null; }</code><technical_language>This wrong [[Node.js]] [[Talk:MediaWiki:Common.js]]. record model is avoid misinterpreting it</technical_language>

Target:
void closeRevision() throws IOException { writer.writeRevision(rev); rev = null; }
Source:
<code>protected final void failIfNotIndexed() { <START> if (isSearchable == false) { <END> throw new IllegalArgumentException("Cannot search on field [" + name() + "] since it is not indexed."); } }</code><technical_language>I find this confusing soon searchable fields indexed. rename failIfNotSearchable ? error message? isSearchable isIndexed</technical_language>

Target:
protected final void failIfNotIndexed() { if (isIndexed == false) { throw new IllegalArgumentException("Cannot search on field [" + name() + "] since it is not indexed."); } }
Source:
<code><START> LockFreeSetImpl() { <END> this.head = new Node(); }</code><technical_language>public</technical_language>

Target:
public LockFreeSetImpl() { this.head = new Node(); }
Source:
<code>public void testStorageOrdered() { final String namePrefix = randomValidStringOfLength(31); final Storage storage2 = repository.createStorage( createStorage(namePrefix + "2", ZookeeperConnection.valueOf("exhibitor://exaddress:8181/path"))); final Storage storage1 = repository.createStorage( createStorage(namePrefix + "1", ZookeeperConnection.valueOf("exhibitor://exaddress:8181/path"))); final Storage storage3 = repository.createStorage( <START> createStorage(namePrefix + "3", ZookeeperConnection.valueOf("exhibitor://exaddress:8181/path"))); <END> final List<Storage> storages = repository.listStorages().stream() .filter(st -> st.getId() != null) .filter(st -> st.getId().startsWith(namePrefix)) .collect(Collectors.toList()); assertEquals(3, storages.size()); assertEquals(storage1, storages.get(0)); assertEquals(storage2, storages.get(1)); assertEquals(storage3, storages.get(2)); }</code><technical_language>I 3 storages addresses paths. changed in a storages address/path. explain that</technical_language>

Target:
public void testStorageOrdered() { final String namePrefix = randomValidStringOfLength(31); final Storage storage2 = repository.createStorage( createStorage(namePrefix + "2", ZookeeperConnection.valueOf("exhibitor://exaddress1:8181/path3"))); final Storage storage1 = repository.createStorage( createStorage(namePrefix + "1", ZookeeperConnection.valueOf("exhibitor://exaddress2:8181/path2"))); final Storage storage3 = repository.createStorage( createStorage(namePrefix + "3", ZookeeperConnection.valueOf("exhibitor://exaddress3:8181/path1"))); final List<Storage> storages = repository.listStorages().stream() .filter(st -> st.getId() != null) .filter(st -> st.getId().startsWith(namePrefix)) .collect(Collectors.toList()); assertEquals(3, storages.size()); assertEquals(storage1, storages.get(0)); assertEquals(storage2, storages.get(1)); assertEquals(storage3, storages.get(2)); }
Source:
<code>private void initialize() { ColorServer colorServer = new ColorServer(); fileOpenController.dbPathProperty().set(welcomeController.getListedPaths()); fileOpenController.graphProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); <START> constructView(strainView, phyloView); <END> }); fileOpenController.treeProperty().addListener((obj, oldV, newV) -> { phyloView = new PhylogeneticView(colorServer); phyloView.rootProperty().set(newV); }); welcomeController.dbProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); phyloView = new PhylogeneticView(colorServer); constructView(strainView, phyloView); }); }</code><technical_language>phyloView null here</technical_language>

Target:
private void initialize() { ColorServer colorServer = new ColorServer(); fileOpenController.dbPathProperty().set(welcomeController.getListedPaths()); fileOpenController.graphProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); constructView(); }); fileOpenController.treeProperty().addListener((obj, oldV, newV) -> { phyloView = new PhylogeneticView(colorServer); phyloView.rootProperty().set(newV); }); welcomeController.dbProperty().addListener((obj, oldV, newV) -> { strainView = new StrainView(colorServer, newV); phyloView = new PhylogeneticView(colorServer); constructView(); }); }
Source:
<code>private static Request wrap(final Request req) { final AtomicBoolean seen = new AtomicBoolean(false); <START> return new RqOf( <END> req::head, () -> { if (!seen.getAndSet(true)) { throw new IllegalStateException( "It's not allowed to call body() more than once" ); } return req.body(); } ); }</code><technical_language>@fanifieiev above</technical_language>

Target:
private static Request wrap(final Request req) { final AtomicBoolean seen = new AtomicBoolean(false); return new RequestOf( req::head, () -> { if (!seen.getAndSet(true)) { throw new IllegalStateException( "It's not allowed to call body() more than once" ); } return req.body(); } ); }
Source:
<code>protected void checkFreemMarkerOutput(boolean outputIsInFile, String output, String alternateOutput, String... runFile) { String outputExpected = ""; if (outputIsInFile) { String outputFilepath = getResourceAbsolutePath( Activator.PLUGIN_ID, output); outputExpected = readOutputFromFile(outputFilepath); } else { outputExpected = output; } runJavaFile(runFile); ConsoleView cv = new ConsoleView(); cv.open(); try { new WaitUntil(new ConsoleHasText(outputExpected), TimePeriod.NORMAL, false); } catch (CoreLayerException exc) { <START> exc.printStackTrace(); <END> } String consoleText = cv.getConsoleText(); if (!consoleText.equals(outputExpected)) { log.error("Console text doesn't correspond with expected text"); log.dump("Console text:\n" + consoleText); log.dump("Expected text:\n" + outputExpected); } compareConsoleToOutput(consoleText, outputExpected, alternateOutput); }</code><technical_language>Is OK this wait throws CoreLayerException? this a failure/error</technical_language>

Target:
protected void checkFreemMarkerOutput(boolean outputIsInFile, String output, String alternateOutput, String... runFile) { String outputExpected = ""; if (outputIsInFile) { String outputFilepath = getResourceAbsolutePath( Activator.PLUGIN_ID, output); outputExpected = readOutputFromFile(outputFilepath); } else { outputExpected = output; } runJavaFile(runFile); new WaitUntil(new ConsoleHasText(outputExpected), TimePeriod.NORMAL, false); ConsoleView cv = new ConsoleView(); cv.open(); String consoleText = cv.getConsoleText(); if (!consoleText.equals(outputExpected)) { log.error("Console text doesn't correspond with expected text"); log.dump("Console text:\n" + consoleText); log.dump("Expected text:\n" + outputExpected); } compareConsoleToOutput(consoleText, outputExpected, alternateOutput); }
Source:
<code>public void shouldSkipSiteReportGeneration() throws Exception { File testDir = prepareSiteTest("/pit-site-skip"); File siteParentDir = buildFile(testDir, "target", "site"); verifier.executeGoal("site"); <START> assertThat(siteParentDir.exists()).isEqualTo(true); <END> assertThat(buildFile(siteParentDir, "pit-reports").exists()).isEqualTo(false); assertThat(buildFile(siteParentDir, "index.html").exists()).isEqualTo(true); assertThat(buildFile(siteParentDir, "project-reports.html").exists()).isEqualTo(false); }</code><technical_language>assertThat a FileAssert-extension, is sufficient write assertThat(...).exists() assertThat(...).isTrue()</technical_language>

Target:
public void shouldSkipSiteReportGeneration() throws Exception { File testDir = prepareSiteTest("/pit-site-skip"); File siteParentDir = buildFilePath(testDir, "target", "site"); verifier.executeGoal("site"); assertThat(siteParentDir).exists(); assertThat(buildFilePath(siteParentDir, "pit-reports")).doesNotExist(); assertThat(buildFilePath(siteParentDir, "index.html")).exists(); assertThat(buildFilePath(siteParentDir, "project-reports.html")).doesNotExist(); }
Source:
<code>public static boolean isExpiredPresignedUrl(final String presignedUrl, final Date now) { final Map<String, String> urlMap = Splitter.on('&').trimResults().withKeyValueSeparator("=").split(presignedUrl.split("\\?")[1]); try { final Long expiration = Long.parseLong(urlMap.get("Expires")); final Long nowSecs = now.getTime() / 1000L; return (nowSecs > expiration); <START> } catch (Exception e) { <END> LOGGER.error("Invalid pre-signed URL."); return true; } }</code><technical_language>Catch right Exception if possible</technical_language>

Target:
public static boolean isExpiredPresignedUrl(final String presignedUrl, final Date now) { final Map<String, String> urlMap = Splitter.on('&').trimResults().withKeyValueSeparator("=").split(presignedUrl.split("\\?")[1]); if (now == null) { LOGGER.error("Invalid date parameter in pre-signed URL check."); return true; } try { final Long expiration = Long.parseLong(urlMap.get("Expires")); final Long nowSecs = now.getTime() / 1000L; return (nowSecs > expiration); } catch (NumberFormatException e) { LOGGER.error("Invalid pre-signed URL."); return true; } }
Source:
<code>private boolean changeDefaultFolder() { Element folder = (Element) mConfig.getDocumentElement() .getElementsByTagName("folder").item(0); String deviceModel = Build.MODEL .replace(" ", "_") .toLowerCase(Locale.US) .replaceAll("[^a-z0-9_-]", ""); <START> String deviceId = deviceModel + "_" + generateRandomString(DEVICE_ID_APPENDIX_LENGTH); <END> folder.setAttribute("label", mContext.getString(R.string.default_folder_label)); folder.setAttribute("id", mContext.getString(R.string.default_folder_id, deviceId)); folder.setAttribute("path", Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath()); folder.setAttribute("type", "readonly"); folder.setAttribute("fsWatcherEnabled", "true"); folder.setAttribute("fsWatcherDelayS", "10"); return true; }</code><technical_language>String defaultFolderId = deviceModel + "_" + generateRandomString(FOLDER_ID_APPENDIX_LENGTH);</technical_language>

Target:
private boolean changeDefaultFolder() { Element folder = (Element) mConfig.getDocumentElement() .getElementsByTagName("folder").item(0); String deviceModel = Build.MODEL .replace(" ", "_") .toLowerCase(Locale.US) .replaceAll("[^a-z0-9_-]", ""); String defaultFolderId = deviceModel + "_" + generateRandomString(FOLDER_ID_APPENDIX_LENGTH); folder.setAttribute("label", mContext.getString(R.string.default_folder_label)); folder.setAttribute("id", mContext.getString(R.string.default_folder_id, defaultFolderId)); folder.setAttribute("path", Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath()); folder.setAttribute("type", "readonly"); folder.setAttribute("fsWatcherEnabled", "true"); folder.setAttribute("fsWatcherDelayS", "10"); return true; }
Source:
<code>private static BloomKFilter evaluateBloomFilter(ExprNodeDesc desc, Configuration configuration, boolean resolveDynamicValue ) throws HiveException, IOException { if(!resolveDynamicValue) { return new BloomKFilter(1); } else { BytesWritable bw = (BytesWritable) ExprNodeEvaluatorFactory.get(desc, configuration) .evaluate(null); byte[] bytes = new byte[bw.getLength()]; <START> System.arraycopy(bw.getBytes(), 0, bytes, 0, bw.getLength()); <END> InputStream in = new NonSyncByteArrayInputStream(bytes); return BloomKFilter.deserialize(in); } }</code><technical_language>do need copy data, BloomKFilter.deserialize is copy already</technical_language>

Target:
private static BloomKFilter evaluateBloomFilter(ExprNodeDesc desc, Configuration configuration, boolean resolveDynamicValue) throws HiveException, IOException { if (!resolveDynamicValue) { return new BloomKFilter(1); } else { BytesWritable bw = (BytesWritable) ExprNodeEvaluatorFactory.get(desc, configuration).evaluate(null); return BloomKFilter.deserialize(ByteBuffer.wrap(bw.getBytes())); } }
Source:
<code>private void makeChange(StringBuilder buffer, String format, Object... args) throws FormatterException { if (args == null) { return; } Object o = null; int pattern = format.indexOf(":"); if (pattern == -1) { pattern = format.length(); } StringTokenizer st = new StringTokenizer(format.substring( 0, pattern), "."); try { String ind = st.nextToken(); <START> if (ind.charAt(0) == '-' || ind.charAt(0) == '+') { <END> throw new FormatterException("Incorrect index"); } o = args[Integer.parseInt(ind)]; } catch (Exception e) { throw new FormatterException("Incorrect index"); } while(st.hasMoreTokens()) { o = getField(o, st.nextToken()); } if (o == null) { return; } if (pattern == format.length()) { buffer.append(o.toString()); } else { StringFormatterExtension sfe = null; for (int i = 0; i < extensions.size(); ++i) { if (extensions.get(i).supports(o.getClass())) { sfe = extensions.get(i); break; } } if (sfe == null) { throw new FormatterException("No available extension"); } sfe.format(buffer, o, format.substring(pattern + 1)); } }</code><technical_language>Character.isDigit</technical_language>

Target:
private void makeChange(StringBuilder buffer, String format, Object... args) throws FormatterException { if (args == null) { return; } Object o = null; int pattern = format.indexOf(":"); if (pattern == -1) { pattern = format.length(); } StringTokenizer st = new StringTokenizer(format.substring( 0, pattern), "."); try { String ind = st.nextToken(); if (!Character.isDigit(ind.charAt(0))) { throw new FormatterException("Incorrect index"); } o = args[Integer.parseInt(ind)]; } catch (Exception e) { throw new FormatterException("Incorrect index"); } while(st.hasMoreTokens()) { o = getField(o, st.nextToken()); } if (o == null) { return; } if (pattern == format.length()) { buffer.append(o.toString()); } else { StringFormatterExtension sfe = null; for (int i = 0; i < extensions.size(); ++i) { if (extensions.get(i).supports(o.getClass())) { sfe = extensions.get(i); break; } } if (sfe == null) { throw new FormatterException("No available extension"); } sfe.format(buffer, o, format.substring(pattern + 1)); } }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Metadata metadata = (Metadata) o; <START> if (container != null ? !container.equals(metadata.container) : metadata.container != null) { <END> return false; } if (!Arrays.equals(aggregators, metadata.aggregators)) { return false; } return !(queryGranularity != null ? !queryGranularity.equals(metadata.queryGranularity) : metadata.queryGranularity != null); }</code><technical_language>container is non-null, is initialized in constructor</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Metadata metadata = (Metadata) o; if (!container.equals(metadata.container)) { return false; } if (!Arrays.equals(aggregators, metadata.aggregators)) { return false; } return !(queryGranularity != null ? !queryGranularity.equals(metadata.queryGranularity) : metadata.queryGranularity != null); }
Source:
<code>public void testGetProcessInstancesCustomWithoutVars() { query = new SqlQueryDefinition("jbpmProcessSearchWithoutVars", dataSourceJNDIname); query.setExpression("select p. PROCESSINSTANCEID, p.PROCESSID, p.PROCESSNAME, p.PROCESSVERSION, " + "p.STATUS, p.EXTERNALID, pr.STARTDATE, p.USER_IDENTITY, p.PROCESSINSTANCEDESCRIPTION, " + "p.CORRELATIONKEY, p.PARENTPROCESSINSTANCEID, pr.LASTMODIFICATIONDATE " + "from PROCESSINSTANCELOG p " + <START> "inner join PROCESSINSTANCEINFO pr on p.PROCESSINSTANCEID = pr.INSTANCEID"); <END> queryService.registerQuery(query); processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument"); assertNotNull(processInstanceId); List<ProcessInstanceCustomDesc> processInstanceLogs = queryService.query(query.getName(), ProcessInstanceCustomQueryMapper.get(), new QueryContext()); assertNotNull(processInstanceLogs); assertEquals(1, processInstanceLogs.size()); processService.abortProcessInstance(processInstanceId); processInstanceId = null; }</code><technical_language>I some necessary white spaces, update as: java query.setExpression("select p.PROCESSINSTANCEID, p.PROCESSID, p.PROCESSNAME, p.PROCESSVERSION, " + "p.STATUS, p.EXTERNALID, pr.STARTDATE, p.USER_IDENTITY, p.PROCESSINSTANCEDESCRIPTION, " + "p.CORRELATIONKEY, p.PARENTPROCESSINSTANCEID, pr.LASTMODIFICATIONDATE " + "from PROCESSINSTANCELOG p " + "inner join PROCESSINSTANCEINFO pr p.PROCESSINSTANCEID = pr.INSTANCEID");</technical_language>

Target:
public void testGetProcessInstancesCustomWithoutVars() { query = new SqlQueryDefinition("jbpmProcessSearchWithoutVars", dataSourceJNDIname); query.setExpression("select p.PROCESSINSTANCEID, p.PROCESSID, p.PROCESSNAME, p.PROCESSVERSION, " + "p.STATUS, p.EXTERNALID, pr.STARTDATE, p.USER_IDENTITY, p.PROCESSINSTANCEDESCRIPTION, " + "p.CORRELATIONKEY, p.PARENTPROCESSINSTANCEID, pr.LASTMODIFICATIONDATE " + "from PROCESSINSTANCELOG p inner join PROCESSINSTANCEINFO pr on p.PROCESSINSTANCEID = pr.INSTANCEID"); queryService.registerQuery(query); processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "org.jbpm.writedocument"); assertNotNull(processInstanceId); List<ProcessInstanceCustomDesc> processInstanceLogs = queryService.query(query.getName(), ProcessInstanceCustomQueryMapper.get(), new QueryContext()); assertNotNull(processInstanceLogs); assertEquals(1, processInstanceLogs.size()); processService.abortProcessInstance(processInstanceId); processInstanceId = null; }
Source:
<code><START> public TransactorCache getTransactorCache() { <END> if (cache == null) { createTransactorCache(); } return cache; }</code><technical_language>need sync</technical_language>

Target:
public synchronized TransactorCache getTransactorCache() { checkIfClosed(); if (cache == null) { cache = new TransactorCache(config); } else if (cache.getStatus() == TcStatus.CLOSED) { throw new IllegalStateException("TransactorCache is closed!"); } return cache; }