auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void configureNavigationButtons() { next.setOnClickListener(v -> { <START> if (DeviceInfoUtil.getConnectionType(this) == ConnectionType.NO_INTERNET) { <END> ViewUtil.showShortSnackbar(cardLayout, R.string.no_internet); return; } setTitleAndDescriptions(); presenter.handleNext(descriptionsAdapter.getTitle(), descriptionsAdapter.getDescriptions()); }); previous.setOnClickListener(v -> presenter.handlePrevious()); categoryNext.setOnClickListener(v -> presenter.handleCategoryNext(categoriesModel, false)); categoryPrevious.setOnClickListener(v -> presenter.handlePrevious()); licensePrevious.setOnClickListener(v -> presenter.handlePrevious()); submit.setOnClickListener(v -> { Toast.makeText(this, R.string.uploading_started, Toast.LENGTH_LONG).show(); presenter.handleSubmit(categoriesModel); finish(); }); }</code><technical_language>Is check needed in step of upload? Ideally, moved step</technical_language>

Target:
private void configureNavigationButtons() { next.setOnClickListener(v -> { if (!NetworkUtils.isInternetConnectionEstablished(this)) { ViewUtil.showShortSnackbar(cardLayout, R.string.no_internet); return; } setTitleAndDescriptions(); presenter.handleNext(descriptionsAdapter.getTitle(), descriptionsAdapter.getDescriptions()); }); previous.setOnClickListener(v -> presenter.handlePrevious()); categoryNext.setOnClickListener(v -> presenter.handleCategoryNext(categoriesModel, false)); categoryPrevious.setOnClickListener(v -> presenter.handlePrevious()); licensePrevious.setOnClickListener(v -> presenter.handlePrevious()); submit.setOnClickListener(v -> { Toast.makeText(this, R.string.uploading_started, Toast.LENGTH_LONG).show(); presenter.handleSubmit(categoriesModel); finish(); }); }
Source:
<code>public void getDuplicatePatientsByAttributes_shouldReturnPatients() { Patient patient = Context.getPatientService().getPatient(2); List<String> attributes = new ArrayList<>(); attributes.add(patient.getGender()); attributes.add(patient.getGivenName()); attributes.add(patient.getMiddleName()); attributes.add(patient.getFamilyName()); <START> List<Patient> receivedPatientList = patientService.getDuplicatePatientsByAttributes(attributes); <END> assertNotNull(receivedPatientList); }</code><technical_language>please test actual attributes in database return some matches</technical_language>

Target:
public void getDuplicatePatientsByAttributes_shouldReturnPatients() { List<PersonAttribute> activePersonAttributes = Context.getPatientService().getPatient(2).getActiveAttributes(); List<String> activeAttributes = new ArrayList<>(); for (PersonAttribute personAttribute : activePersonAttributes) { activeAttributes.add(personAttribute.getValue()); } List<Patient> receivedPatientList = patientService.getDuplicatePatientsByAttributes(activeAttributes); assertNotNull(receivedPatientList); assertEquals(receivedPatientList.size(), 0); }
Source:
<code>public void validate(Object obj, Errors errors) { ConceptNameTag cnt = (ConceptNameTag) obj; if (cnt == null) { errors.rejectValue("conceptNameTag", "error.general"); } else { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "tag", "error.name"); <START> ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "error.description"); <END> if (cnt.getTag() != null) { for (ConceptNameTag currentTag : Context.getConceptService().getAllConceptNameTags()) { if (currentTag.getTag().trim() == (cnt.getTag().trim())) { errors.rejectValue("tag", "conceptsearch.error.duplicate"); } } } } }</code><technical_language>I try require description for metadata</technical_language>

Target:
public void validate(Object obj, Errors errors) { ConceptNameTag cnt = (ConceptNameTag) obj; if (cnt == null) { errors.rejectValue("conceptNameTag", "error.general"); } else { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "tag", "error.name"); if (cnt.getTag() != null) { for (ConceptNameTag currentTag : Context.getConceptService().getAllConceptNameTags()) { if (currentTag != null) { if (currentTag.getTag().trim().equals((cnt.getTag().trim()))) { errors.rejectValue("tag", "Concept.name.tag.duplicate"); } } } } } }
Source:
<code>private IJavaProject getSingleProject() { IJavaProject first= null; for (IJavaElement <START> fElement : <END> fElements) { final IJavaProject project = fElement.getJavaProject(); if (project != null) { if (first == null) first= project; else if (!project.equals(first)) return null; } } return first; }</code><technical_language>rename element</technical_language>

Target:
private IJavaProject getSingleProject() { IJavaProject first= null; for (IJavaElement element : fElements) { final IJavaProject project= element.getJavaProject(); if (project != null) { if (first == null) first= project; else if (!project.equals(first)) return null; } } return first; }
Source:
<code>private static void assertOnMapIterator(Iterator<Map.Entry<String, JsonNode>> expectedNode, ObjectNode actualNode, boolean ignoredDefaults, String[] ignoredFields) { while (expectedNode.hasNext()) { assertTrue(actualNode.fields().hasNext()); Map.Entry<String, JsonNode> expectedField = expectedNode.next(); String fieldName = expectedField.getKey(); <START> Set<String> ignoredFieldSet = new HashSet<>(Arrays.asList(ignoredFields)); <END> if (shouldSkipField(fieldName, expectedField.getValue(), ignoredDefaults, ignoredFieldSet)) { continue; } if (expectedField.getValue().isValueNode()) { assertEquals(expectedField.getValue(), actualNode.get(expectedField.getKey())); } else if (expectedField.getValue().isArray()) { Iterator<JsonNode> expectedArray = expectedField.getValue().elements(); Iterator<JsonNode> actualArray = actualNode.get(expectedField.getKey()).elements(); while (expectedArray.hasNext()) { assertTrue(actualArray.hasNext()); Iterator<JsonNode> expectedElements = expectedArray.next().elements(); Iterator<JsonNode> actualElements = actualArray.next().elements(); while (expectedElements.hasNext()) { assertTrue(actualElements.hasNext()); JsonNode a = expectedElements.next(); JsonNode b = actualElements.next(); if (ignoredFieldSet.contains(fieldName)) { continue; } if (shouldSkipField(null, a, true, null)) { continue; } assertEquals(a.asText(), b.asText()); } } } else { assertObjectEquals(expectedField.getValue(), actualNode.get(expectedField.getKey()), ignoredDefaults, ignoredFields); } } }</code><technical_language>want move this of while loop, right this recreated time</technical_language>

Target:
private static void assertOnMapIterator(Iterator<Map.Entry<String, JsonNode>> expectedNode, ObjectNode actualNode, boolean ignoredDefaults, String[] ignoredFields) { Set<String> ignoredFieldSet = new HashSet<>(Arrays.asList(ignoredFields)); while (expectedNode.hasNext()) { assertTrue(actualNode.fields().hasNext()); Map.Entry<String, JsonNode> expectedField = expectedNode.next(); String fieldName = expectedField.getKey(); if (shouldSkipField(fieldName, expectedField.getValue(), ignoredDefaults, ignoredFieldSet)) { continue; } if (expectedField.getValue().isValueNode()) { assertEquals(expectedField.getValue(), actualNode.get(expectedField.getKey())); } else if (expectedField.getValue().isArray()) { Iterator<JsonNode> expectedArray = expectedField.getValue().elements(); Iterator<JsonNode> actualArray = actualNode.get(expectedField.getKey()).elements(); while (expectedArray.hasNext()) { assertTrue(actualArray.hasNext()); Iterator<JsonNode> expectedElements = expectedArray.next().elements(); Iterator<JsonNode> actualElements = actualArray.next().elements(); while (expectedElements.hasNext()) { assertTrue(actualElements.hasNext()); JsonNode a = expectedElements.next(); JsonNode b = actualElements.next(); if (ignoredFieldSet.contains(fieldName)) { continue; } if (shouldSkipField(null, a, true, null)) { continue; } assertEquals(a.asText(), b.asText()); } } } else { assertObjectEquals(expectedField.getValue(), actualNode.get(expectedField.getKey()), ignoredDefaults, ignoredFields); } } }
Source:
<code>private synchronized Set<String> getSharedWith(Map<ByteArrayWrapper, Set<String>> cache, AbsoluteCapability cap) { <START> return new HashSet<>(cache.computeIfAbsent(generateKey(cap), k -> new HashSet<>())); <END> }</code><technical_language>want filling this map browse around. getOrDefault</technical_language>

Target:
private synchronized Set<String> getSharedWith(Map<ByteArrayWrapper, Set<String>> cache, AbsoluteCapability cap) { return new HashSet<>(cache.getOrDefault(generateKey(cap), new HashSet<>())); }
Source:
<code>public void write(byte[] b, int off, int len) throws IOException { if(sink == null) { throw new IOException("Unconnected pipe"); } while (len>0) { FastPipedInputStream s = sink(); if(s.closed!=null) { <START> throw (IOException) new IOException("Pipe is already closed", s.closed); <END> } synchronized(s.buffer) { if(s.writePosition == s.readPosition && s.writeLaps > s.readLaps) { byte[] buf = s.buffer; s = null; Thread t = Thread.currentThread(); String oldName = t.getName(); t.setName("Blocking to write "+HexDump.toHex(b,off,Math.min(len,256))+": "+oldName); try { buf.wait(TIMEOUT); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException(e.getMessage()).initCause(e); } finally { t.setName(oldName); } continue; } int amount = Math.min(len, (s.writePosition < s.readPosition ? s.readPosition : s.buffer.length) - s.writePosition); System.arraycopy(b, off, s.buffer, s.writePosition, amount); s.writePosition += amount; if(s.writePosition == s.buffer.length) { s.writePosition = 0; ++s.writeLaps; } off += amount; len -= amount; written += amount; s.buffer.notifyAll(); } } }</code><technical_language>suggestion throw new IOException("Pipe is closed", s.closed);</technical_language>

Target:
public void write(byte[] b, int off, int len) throws IOException { if(sink == null) { throw new IOException("Unconnected pipe"); } while (len>0) { FastPipedInputStream s = sink(); if(s.closed!=null) { throw new IOException("Pipe is already closed", s.closed); } synchronized(s.buffer) { if(s.writePosition == s.readPosition && s.writeLaps > s.readLaps) { byte[] buf = s.buffer; s = null; Thread t = Thread.currentThread(); String oldName = t.getName(); t.setName("Blocking to write "+HexDump.toHex(b,off,Math.min(len,256))+": "+oldName); try { buf.wait(TIMEOUT); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException(e.getMessage()).initCause(e); } finally { t.setName(oldName); } continue; } int amount = Math.min(len, (s.writePosition < s.readPosition ? s.readPosition : s.buffer.length) - s.writePosition); System.arraycopy(b, off, s.buffer, s.writePosition, amount); s.writePosition += amount; if(s.writePosition == s.buffer.length) { s.writePosition = 0; ++s.writeLaps; } off += amount; len -= amount; written += amount; s.buffer.notifyAll(); } } }
Source:
<code>public void success() { <START> SingleSubject<Integer> ms = SingleSubject.create(); <END> assertFalse(ms.hasValue()); assertNull(ms.getValue()); assertFalse(ms.hasThrowable()); assertNull(ms.getThrowable()); assertFalse(ms.hasObservers()); assertEquals(0, ms.observerCount()); TestObserver<Integer> to = ms.test(); to.assertEmpty(); assertTrue(ms.hasObservers()); assertEquals(1, ms.observerCount()); ms.onSuccess(1); assertTrue(ms.hasValue()); assertEquals(1, ms.getValue().intValue()); assertFalse(ms.hasThrowable()); assertNull(ms.getThrowable()); assertFalse(ms.hasObservers()); assertEquals(0, ms.observerCount()); to.assertResult(1); ms.test().assertResult(1); assertTrue(ms.hasValue()); assertEquals(1, ms.getValue().intValue()); assertFalse(ms.hasThrowable()); assertNull(ms.getThrowable()); assertFalse(ms.hasObservers()); assertEquals(0, ms.observerCount()); }</code><technical_language>ss</technical_language>

Target:
public void success() { SingleSubject<Integer> ss = SingleSubject.create(); assertFalse(ss.hasValue()); assertNull(ss.getValue()); assertFalse(ss.hasThrowable()); assertNull(ss.getThrowable()); assertFalse(ss.hasObservers()); assertEquals(0, ss.observerCount()); TestObserver<Integer> to = ss.test(); to.assertEmpty(); assertTrue(ss.hasObservers()); assertEquals(1, ss.observerCount()); ss.onSuccess(1); assertTrue(ss.hasValue()); assertEquals(1, ss.getValue().intValue()); assertFalse(ss.hasThrowable()); assertNull(ss.getThrowable()); assertFalse(ss.hasObservers()); assertEquals(0, ss.observerCount()); to.assertResult(1); ss.test().assertResult(1); assertTrue(ss.hasValue()); assertEquals(1, ss.getValue().intValue()); assertFalse(ss.hasThrowable()); assertNull(ss.getThrowable()); assertFalse(ss.hasObservers()); assertEquals(0, ss.observerCount()); }
Source:
<code>public void setEnabled(boolean enabled) { if (enabled != enabled_) { enabled_ = enabled; handlers_.fireEvent(new EnabledChangedEvent(this)); } <START> if (Desktop.isDesktop()) <END> DesktopMenuCallback.setCommandEnabled(id_, enabled_); }</code><technical_language>Mac-only</technical_language>

Target:
public void setEnabled(boolean enabled) { if (enabled != enabled_) { enabled_ = enabled; handlers_.fireEvent(new EnabledChangedEvent(this)); } }
Source:
<code>public String getClassName(Class clazz, String name) { if (this.classToProperty.containsKey(clazz)) { String classNameProperty = this.classToProperty.get(clazz); String className = environment .getProperty(name + "." + NAMESPACE + "." + classNameProperty); <START> if(className==null) <END> className=environment .getProperty(NAMESPACE + "." + classNameProperty); return className; } return null; }</code><technical_language>Please curly braces for if statements</technical_language>

Target:
public String getClassName(Class clazz, String name) { if (this.classToProperty.containsKey(clazz)) { String classNameProperty = this.classToProperty.get(clazz); String className = environment .getProperty(name + "." + NAMESPACE + "." + classNameProperty); if(className==null) { className=environment .getProperty(NAMESPACE + "." + classNameProperty); } return className; } return null; }
Source:
<code>private String redirectToList() { try { String referrer = FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap() .get("referer"); String callerViewId = referrer.substring(referrer.lastIndexOf("/") + 1); if (!callerViewId.isEmpty() && callerViewId.contains("rulesetEdit.jsf")) { <START> return "/pages/projects.jsf?id=4&" + redirectParameter; <END> } else { return "/pages/RegelsaetzeAlle?" + redirectParameter; } } catch (NullPointerException e) { return "/pages/RegelsaetzeAlle?" + redirectParameter; } }</code><technical_language>adding a constant id URI</technical_language>

Target:
private String redirectToList() { try { String referrer = FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap() .get("referer"); String callerViewId = referrer.substring(referrer.lastIndexOf("/") + 1); if (!callerViewId.isEmpty() && callerViewId.contains("rulesetEdit.jsf")) { return "/pages/projects.jsf?id=" + projectForm.getActiveTabIndex() + "&" + REDIRECT_PARAMETER; } else { return "/pages/RegelsaetzeAlle?" + REDIRECT_PARAMETER; } } catch (NullPointerException e) { return "/pages/RegelsaetzeAlle?" + REDIRECT_PARAMETER; } }
Source:
<code>private boolean isValidScope(String scope, String id) { if (CachingConstants.SCOPE_PER_HOST.equals(scope)) { return true; } else if (CachingConstants.SCOPE_PER_MEDIATOR.equals(scope)) { if (id != null) { return true; } else { <START> throw new MediatorException("Id is required for a cache wirth scope : " + scope); <END> } } else if (CachingConstants.SCOPE_DISTRIBUTED.equals(scope)) { return true; } else { throw new MediatorException("Unknown scope " + scope + " for the Cache mediator"); } }</code><technical_language>%s/wirth/with/g</technical_language>

Target:
private boolean isValidScope(String scope, String id) { if (CachingConstants.SCOPE_PER_HOST.equals(scope)) { return true; } else if (CachingConstants.SCOPE_PER_MEDIATOR.equals(scope)) { if (id != null) { return true; } else { throw new MediatorException("Id is required for a cache with scope : " + scope); } } else if (CachingConstants.SCOPE_DISTRIBUTED.equals(scope)) { return true; } else { throw new MediatorException("Unknown scope " + scope + " for the Cache mediator"); } }
Source:
<code>public void deleteCollectionSubmittersGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); Group submittersGroup = collectionService.createSubmitters(context, collection); context.restoreAuthSystemState(); <START> getClient().perform(delete("/api/core/collections/" + collection.getID() + "/submittersGroup")) <END> .andExpect(status().isUnauthorized()); }</code><technical_language>double check group is</technical_language>

Target:
public void deleteCollectionSubmittersGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); Group submittersGroup = collectionService.createSubmitters(context, collection); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/submittersGroup")) .andExpect(status().isUnauthorized()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/submittersGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(submittersGroup.getID(), submittersGroup.getName()))); }
Source:
<code>private byte readByte() throws IOException { if(!ensure(1)) { <START> throw new MessageFormatException("insufficient data length for reading byte value"); <END> } byte b = buffer.getByte(position); consume(1); return b; }</code><technical_language>throw EOFException instead of MessageFormatException? readPayload, unpackString getNextFormat throws EOFException</technical_language>

Target:
private byte readByte() throws IOException { if(!ensure(1)) { throw new EOFException("insufficient data length for reading byte value"); } byte b = buffer.getByte(position); consume(1); return b; }
Source:
<code>public static void saveState(IMemento memento, WfeInput input) { int artUuid = input.getArtUuid(); BranchId branch = input.getBranchId(); String title = input.getTitle(); if (input.getArtifact() != null && !input.getArtifact().isDeleted()) { artUuid = input.getArtifact().getArtId(); branch = input.getArtifact().getBranch(); title = input.getName(); } if (artUuid > 0 && branch.isValid() && Strings.isValid(title)) { <START> memento.putString(BRANCH_KEY, String.valueOf(branch.getId())); <END> memento.putInteger(ART_KEY, artUuid); memento.putString(TITLE, title); } }</code><technical_language>branch.getIdString()</technical_language>

Target:
public static void saveState(IMemento memento, WfeInput input) { int artUuid = input.getArtUuid(); BranchId branch = input.getBranchId(); String title = input.getTitle(); if (input.getArtifact() != null && !input.getArtifact().isDeleted()) { artUuid = input.getArtifact().getArtId(); branch = input.getArtifact().getBranch(); title = input.getName(); } if (artUuid > 0 && branch.isValid() && Strings.isValid(title)) { memento.putString(BRANCH_KEY, branch.getIdString()); memento.putInteger(ART_KEY, artUuid); memento.putString(TITLE, title); } }
Source:
<code>protected String doInBackground(Void... params) { Logger.log(TAG, "doing in background"); socketOccupied = false; try { ServerSocket serverSocket = new ServerSocket(8988); long time = System.currentTimeMillis(); String finalFileName = receiveZipDirectory + time + ".zip"; try { publishProgress("Ready to accept new file transfer.", null); Socket client = serverSocket.accept(); Logger.log(TAG, "Ready in wi-fi direct file server receive loop"); final File f = new File(finalFileName); File dirs = new File(f.getParent()); dirs.mkdirs(); f.createNewFile(); Log.d(TAG, "server: copying files " + f.toString()); InputStream inputstream = client.getInputStream(); CommCareWiFiDirectActivity.copyFile(inputstream, new FileOutputStream(f)); publishProgress("copied files: " + f.getAbsolutePath(), f.getAbsolutePath()); publishProgress("File Server Resetting", null); return f.getAbsolutePath(); } catch (IOException e) { <START> Logger.log(TAG, e.getMessage()); <END> publishProgress("File Server crashed after transfer with IO Exception: " + e.getMessage()); return null; } finally { try { serverSocket.close(); } catch(IOException e) { e.printStackTrace(); } } } catch (IOException ioe) { publishProgress("Ready to accept new file transfer.", null); Logger.log(TAG, "couldn't open socket!"); socketOccupied = true; return null; } }</code><technical_language>this more helpful pass message Logger.log() publishProgress()</technical_language>

Target:
protected String doInBackground(Void... params) { Logger.log(TAG, "doing in background"); socketOccupied = false; try { ServerSocket serverSocket = new ServerSocket(8988); long time = System.currentTimeMillis(); String finalFileName = receiveZipDirectory + time + ".zip"; try { publishProgress("Ready to accept new file transfer.", null); Socket client = serverSocket.accept(); Logger.log(TAG, "Ready in wi-fi direct file server receive loop"); final File f = new File(finalFileName); File dirs = new File(f.getParent()); dirs.mkdirs(); f.createNewFile(); Log.d(TAG, "server: copying files " + f.toString()); InputStream inputstream = client.getInputStream(); CommCareWiFiDirectActivity.copyFile(inputstream, new FileOutputStream(f)); publishProgress("copied files: " + f.getAbsolutePath(), f.getAbsolutePath()); publishProgress("File Server Resetting", null); return f.getAbsolutePath(); } catch (IOException e) { String errorMessage = "File Server crashed after transfer with IO Exception: " + e.getMessage(); Logger.exception(errorMessage, e); publishProgress(errorMessage); return null; } finally { try { serverSocket.close(); } catch(IOException e) { e.printStackTrace(); } } } catch (IOException ioe) { publishProgress("Ready to accept new file transfer.", null); Logger.log(TAG, "couldn't open socket!"); socketOccupied = true; return null; } }
Source:
<code>public void downloadBlob(BlobId blobId, OutputStream outputStream) throws CloudStorageException { <START> BlobReadInfo blobReadInfo = null; <END> try { if (!map.containsKey(blobId)) { throw new CloudStorageException("Blob with blobId " + blobId.getID() + " does not exist."); } byte[] blobData = new byte[(int) map.get(blobId).getFirst().getSize()]; map.get(blobId).getSecond().read(blobData); outputStream.write(blobData); } catch (IOException ex) { throw new CloudStorageException( "Could not download blob for blobid " + blobId.getID() + " due to " + ex.toString()); } }</code><technical_language>used</technical_language>

Target:
public void downloadBlob(BlobId blobId, OutputStream outputStream) throws CloudStorageException { CloudMessageReadSet.BlobReadInfo blobReadInfo = null; try { if (!map.containsKey(blobId)) { throw new CloudStorageException("Blob with blobId " + blobId.getID() + " does not exist."); } byte[] blobData = map.get(blobId).getSecond(); outputStream.write(blobData); } catch (IOException ex) { throw new CloudStorageException( "Could not download blob for blobid " + blobId.getID() + " due to " + ex.toString()); } }
Source:
<code>public Obs saveObs(Obs obs) throws APIException { try { String fileName = obs.getComplexData().getTitle(); File outfile = getOutputFileToWrite(obs); OutputStream out = new FileOutputStream(outfile, false); FileInputStream mediaStream = (FileInputStream) obs.getComplexData().getData(); OpenmrsUtil.copyFile(mediaStream, out); obs.setComplexData(null); <START> obs.setValueComplex(fileName + "|" + outfile.getName()); <END> out.close(); } catch (IOException ioe) { throw new APIException("Trying to write complex obs to the file system. ", ioe); } return obs; }</code><technical_language>This results in **myAudi.mp3 | myAudio.mp3**, segment human readable title, making filename extension</technical_language>

Target:
public Obs saveObs(Obs obs) throws APIException { try { String fileName = obs.getComplexData().getTitle(); File outfile = getOutputFileToWrite(obs); OutputStream out = new FileOutputStream(outfile, false); FileInputStream mediaStream = (FileInputStream) obs.getComplexData().getData(); OpenmrsUtil.copyFile(mediaStream, out); obs.setComplexData(null); obs.setValueComplex(FilenameUtils.removeExtension(fileName) + "|" + outfile.getName()); out.close(); } catch (IOException ioe) { throw new APIException("Trying to write complex obs to the file system. ", ioe); } return obs; }
Source:
<code>private boolean isLibrbdAvailable() { if (!CINDERStorageHelper.isLibrbdAvailable(getVds())) { log.error("Couldn't found librbd1 package on vds (needed for Cinder storage domains).", getVds().getName()); <START> setNonOperational(NonOperationalReason.LIBRBD_PACKAGE_NOT_AVAILABLE, getVds()); <END> return false; } return true; }</code><technical_language>need migrate VMs Host operational. Gluster? worth call here: runInternalAction(VdcActionType.SetNonOperationalVds)</technical_language>

Target:
private boolean isLibrbdAvailable() { if (!CINDERStorageHelper.isLibrbdAvailable(getVds())) { log.error("Couldn't found librbd1 package on vds (needed for Cinder storage domains).", getVds().getName()); setNonOperational(NonOperationalReason.LIBRBD_PACKAGE_NOT_AVAILABLE); return false; } return true; }
Source:
<code>private void initSMSButton() { Pattern p = Pattern.compile(".*[a-zA-Z].*"); Matcher m = p.matcher(parentWindow.getCurrentSearchText()); <START> if(parentWindow.hasOperationSet(OperationSetSmsMessaging.class) <END> && !m.find()) { if (smsButton != null && smsButton.getParent() != null) return; smsButton = new JButton(GuiActivator.getResources() .getI18NString("service.gui.SEND_SMS")); smsButton.setIcon(GuiActivator.getResources() .getImage("service.gui.icons.SMS_BUTTON_ICON")); buttonPanel.add(smsButton); smsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final String searchText = parentWindow.getCurrentSearchText(); if(searchText == null) return; SMSManager.sendSMS(smsButton, searchText); } }); } else { if(smsButton != null) buttonPanel.remove(smsButton); } }</code><technical_language>isAlpha</technical_language>

Target:
private void initSMSButton() { if(parentWindow.hasOperationSet(OperationSetSmsMessaging.class) && !StringUtils.isAlpha(parentWindow.getCurrentSearchText())) { if (smsButton != null && smsButton.getParent() != null) return; smsButton = new JButton(GuiActivator.getResources() .getI18NString("service.gui.SEND_SMS")); smsButton.setIcon(GuiActivator.getResources() .getImage("service.gui.icons.SMS_BUTTON_ICON")); buttonPanel.add(smsButton); smsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final String searchText = parentWindow.getCurrentSearchText(); if(searchText == null) return; SMSManager.sendSMS(smsButton, searchText); } }); } else { if(smsButton != null) buttonPanel.remove(smsButton); } }
Source:
<code>public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { return false; } final Player player = getPlayer(args[0]); if (player == null) { playerMsg(TFM_Command.PLAYER_NOT_FOUND, ChatColor.RED); return true; } String reason = null; if (args.length >= 2) { reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); } TFM_Util.adminAction(sender.getName(), "Kicking " + player.getName() + " from the server", true); <START> sender.sendMessage(ChatColor.RED + "Kicked: " + player.getName()); <END> player.setOp(false); final Location targetPos = player.getLocation(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(targetPos.getWorld(), targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); targetPos.getWorld().strikeLightning(strike_pos); } } player.kickPlayer(ChatColor.RED + "You have been kicked from the server" + (reason != null ? ("\nReason: " + ChatColor.YELLOW + reason) : "")); return true; }</code><technical_language>@rsajeey Done</technical_language>

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { return false; } final Player player = getPlayer(args[0]); if (player == null) { playerMsg(TFM_Command.PLAYER_NOT_FOUND, ChatColor.RED); return true; } String reason = null; if (args.length >= 2) { reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); } TFM_Util.adminAction(sender.getName(), "Kicking " + player.getName() + " from the server", true); playerMsg(ChatColor.RED + "Kicked: " + player.getName()); player.kickPlayer(ChatColor.RED + "You have been kicked from the server" + (reason != null ? ("\nReason: " + ChatColor.YELLOW + reason) : "")); return true; }
Source:
<code>public Object visitSizeCommand(InvocationContext ctx, SizeCommand command) throws Throwable { Set<Flag> flags = command.getFlags(); int size = 0; AdvancedCache decoratedCache = cache.getAdvancedCache(); if (flags != null) { decoratedCache = decoratedCache.withFlags(flags.toArray(new Flag[flags.size()])); } return (int) decoratedCache.cacheEntrySet().stream() .filter(CacheFilters.predicate(Tombstone.EXCLUDE_TOMBSTONES)) <START> .count(); <END> }</code><technical_language>(int) cast overflow, Math.min(Integer.MAX_VALUE, (...).count()) Math.toIntExact(...)</technical_language>

Target:
public Object visitSizeCommand(InvocationContext ctx, SizeCommand command) throws Throwable { Set<Flag> flags = command.getFlags(); int size = 0; AdvancedCache decoratedCache = cache.getAdvancedCache(); if (flags != null) { decoratedCache = decoratedCache.withFlags(flags.toArray(new Flag[flags.size()])); } return Math.min(Integer.MAX_VALUE, (int) decoratedCache.cacheEntrySet().stream() .filter(CacheFilters.predicate(Tombstone.EXCLUDE_TOMBSTONES)) .count()); }
Source:
<code>private StructType toStructType(TStructDescriptor struct) { List<Field> fields = struct.getFields(); List<ThriftField> children = new ArrayList<ThriftField>(fields.size()); for (int i = 0; i < fields.size(); i++) { Field field = fields.get(i); Requirement req = field.getFieldMetaData() == null ? Requirement.OPTIONAL : Requirement.fromType(field.getFieldMetaData().requirementType); children.add(toThriftField(field.getName(), field, req)); } <START> return new StructType(children, TBaseUtil.isUnion(struct.getThriftClass())); <END> }</code><technical_language>I need a TBaseUtil declare "isUnion" private in this class. I try avoid "Util" classes. moved if some other class needs it</technical_language>

Target:
private StructType toStructType(TStructDescriptor struct) { List<Field> fields = struct.getFields(); List<ThriftField> children = new ArrayList<ThriftField>(fields.size()); for (int i = 0; i < fields.size(); i++) { Field field = fields.get(i); Requirement req = field.getFieldMetaData() == null ? Requirement.OPTIONAL : Requirement.fromType(field.getFieldMetaData().requirementType); children.add(toThriftField(field.getName(), field, req)); } return new StructType(children, structOrUnionType(struct.getThriftClass())); }
Source:
<code>public void shouldStartAllModules() throws Exception { SimpleObject deserialized = deserialize(handle(newPostRequest(getURI(), "{\"action\":\"start\", \"allModules\":\"true\"}"))); <START> for (Module loadedModule : mockModuleFactory.loadedModules) { <END> assertThat(mockModuleFactory.startedModules, hasItem(loadedModule)); } }</code><technical_language>assert post, modules started</technical_language>

Target:
public void shouldStartAllModules() throws Exception { assertThat(mockModuleFactory.startedModules, emptyCollectionOf(Module.class)); deserialize(handle(newPostRequest(getURI(), "{\"action\":\"start\", \"allModules\":\"true\"}"))); for (Module loadedModule : mockModuleFactory.loadedModules) { assertThat(mockModuleFactory.startedModules, hasItem(loadedModule)); } }
Source:
<code>protected static void initSumDoubleValues(String tableName, byte[][] splits, String url) throws Exception { <START> ensureTableCreated(url, tableName, "SumDoubleTest", splits); <END> Properties props = new Properties(); Connection conn = DriverManager.getConnection(url, props); try { PreparedStatement stmt = conn.prepareStatement( "upsert into " + tableName + "(" + " id, " + " d, " + " f, " + " ud, " + " uf) " + "VALUES (?, ?, ?, ?, ?)"); stmt.setString(1, "1"); stmt.setDouble(2, 0.001); stmt.setFloat(3, 0.01f); stmt.setDouble(4, 0.001); stmt.setFloat(5, 0.01f); stmt.execute(); stmt.setString(1, "2"); stmt.setDouble(2, 0.002); stmt.setFloat(3, 0.02f); stmt.setDouble(4, 0.002); stmt.setFloat(5, 0.02f); stmt.execute(); stmt.setString(1, "3"); stmt.setDouble(2, 0.003); stmt.setFloat(3, 0.03f); stmt.setDouble(4, 0.003); stmt.setFloat(5, 0.03f); stmt.execute(); stmt.setString(1, "4"); stmt.setDouble(2, 0.004); stmt.setFloat(3, 0.04f); stmt.setDouble(4, 0.004); stmt.setFloat(5, 0.04f); stmt.execute(); stmt.setString(1, "5"); stmt.setDouble(2, 0.005); stmt.setFloat(3, 0.05f); stmt.setDouble(4, 0.005); stmt.setFloat(5, 0.05f); stmt.execute(); conn.commit(); } finally { conn.close(); } }</code><technical_language>Minor nit: Define a static constant for SumDoubleTest other table ddl types</technical_language>

Target:
protected static void initSumDoubleValues(String tableName, byte[][] splits, String url) throws Exception { ensureTableCreated(url, tableName, SUM_DOUBLE_NAME, splits); Properties props = new Properties(); Connection conn = DriverManager.getConnection(url, props); try { PreparedStatement stmt = conn.prepareStatement( "upsert into " + tableName + "(" + " id, " + " d, " + " f, " + " ud, " + " uf) " + "VALUES (?, ?, ?, ?, ?)"); stmt.setString(1, "1"); stmt.setDouble(2, 0.001); stmt.setFloat(3, 0.01f); stmt.setDouble(4, 0.001); stmt.setFloat(5, 0.01f); stmt.execute(); stmt.setString(1, "2"); stmt.setDouble(2, 0.002); stmt.setFloat(3, 0.02f); stmt.setDouble(4, 0.002); stmt.setFloat(5, 0.02f); stmt.execute(); stmt.setString(1, "3"); stmt.setDouble(2, 0.003); stmt.setFloat(3, 0.03f); stmt.setDouble(4, 0.003); stmt.setFloat(5, 0.03f); stmt.execute(); stmt.setString(1, "4"); stmt.setDouble(2, 0.004); stmt.setFloat(3, 0.04f); stmt.setDouble(4, 0.004); stmt.setFloat(5, 0.04f); stmt.execute(); stmt.setString(1, "5"); stmt.setDouble(2, 0.005); stmt.setFloat(3, 0.05f); stmt.setDouble(4, 0.005); stmt.setFloat(5, 0.05f); stmt.execute(); conn.commit(); } finally { conn.close(); } }
Source:
<code>public boolean shouldReportRequestLog(){ <START> if (requestType.equals(RequestTypeUpLog)){ <END> return false; } else { return true; } }</code><technical_language>return !requestType.equals(RequestTypeUpLog);</technical_language>

Target:
boolean shouldReportRequestLog(){ return requestType.equals(RequestTypeUpLog); }
Source:
<code>public ICPPTemplateParameter[] getTemplateParameters() { if (fTemplateParameters == null) { try { IASTNode point = null; <START> fTemplateParameters = CPPTemplates.specializeTemplateParameters(this, (ICPPScope) getScope(), <END> super.getTemplateParameters(), getOwner(), point); } catch (DOMException e) { CCorePlugin.log(e); } } return fTemplateParameters; }</code><technical_language>is unfortunate specialize template parameters in a place in code supply a specialization point. this specialization happen in some other place</technical_language>

Target:
public ICPPTemplateParameter[] getTemplateParameters() { return fTemplateParameters; }
Source:
<code>public void finish() { super.finish(); overridePendingTransition(0, R.anim.slide_out_from_top); <START> presentationManager.stopPlayer(); <END> textToSpeechManager.shutdown(); }</code><technical_language>nit: stopPlayer() more sense inlining MediaPlayer directly. I stopPresentation() is a API name name</technical_language>

Target:
public void finish() { super.finish(); overridePendingTransition(0, R.anim.slide_out_from_top); presentationManager.stopPresentation(); textToSpeechManager.shutdown(); }
Source:
<code>public void removePolicy(String path, AccessControlPolicy policy) throws PathNotFoundException, AccessControlException, AccessDeniedException, LockException, VersionException, RepositoryException { if (session.isReadOnly()) { <START> throw new AccessDeniedException(""); <END> } try { if (!hasPrivileges(path, new Privilege[]{privileges.forName(Privilege.JCR_MODIFY_ACCESS_CONTROL)})) { throw new AccessDeniedException(); } Node node = session.getNode(path); if (node.hasNode(ACCESS_LIST_NODE)) { Node aclNode = node.getNode(ACCESS_LIST_NODE); aclNode.remove(); node.removeMixin(NT_ACCESS_CONTROLLABLE); } } catch (PathNotFoundException e) { } }</code><technical_language>I18n for this</technical_language>

Target:
public void removePolicy(String path, AccessControlPolicy policy) throws PathNotFoundException, AccessControlException, AccessDeniedException, LockException, VersionException, RepositoryException { if (session.isReadOnly()) { throw new AccessDeniedException(JcrI18n.permissionDenied.text(path, "read AC content")); } try { if (!hasPrivileges(path, new Privilege[]{privileges.forName(Privilege.JCR_MODIFY_ACCESS_CONTROL)})) { throw new AccessDeniedException(); } Node node = session.getNode(path); if (node.hasNode(ACCESS_LIST_NODE)) { Node aclNode = node.getNode(ACCESS_LIST_NODE); aclNode.remove(); node.removeMixin(NT_ACCESS_CONTROLLABLE); } } catch (PathNotFoundException e) { } }
Source:
<code>public void testDeleteFromListColumnIndexTable() { ColumnModel intColumn = new ColumnModel(); intColumn.setId("12"); intColumn.setName("foo"); intColumn.setColumnType(ColumnType.INTEGER); ColumnModel stringListColumn = new ColumnModel(); stringListColumn.setId("15"); stringListColumn.setName("myList"); stringListColumn.setMaximumSize(54L); stringListColumn.setColumnType(ColumnType.STRING_LIST); ColumnModel booleanColumn = new ColumnModel(); booleanColumn.setId("13"); booleanColumn.setName("bar"); booleanColumn.setColumnType(ColumnType.BOOLEAN); List<ColumnModel> schema = Lists.newArrayList(intColumn, stringListColumn ,booleanColumn); createOrUpdateTable(schema, tableId, isView); int numRows = 5; List<Row> rows = TableModelTestUtils.createRows(schema, numRows); createOrUpdateOrDeleteRows(tableId, rows, schema); tableIndexDAO.populateListColumnIndexTable(tableId, stringListColumn, null); <START> String listColumnindexTableName = SQLUtils.getTableNameForMultiValueColumnIndex(tableId, stringListColumn.getId()); <END> assertEquals(numRows * 2, tableIndexDAO.countQuery("SELECT COUNT(*) FROM `" + listColumnindexTableName + "`", Collections.emptyMap())); tableIndexDAO.deleteFromListColumnIndexTable(tableId, stringListColumn, Sets.newHashSet(rows.get(0).getRowId(), rows.get(2).getRowId())); assertEquals((numRows-2) * 2, tableIndexDAO.countQuery("SELECT COUNT(*) FROM `" + listColumnindexTableName + "`", Collections.emptyMap())); }</code><technical_language>helper for counts</technical_language>

Target:
public void testDeleteFromListColumnIndexTable() { ColumnModel intColumn = new ColumnModel(); intColumn.setId("12"); intColumn.setName("foo"); intColumn.setColumnType(ColumnType.INTEGER); ColumnModel stringListColumn = new ColumnModel(); stringListColumn.setId("15"); stringListColumn.setName("myList"); stringListColumn.setMaximumSize(54L); stringListColumn.setColumnType(ColumnType.STRING_LIST); ColumnModel booleanColumn = new ColumnModel(); booleanColumn.setId("13"); booleanColumn.setName("bar"); booleanColumn.setColumnType(ColumnType.BOOLEAN); List<ColumnModel> schema = Lists.newArrayList(intColumn, stringListColumn ,booleanColumn); createOrUpdateTable(schema, tableId, isView); int numRows = 5; List<Row> rows = TableModelTestUtils.createRows(schema, numRows); createOrUpdateOrDeleteRows(tableId, rows, schema); tableIndexDAO.populateListColumnIndexTable(tableId, stringListColumn, null); assertEquals(numRows * 2, countRowsInMultiValueIndex(tableId, stringListColumn.getId())); tableIndexDAO.deleteFromListColumnIndexTable(tableId, stringListColumn, Sets.newHashSet(rows.get(0).getRowId(), rows.get(2).getRowId())); assertEquals((numRows-2) * 2, countRowsInMultiValueIndex(tableId, stringListColumn.getId())); }
Source:
<code>public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars initialEnvironment) throws IOException, InterruptedException { FilePath configFile = workspace.createTempFile(".kube", "config"); launcher.launch() .cmdAsSingleString("kubectl config --kubeconfig=" + configFile.getRemote() + " set-cluster k8s --server=" + serverUrl + " --insecure-skip-tls-verify=true") .join(); <START> final UsernamePasswordCredentials c = getCredentials(credentialsId); <END> launcher.launch() .cmdAsSingleString("kubectl config --kubeconfig=" + configFile.getRemote() + " set-credentials cluster-admin --username=" + c.getUsername() + " --password=" + Secret.toString(c.getPassword())) .masks(false, false, false, false, false, false, true) .join(); launcher.launch() .cmdAsSingleString("kubectl config --kubeconfig=" + configFile.getRemote() + " set-context k8s --cluster=k8s --user=cluster-admin") .join(); launcher.launch() .cmdAsSingleString("kubectl config --kubeconfig=" + configFile.getRemote() + " use-context k8s") .join(); context.setDisposer(new CleanupDisposer(configFile)); context.env("KUBECONFIG", configFile.getRemote()); }</code><technical_language>credentialsId is a class property. Do need pass getCredentials method</technical_language>

Target:
public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars initialEnvironment) throws IOException, InterruptedException { FilePath configFile = workspace.createTempFile(".kube", "config"); int status = launcher.launch() .cmdAsSingleString("kubectl config --kubeconfig=" + configFile.getRemote() + " set-cluster k8s --server=" + serverUrl + " --insecure-skip-tls-verify=true") .join(); if (status != 0) throw new IOException("Failed to run kubectl config "+status); final UsernamePasswordCredentials c = getCredentials(); status = launcher.launch() .cmdAsSingleString("kubectl config --kubeconfig=" + configFile.getRemote() + " set-credentials cluster-admin --username=" + c.getUsername() + " --password=" + Secret.toString(c.getPassword())) .masks(false, false, false, false, false, false, true) .join(); if (status != 0) throw new IOException("Failed to run kubectl config "+status); status = launcher.launch() .cmdAsSingleString("kubectl config --kubeconfig=" + configFile.getRemote() + " set-context k8s --cluster=k8s --user=cluster-admin") .join(); if (status != 0) throw new IOException("Failed to run kubectl config "+status); status = launcher.launch() .cmdAsSingleString("kubectl config --kubeconfig=" + configFile.getRemote() + " use-context k8s") .join(); if (status != 0) throw new IOException("Failed to run kubectl config "+status); context.setDisposer(new CleanupDisposer(configFile.getRemote())); context.env("KUBECONFIG", configFile.getRemote()); }
Source:
<code><START> public DeletedHandler(final EMOperation completeOp) { <END> this.completeOp = completeOp; }</code><technical_language>need public</technical_language>

Target:
DeletedHandler(final EMOperation completeOp) { this.completeOp = completeOp; }
Source:
<code>public void addPages(MavenPomEditor pomEditor) { ITextEditor sourcePage = new MavenStructuredSourceTextEditor(pomEditor); try { int dex = pomEditor.addPage(pomEditor.getEffectivePomSourcePage(), pomEditor.getEffectivePomEditorInput()); pomEditor.setPageText(dex, pomEditor.EFFECTIVE_POM); int sourcePageIndex = pomEditor.addPage(sourcePage, pomEditor.getEditorInput()); pomEditor.setPageText(sourcePageIndex, "TEST"); IDocument sourceDocument = sourcePage.getDocumentProvider().getDocument(pomEditor.getEditorInput()); IDocumentListener documentListener = new IDocumentListener() { public void documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent event) { } public void documentChanged(org.eclipse.jface.text.DocumentEvent event) { try { pomEditor.getPomFile().refreshLocal(IResource.DEPTH_INFINITE, null); } catch(CoreException e) { log.error(e.getMessage(), e); } if (pomEditor.isCheckedWritableStatus() && pomEditor.isReadOnly()) { pomEditor.setCheckedWritableStatus(false); } } }; sourceDocument.addDocumentListener(documentListener); IDOMModel structuredModel = (IDOMModel) pomEditor.getModelManager().getExistingModelForEdit(sourceDocument); <START> if(structuredModel == null) { <END> pomEditor.setStructuredModel( (IDOMModel) pomEditor.getModelManager().getModelForEdit((IStructuredDocument) sourceDocument)); } } catch(PartInitException ex) { log.error(ex.getMessage(), ex); } }</code><technical_language>thing, redundant some interals of MavenPomEditor</technical_language>

Target:
public void addPages(MavenPomEditor pomEditor) { ITextEditor sourcePage = new MavenStructuredSourceTextEditor(pomEditor); ITextEditor effectPomPage = new MavenStructuredSourceTextEditor(pomEditor); try { int dex = pomEditor.addPage(effectPomPage, pomEditor.getEffectivePomEditorInput()); pomEditor.setPageText(dex, MavenPomEditor.EFFECTIVE_POM); pomEditor.setEffectivePomSourcePage(effectPomPage); int sourcePageIndex = pomEditor.addPage(sourcePage, pomEditor.getEditorInput()); pomEditor.setPageText(sourcePageIndex, MavenPomEditor.POM_XML); pomEditor.setSourcePage(sourcePage); IDocument sourceDocument = sourcePage.getDocumentProvider().getDocument(pomEditor.getEditorInput()); IDocumentListener documentListener = new IDocumentListener() { public void documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent event) { } public void documentChanged(org.eclipse.jface.text.DocumentEvent event) { try { pomEditor.getPomFile().refreshLocal(IResource.DEPTH_INFINITE, null); } catch (CoreException e) { log.error(e.getMessage(), e); } if (pomEditor.isCheckedWritableStatus() && pomEditor.isReadOnly()) { pomEditor.setCheckedWritableStatus(false); } } }; sourceDocument.addDocumentListener(documentListener); pomEditor.setStructuredModel( (IDOMModel) pomEditor.getModelManager().getModelForEdit((IStructuredDocument) sourceDocument)); } catch (PartInitException ex) { log.error(ex.getMessage(), ex); } }
Source:
<code>private String getConnectionString(IPath dbPath) { IPreferencesService preferencesService = Platform .getPreferencesService(); StringBuilder buf = new StringBuilder("jdbc:h2:").append(dbPath.append( DB_NAME).toOSString()); buf.append(";UNDO_LOG=0"); buf.append(";LOCK_MODE=").append( preferencesService.getInt(H2Index.PLUGIN_ID, H2IndexPreferences.DB_LOCK_MODE, 0, null)); buf.append(";CACHE_TYPE=").append( preferencesService.getString(H2Index.PLUGIN_ID, H2IndexPreferences.DB_CACHE_TYPE, null, null)); buf.append(";CACHE_SIZE=").append( preferencesService.getInt(H2Index.PLUGIN_ID, H2IndexPreferences.DB_CACHE_SIZE, 0, null)); buf.append(";QUERY_CACHE_SIZE=").append( preferencesService.getInt(H2Index.PLUGIN_ID, H2IndexPreferences.DB_QUERY_CACHE_SIZE, 0, null)); buf.append(";LARGE_RESULT_BUFFER_SIZE=").append( preferencesService .getInt(H2Index.PLUGIN_ID, H2IndexPreferences.DB_LARGE_RESULT_BUFFER_SIZE, 0, null)); <START> buf.append(";FILE_LOCK=").append( <END> preferencesService.getString(H2Index.PLUGIN_ID, H2IndexPreferences.DB_FILE_LOCK, "", null)); SqlIndex.warn(buf.toString()); return buf.toString(); }</code><technical_language>FILE_LOCK=NO put IMHO, is is tune it</technical_language>

Target:
private String getConnectionString(IPath dbPath) { IPreferencesService preferencesService = Platform .getPreferencesService(); StringBuilder buf = new StringBuilder("jdbc:h2:").append(dbPath.append( DB_NAME).toOSString()); buf.append(";UNDO_LOG=0"); buf.append(";LOCK_MODE=").append( preferencesService.getInt(H2Index.PLUGIN_ID, H2IndexPreferences.DB_LOCK_MODE, 0, null)); buf.append(";CACHE_TYPE=").append( preferencesService.getString(H2Index.PLUGIN_ID, H2IndexPreferences.DB_CACHE_TYPE, null, null)); buf.append(";CACHE_SIZE=").append( preferencesService.getInt(H2Index.PLUGIN_ID, H2IndexPreferences.DB_CACHE_SIZE, 0, null)); buf.append(";QUERY_CACHE_SIZE=").append( preferencesService.getInt(H2Index.PLUGIN_ID, H2IndexPreferences.DB_QUERY_CACHE_SIZE, 0, null)); buf.append(";LARGE_RESULT_BUFFER_SIZE=").append( preferencesService .getInt(H2Index.PLUGIN_ID, H2IndexPreferences.DB_LARGE_RESULT_BUFFER_SIZE, 0, null)); buf.append(";FILE_LOCK=NO"); return buf.toString(); }