auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public DepositRecord createDepositRecord(PID pid, Model model) throws FedoraException { <END> PID newPid = pidMinter.mintDepositRecordPid(); DepositRecord depositRecord = new DepositRecord(newPid, repoObjLoader, repoObjDataLoader, this); return depositRecord; }</code><technical_language>signatures good, I wondering work of creating object in fedora is moving to? in methods in another class. someones do dirty work in fedora api</technical_language>

Target:
public DepositRecord createDepositRecord(PID pid, Model model) throws FedoraException { URI path = pid.getRepositoryUri(); model = populateModelTypes(path, model, Arrays.asList(Cdr.DepositRecord)); try (FcrepoResponse response = getClient().put(path) .body(RDFModelUtil.streamModel(model), TURTLE_MIMETYPE) .perform()) { URI createdUri = response.getLocation(); ldpFactory.createDirectContainer(createdUri, Cdr.hasManifest, RepositoryPathConstants.DEPOSIT_MANIFEST_CONTAINER); addEventContainer(createdUri); } catch (IOException e) { throw new FedoraException("Unable to create deposit record at " + path, e); } catch (FcrepoOperationFailedException e) { throw ClientFaultResolver.resolve(e); } DepositRecord depositRecord = new DepositRecord(pid, repoObjLoader, repoObjDataLoader, this); return depositRecord; }
Source:
<code>public ApkSignature(File openFile) { <START> super(); <END> this.openFile = openFile; }</code><technical_language>super() removed</technical_language>

Target:
public ApkSignature(File openFile) { this.openFile = openFile; }
Source:
<code>public void testSimple() throws Exception { final ModelConverter mr = modelResolver(); final Model model = mr.resolve(XmlDecoratedBean.class, new ModelConverterContextImpl(mr), null); assertTrue(model instanceof ModelImpl); final ModelImpl impl = (ModelImpl) model; final Xml xml = impl.getXml(); assertNotNull(xml); assertEquals(xml.getName(), "xmlDecoratedBean"); final ArrayProperty property = (ArrayProperty)impl.getProperties().get("items"); assertNotNull(property); final Xml propertyXml = property.getXml(); assertNotNull(propertyXml); assertEquals(propertyXml.getName(), "items"); assertTrue(propertyXml.getWrapped()); <START> final Xml itemsXml = property.getItems().getXml(); <END> assertNotNull(itemsXml); assertEquals(itemsXml.getName(), "item"); assertNotNull(impl.getProperties().get("elementC")); }</code><technical_language>@webron is this correct? _wrapped_ name items XML property item? I opposite, staying XML-land</technical_language>

Target:
public void testSimple() throws Exception { final ModelConverter mr = modelResolver(); final Model model = mr.resolve(XmlDecoratedBean.class, new ModelConverterContextImpl(mr), null); assertTrue(model instanceof ModelImpl); final ModelImpl impl = (ModelImpl) model; final Xml xml = impl.getXml(); assertNotNull(xml); assertEquals(xml.getName(), "xmlDecoratedBean"); final ArrayProperty property = (ArrayProperty)impl.getProperties().get("elements"); assertNotNull(property); final Xml propertyXml = property.getXml(); assertNotNull(propertyXml); assertNull(propertyXml.getName()); assertTrue(propertyXml.getWrapped()); final Xml itemsXml = property.getItems().getXml(); assertNotNull(itemsXml); assertEquals(itemsXml.getName(), "element"); assertNotNull(impl.getProperties().get("elementC")); }
Source:
<code>protected void ExecuteIrsBrokerCommand() { uuidReturn = getIrsProxy().mergeSnapshots(getParameters().getStorageDomainId().toString(), getParameters().getStoragePoolId().toString(), getParameters().getVmId().toString(), getParameters().getImageGroupId().toString(), getParameters().getImageId().toString(), getParameters().getImageId2().toString(), (Boolean.valueOf(getParameters().getPostZero())).toString().toLowerCase()); <START> <END> ProceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.mUuid); getVDSReturnValue() .setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.mergeSnapshots, getParameters() .getStoragePoolId())); }</code><technical_language>Instead of Boolean.valueOf(boolean).toString(), String.valueOf(boolean)</technical_language>

Target:
protected void ExecuteIrsBrokerCommand() { uuidReturn = getIrsProxy().mergeSnapshots(getParameters().getStorageDomainId().toString(), getParameters().getStoragePoolId().toString(), getParameters().getVmId().toString(), getParameters().getImageGroupId().toString(), getParameters().getImageId().toString(), getParameters().getImageId2().toString(), String.valueOf(getParameters().getPostZero()).toLowerCase()); ProceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.mUuid); getVDSReturnValue() .setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.mergeSnapshots, getParameters() .getStoragePoolId())); }
Source:
<code>public void registerModelAdapter(Class<?> adapterType, Object adapter) { <START> if (DsfDebugOptions.DEBUG && DsfDebugOptions.DEBUG_SESSION && DsfDebugOptions.DEBUG_SESSION_MODEL_ADAPTERS) { <END> String msg = new Formatter().format( "%s Registering model adapter %s of type %s to session %s (%s)", DsfPlugin.getDebugTime(), LoggingUtils.toString(adapter), adapterType.getName(), LoggingUtils.toString(this), getId() ).toString(); DsfDebugOptions.trace(msg); } fAdapters.put(adapterType, adapter); }</code><technical_language>DsfDebugOptions... mentioned</technical_language>

Target:
public void registerModelAdapter(Class<?> adapterType, Object adapter) { if (DsfDebugOptions.DEBUG_SESSION_MODEL_ADAPTERS) { String msg = new Formatter().format( "%s Registering model adapter %s of type %s to session %s (%s)", DsfPlugin.getDebugTime(), LoggingUtils.toString(adapter), adapterType.getName(), LoggingUtils.toString(this), getId() ).toString(); DsfDebugOptions.trace(msg); } fAdapters.put(adapterType, adapter); }
Source:
<code>Map<String, String> getAPITypeParameters() throws BonitaHomeNotSetException, ServerAPIException { Map<String, String> parameters; try { parameters = APITypeManager.getAPITypeParameters(); } catch (IOException e) { throw new ServerAPIException(e); } <START> return parameters; <END> }</code><technical_language>great return empty map instead of null</technical_language>

Target:
protected Map<String, String> getAPITypeParameters() throws BonitaHomeNotSetException, ServerAPIException { try { return APITypeManager.getAPITypeParameters(); } catch (IOException e) { throw new ServerAPIException(e); } }
Source:
<code>public Map<String, Map> hostDevListByCaps() { Map resultMap = getDoneStatus(); Map<String, Map> infoMap = map(); try { infoMap.put("computer", getCapability()); infoMap.put("pci_0000_00_1b_0", getHardware(0)); infoMap.put("pci_0000_00_1b_1", getHardware(1)); infoMap.put("pci_0000_00_1b_2", getHardware(2)); infoMap.put("pci_0000_00_1b_3", getHardware(3)); infoMap.put("pci_0000_00_1b_4", getHardware(4)); infoMap.put("pci_0000_00_1b_5", getHardware(5)); infoMap.put("pci_0000_00_1b_6", getHardware(6)); infoMap.put("pci_0000_00_1b_7", getHardware(7)); infoMap.put("pci_0000_00_1b_8", getHardware(8)); infoMap.put("pci_0000_00_1b_9", getHardware(9)); infoMap.put("pci_0000_00_1b_10", getHardware(10)); infoMap.put("pci_0000_00_1b_11", getHardware(11)); infoMap.put("pci_0000_00_1f_12", getHardware(12)); resultMap.put("info", infoMap); } catch <START> (NullPointerException e) <END> { log.error("getHostDevListByCaps failed due to {}", e); throw error(e); } finally { return resultMap; } }</code><technical_language>hiding a bug here</technical_language>

Target:
public Map<String, Map> hostDevListByCaps() { Map resultMap = getDoneStatus(); Map<String, Map> infoMap = map(); infoMap.put("computer", getCapability()); infoMap.put("pci_0000_00_1b_0", getHardware(0)); infoMap.put("pci_0000_00_1b_1", getHardware(1)); infoMap.put("pci_0000_00_1b_2", getHardware(2)); infoMap.put("pci_0000_00_1b_3", getHardware(3)); infoMap.put("pci_0000_00_1b_4", getHardware(4)); infoMap.put("pci_0000_00_1b_5", getHardware(5)); infoMap.put("pci_0000_00_1b_6", getHardware(6)); infoMap.put("pci_0000_00_1b_7", getHardware(7)); infoMap.put("pci_0000_00_1b_8", getHardware(8)); infoMap.put("pci_0000_00_1b_9", getHardware(9)); infoMap.put("pci_0000_00_1b_10", getHardware(10)); infoMap.put("pci_0000_00_1b_11", getHardware(11)); infoMap.put("pci_0000_00_1f_12", getHardware(12)); resultMap.put("info", infoMap); return resultMap; }
Source:
<code>public void testGetCompletionTimesTwoFragmentInteractionP2PAsync() { Trace trace1 = new Trace(); trace1.setId("1_2ip2pasync"); trace1.setStartTime(System.currentTimeMillis() - 60000); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(TimeUnit.NANOSECONDS.convert(3000, TimeUnit.MILLISECONDS)); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.setUri("testuri2"); p1.setBaseTime(TimeUnit.NANOSECONDS.convert(500, TimeUnit.MILLISECONDS)); p1.setDuration(TimeUnit.NANOSECONDS.convert(500, TimeUnit.MILLISECONDS)); p1.addInteractionCorrelationId("cid1_2ip2pasync"); c1.getNodes().add(p1); Trace trace2 = new Trace(); trace2.setId("2_2ip2pasync"); trace2.setStartTime(trace1.getStartTime() + 500); Consumer c2 = new Consumer(); c2.setUri("testuri2"); c2.setDuration(TimeUnit.NANOSECONDS.convert(4000, TimeUnit.MILLISECONDS)); c2.addInteractionCorrelationId("cid1_2ip2pasync"); trace2.getNodes().add(c2); try { publisher.publish(null, Arrays.asList(trace1, trace2)); } catch (Exception e1) { <START> fail("Failed to store: " + e1); <END> } Wait.until(() -> service.searchFragments(null, new Criteria()).size() == 2); Wait.until(() -> analytics.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analytics.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(4500, times.get(0).getDuration()); }</code><technical_language>This a test error</technical_language>

Target:
public void testGetCompletionTimesTwoFragmentInteractionP2PAsync() throws Exception { Trace trace1 = new Trace(); trace1.setId("1_2ip2pasync"); trace1.setStartTime(System.currentTimeMillis() - 60000); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(TimeUnit.NANOSECONDS.convert(3000, TimeUnit.MILLISECONDS)); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.setUri("testuri2"); p1.setBaseTime(TimeUnit.NANOSECONDS.convert(500, TimeUnit.MILLISECONDS)); p1.setDuration(TimeUnit.NANOSECONDS.convert(500, TimeUnit.MILLISECONDS)); p1.addInteractionCorrelationId("cid1_2ip2pasync"); c1.getNodes().add(p1); Trace trace2 = new Trace(); trace2.setId("2_2ip2pasync"); trace2.setStartTime(trace1.getStartTime() + 500); Consumer c2 = new Consumer(); c2.setUri("testuri2"); c2.setDuration(TimeUnit.NANOSECONDS.convert(4000, TimeUnit.MILLISECONDS)); c2.addInteractionCorrelationId("cid1_2ip2pasync"); trace2.getNodes().add(c2); publisher.publish(null, Arrays.asList(trace1, trace2)); Wait.until(() -> service.searchFragments(null, new Criteria()).size() == 2); Wait.until(() -> analytics.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analytics.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(4500, times.get(0).getDuration()); }
Source:
<code>public void testPathParamEncoding() throws Exception { Invokable<?, ?> method = method(TestPath.class, "onePathEncodedParam", String.class); GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of("foo/bar"))); <START> assertRequestLineEquals(request, "GET http://localhost:9999/foo%2Fbar HTTP/1.1"); <END> }</code><technical_language>a more complex path in test verify fact entire path is encoded. need verify in tests too</technical_language>

Target:
public void testPathParamEncoding() throws Exception { Invokable<?, ?> method = method(TestPath.class, "onePath", String.class); GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of("foo/bar"))); assertRequestLineEquals(request, "GET http://localhost:9999/foo/bar HTTP/1.1"); request = processor.apply(Invocation.create(method, ImmutableList.<Object> of("foo%2Fbar"))); assertRequestLineEquals(request, "GET http://localhost:9999/foo%252Fbar HTTP/1.1"); method = method(TestPath.class, "encodedParams", String.class, String.class, String.class); request = processor.apply(Invocation.create(method, ImmutableList.<Object>of("encoded%2Fparam", "encode%2Fdouble", "foo%20bar"))); assertRequestLineEquals(request, "GET http://localhost:9999/encoded%2Fparam/encode%252Fdouble/foo%20bar HTTP/1.1"); }
Source:
<code>protected HttpMessage prepareRequestMessage(UsernamePasswordAuthenticationCredentials credentials) throws URIException, HttpMalformedHeaderException, DatabaseException { URI requestURI = createLoginUrl(loginRequestURL, credentials.getUsername(), credentials.getPassword()); String requestBody = null; if (loginRequestBody != null && !loginRequestBody.isEmpty()) { requestBody = replaceUserData(loginRequestBody, credentials.getUsername(), credentials.getPassword(), paramEncoder); } HttpMessage requestMessage; if (this.loginSiteNode != null) { requestMessage = loginSiteNode.getHistoryReference().getHttpMessage().cloneRequest(); requestMessage.getRequestHeader().setURI(requestURI); if (requestBody != null) { requestMessage.getRequestBody().setBody(requestBody); requestMessage.getRequestHeader().setHeader(HttpHeader.CONTENT_LENGTH, null); <START> replaceAntiCsrfTokenAndCookieValueIfRequired(requestMessage); <END> } } else { String method = (requestBody != null) ? HttpRequestHeader.POST : HttpRequestHeader.GET; requestMessage = new HttpMessage(); requestMessage.setRequestHeader( new HttpRequestHeader(method, requestURI, HttpHeader.HTTP10, Model.getSingleton().getOptionsParam().getConnectionParam())); if (requestBody != null) { requestMessage.getRequestHeader().setHeader(HttpHeader.CONTENT_TYPE, contentType); requestMessage.getRequestBody().setBody(requestBody); } } return requestMessage; }</code><technical_language>This done a SiteNode. reason do this in authenticate instead</technical_language>

Target:
protected HttpMessage prepareRequestMessage(UsernamePasswordAuthenticationCredentials credentials) throws URIException, HttpMalformedHeaderException, DatabaseException { URI requestURI = createLoginUrl(loginRequestURL, credentials.getUsername(), credentials.getPassword()); String requestBody = null; if (loginRequestBody != null && !loginRequestBody.isEmpty()) { requestBody = replaceUserData(loginRequestBody, credentials.getUsername(), credentials.getPassword(), paramEncoder); } HttpMessage requestMessage; if (this.loginSiteNode != null) { requestMessage = loginSiteNode.getHistoryReference().getHttpMessage().cloneRequest(); requestMessage.getRequestHeader().setURI(requestURI); if (requestBody != null) { requestMessage.getRequestBody().setBody(requestBody); requestMessage.getRequestHeader().setHeader(HttpHeader.CONTENT_LENGTH, null); } } else { String method = (requestBody != null) ? HttpRequestHeader.POST : HttpRequestHeader.GET; requestMessage = new HttpMessage(); requestMessage.setRequestHeader( new HttpRequestHeader(method, requestURI, HttpHeader.HTTP10, Model.getSingleton().getOptionsParam().getConnectionParam())); if (requestBody != null) { requestMessage.getRequestHeader().setHeader(HttpHeader.CONTENT_TYPE, contentType); requestMessage.getRequestBody().setBody(requestBody); } } return requestMessage; }
Source:
<code>public <T> T findAndDelete(final Query<T> query) { FindAndModifyOptions options = new FindAndModifyOptions() <START> .remove(true) <END> .returnNew(false) .upsert(false); return findAndDelete(query, options); }</code><technical_language>lines redundant lines 291-293</technical_language>

Target:
public <T> T findAndDelete(final Query<T> query) { return findAndDelete(query, new FindAndModifyOptions()); }
Source:
<code>public void writeNoWrap(final IDocumentFragment fragment, final OutputStream out) throws IOException { final org.eclipse.jface.text.Document doc = new org.eclipse.jface.text.Document(); for (final INode child : fragment.children()) { writeNodeNoWrap(child, doc); } <START> final PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(out, "UTF-8")); <END> printWriter.print(doc.get()); printWriter.flush(); }</code><technical_language>extract method</technical_language>

Target:
public void writeNoWrap(final IDocumentFragment fragment, final OutputStream out) throws IOException { final org.eclipse.jface.text.Document doc = new org.eclipse.jface.text.Document(); for (final INode child : fragment.children()) { writeNodeNoWrap(child, doc); } writeToOutputStream(out, doc); }
Source:
<code>public DispatchRequest execute(LogInAction action, AsyncCallback<LogInResult> resultCallback, ExecuteCommand<LogInAction, LogInResult> executeCommand) { executeCommand.execute(action, resultCallback); <START> return new CompletedDispatchRequest(); <END> }</code><technical_language>return executeCommand.execute(action, resultCallback);</technical_language>

Target:
public DispatchRequest execute(LogInAction action, AsyncCallback<LogInResult> resultCallback, ExecuteCommand<LogInAction, LogInResult> executeCommand) { return executeCommand.execute(action, resultCallback); }
Source:
<code>protected final void disposeSaslServer() { <START> if (zooKeeperSaslServer != null) { <END> try { zooKeeperSaslServer.dispose(); } catch (Exception e) { LOG.debug("ignoring exception during SaslServer dispose", e); } zooKeeperSaslServer = null; } }</code><technical_language>I synchronisation this variable. is time I lifecycle well. setting **null** ...can fall NPE</technical_language>

Target:
protected final void disposeSaslServer() { if (zooKeeperSaslServer != null) { try { zooKeeperSaslServer.dispose(); } catch (SaslException e) { LOG.debug("ignoring exception during SaslServer dispose", e); } } }
Source:
<code>private boolean isEcho(String itemName, State state) { String ignoreEventSetKey = itemName + state.toString(); if (ignoreEventSet.contains(ignoreEventSetKey)) { ignoreEventSet.remove(ignoreEventSetKey); <START> logger.trace( <END> "We received this event (item='{}', state='{}') from Nest, so we don't send it back again -> ignore!", itemName, state); return true; } else { return false; } }</code><technical_language>increase Debug-Level</technical_language>

Target:
private boolean isEcho(String itemName, State state) { String ignoreEventSetKey = itemName + state.toString(); if (ignoreEventSet.contains(ignoreEventSetKey)) { ignoreEventSet.remove(ignoreEventSetKey); logger.debug( "We received this event (item='{}', state='{}') from Nest, so we don't send it back again -> ignore!", itemName, state); return true; } else { return false; } }
Source:
<code>public void completePluginConfigurationUpdate(PluginConfigurationUpdate update) { ConfigurationUpdateResponse response = configurationManager.executePluginConfigurationUpdate(update); Resource resource = update.getResource(); resource.setAgentSynchronizationNeeded(); <START> entityManager.remove(resource.getPluginConfiguration()); <END> setOrUpdatePluginConfiguration(resource, update.getConfiguration()); if (response.getStatus() == ConfigurationUpdateStatus.SUCCESS) { update.setStatus(ConfigurationUpdateStatus.SUCCESS); resource.setConnected(true); removeAnyExistingInvalidPluginConfigurationErrors(resource); entityManager.flush(); entityManager.merge(update); } else { handlePluginConfiguratonUpdateRemoteException(resource, response.getStatus().toString(), response.getErrorMessage()); update.setStatus(response.getStatus()); update.setErrorMessage(response.getErrorMessage()); } }</code><technical_language>leave in this em.remove()</technical_language>

Target:
public void completePluginConfigurationUpdate(PluginConfigurationUpdate update) { ConfigurationUpdateResponse response = configurationManager.executePluginConfigurationUpdate(update); Resource resource = update.getResource(); resource.setAgentSynchronizationNeeded(); setOrUpdatePluginConfiguration(resource, update.getConfiguration()); if (response.getStatus() == ConfigurationUpdateStatus.SUCCESS) { update.setStatus(ConfigurationUpdateStatus.SUCCESS); resource.setConnected(true); removeAnyExistingInvalidPluginConfigurationErrors(resource); entityManager.flush(); entityManager.merge(update); } else { handlePluginConfiguratonUpdateRemoteException(resource, response.getStatus().toString(), response.getErrorMessage()); update.setStatus(response.getStatus()); update.setErrorMessage(response.getErrorMessage()); } }
Source:
<code>public static YearMonthDateParameterMetadata of(LocalDate date, YearMonth yearMonth) { <START> ArgChecker.notNull(yearMonth, "yearMonth"); <END> return new YearMonthDateParameterMetadata(date, yearMonth, yearMonth.format(FORMATTER)); }</code><technical_language>I this left in - arg checker is needed, I check</technical_language>

Target:
public static YearMonthDateParameterMetadata of(LocalDate date, YearMonth yearMonth) { ArgChecker.notNull(date, "date"); ArgChecker.notNull(yearMonth, "yearMonth"); return new YearMonthDateParameterMetadata(date, yearMonth, yearMonth.format(FORMATTER)); }
Source:
<code>protected boolean checkEnvironment() { home = getHomeDir().getAbsoluteFile(); <START> boolean success = home.mkdirs(); if (!success) { LOGGER.warning("Failed to create home directory: " + home); return false; } <END> LOGGER.info(getApplicationName()+" home directory: "+home); if (!home.exists()) { context.setAttribute(APP,new NoHomeDirError(home)); return false; } return true; }</code><technical_language>Files.createDirectories</technical_language>

Target:
protected boolean checkEnvironment() { home = getHomeDir().getAbsoluteFile(); try { Files.createDirectories(home.toPath()); } catch (IOException ioe) { LOGGER.log(Level.WARNING, "Failed to create home directory: " + home, ioe); return false; } LOGGER.info(getApplicationName()+" home directory: "+home); if (!home.exists()) { context.setAttribute(APP,new NoHomeDirError(home)); return false; } return true; }
Source:
<code>String getDescription() { <START> return "A fault zone cannot contain more than 1 replicas of same partition"; <END> }</code><technical_language>replicas -> replica</technical_language>

Target:
String getDescription() { return "A fault zone cannot contain more than 1 replica of same partition"; }
Source:
<code>public void setUp() throws CTFReaderException { <START> fixture = new BitBuffer(java.nio.ByteBuffer.allocateDirect(128)); <END> fixture.setByteOrder(ByteOrder.BIG_ENDIAN); createBuffer(fixture); }</code><technical_language>import already, need for java.nio part</technical_language>

Target:
public void setUp() throws CTFReaderException { fixture = new BitBuffer(ByteBuffer.allocateDirect(128)); fixture.setByteOrder(ByteOrder.BIG_ENDIAN); createBuffer(fixture); }
Source:
<code>public CompositeDependencyResolver(List<DependencyResolver> dependencyResolvers) { <START> this(); <END> this.dependencyResolvers = dependencyResolvers; }</code><technical_language>call this() needed</technical_language>

Target:
public CompositeDependencyResolver(List<DependencyResolver> dependencyResolvers) { super(); this.dependencyResolvers = dependencyResolvers; }
Source:
<code>public void testFindMimeTypeNullFileName() { <START> String mimeType = attachmentService.findMimeType(StringUtils.EMPTY); <END> assertEquals(StringUtils.EMPTY, mimeType); }</code><technical_language>This test case is empty string instead of a null string. updated a null string, this test method removed altogether</technical_language>

Target:
public void testFindMimeTypeNullFileName() { String mimeType = attachmentService.findMimeType(null); assertEquals(StringUtils.EMPTY, mimeType); }
Source:
<code>public void testJsonNullDiskDescription() throws IOException { <START> String jsonDescription = null; <END> jsonDescription = ImagesHandler.getJsonDiskDescription("DiskAlias", null); assertTrue("Should be map of disk alias and disk description", jsonDescription.equals("{\"DiskDescription\":\"\",\"DiskAlias\":\"DiskAlias\"}")); }</code><technical_language>please define next row</technical_language>

Target:
public void testJsonNullDiskDescription() throws IOException { String jsonDescription = ImagesHandler.getJsonDiskDescription("DiskAlias", null); assertTrue("Should be map of disk alias and disk description", jsonDescription.equals("{\"DiskDescription\":\"\",\"DiskAlias\":\"DiskAlias\"}")); }
Source:
<code>public void getInstanceAsync_cancelBeforePostShouldNotCreateRealmInstanceOnTheCallerThread() { <START> final RealmAsyncTask[] realmAsyncTasks = new RealmAsyncTask[1]; <END> final Runnable finishedRunnable = new Runnable() { @Override public void run() { looperThread.testComplete(); } }; final RealmConfiguration configuration = looperThread.createConfigurationBuilder() .name("will_be_canceled") .initialData(new Realm.Transaction() { @Override public void execute(Realm realm) { looperThread.postRunnable(new Runnable() { @Override public void run() { assertNotNull(realmAsyncTasks[0]); realmAsyncTasks[0].cancel(); TestHelper.waitRealmThreadExecutorFinish(); looperThread.postRunnable(finishedRunnable); } }); } }) .build(); realmAsyncTasks[0] = Realm.getInstanceAsync(configuration, new Realm.Callback() { @Override public void onSuccess(Realm realm) { fail(); } }); }</code><technical_language>AtomicReference<RealmAsyncTask> instead. is more readable IMO</technical_language>

Target:
public void getInstanceAsync_cancelBeforePostShouldNotCreateRealmInstanceOnTheCallerThread() { final AtomicReference<RealmAsyncTask> realmAsyncTasks = new AtomicReference<>(); final Runnable finishedRunnable = new Runnable() { @Override public void run() { looperThread.testComplete(); } }; final RealmConfiguration configuration = looperThread.createConfigurationBuilder() .name("will_be_canceled") .initialData(new Realm.Transaction() { @Override public void execute(Realm realm) { looperThread.postRunnable(new Runnable() { @Override public void run() { assertNotNull(realmAsyncTasks.get()); realmAsyncTasks.get().cancel(); TestHelper.waitRealmThreadExecutorFinish(); looperThread.postRunnable(finishedRunnable); } }); } }) .build(); realmAsyncTasks.set(Realm.getInstanceAsync(configuration, new Realm.Callback() { @Override public void onSuccess(Realm realm) { fail(); } })); }
Source:
<code>public void createControl(Composite parent) { super.createControl(parent); final Composite control = (Composite) this.getControl(); control.setLayout(new GridLayout(2, false)); control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); <START> final Table selectedFiles = new Table(control, SWT.NONE); <END> selectedFiles.clearAll(); selectedFiles.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Composite buttonArea = new Composite(control, SWT.None); buttonArea.setLayout(new RowLayout()); ((RowLayout) buttonArea.getLayout()).type = SWT.VERTICAL; buttonArea.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false)); Button addFile = new Button(buttonArea, SWT.PUSH); addFile.setText("Add"); addFile.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dialog = new DirectoryDialog (Display.getCurrent().getActiveShell(), SWT.NONE); String fn = dialog.open(); if (null != fn) { File f = new File(fn); if (f.exists()) { getBatchWizard().addFile(fn, f); } } updateButtons(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); Button removeFile = new Button(buttonArea, SWT.PUSH); removeFile.setText("Remove"); removeFile.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { TableItem selectedToRemove[] = selectedFiles.getSelection(); for (TableItem victim : selectedToRemove) { String victimName = victim.getText(); ((BatchImportTraceWizard) getWizard()).removeFile(victimName); } updateButtons(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); this.setTitle("Pick directories and files to scan"); }</code><technical_language>(SWT.H_SCROLL | SWT.V_SCROLL) instead of SWT.NONE style constructing table</technical_language>

Target:
public void createControl(Composite parent) { super.createControl(parent); final Composite control = (Composite) this.getControl(); control.setLayout(new GridLayout(2, false)); control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); final Table selectedFiles = new Table(control, SWT.NONE); selectedFiles.clearAll(); selectedFiles.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Composite buttonArea = new Composite(control, SWT.None); buttonArea.setLayout(new RowLayout()); ((RowLayout) buttonArea.getLayout()).type = SWT.VERTICAL; buttonArea.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false)); Button addFile = new Button(buttonArea, SWT.PUSH); addFile.setText(Messages.ImportTraceWizardPageSelectDirectories_0); addFile.addSelectionListener(new AddFileHandler()); Button addDirectory = new Button(buttonArea, SWT.PUSH); addDirectory.setText(Messages.ImportTraceWizardPageSelectDirectories_1); addDirectory.addSelectionListener(new AddDirectoryHandler()); Button removeFile = new Button(buttonArea, SWT.PUSH); removeFile.setText(Messages.ImportTraceWizardPageSelectDirectories_2); removeFile.addSelectionListener(new RemoveFileHandler(selectedFiles)); this.setTitle(Messages.ImportTraceWizardPageSelectDirectories_3); }
Source:
<code>public void run() { if (logger.isDebugEnabled()) { logger.debug("Triggered deadline"); } try { UnitOfWork<DeadlineMessage<?>> unitOfWork = new DefaultUnitOfWork<>(deadlineMessage); unitOfWork.attachTransaction(transactionManager); InterceptorChain chain = new DefaultInterceptorChain<>(unitOfWork, handlerInterceptors(), dm -> { executeScheduledDeadline(dm, deadlineScope); return null; }); unitOfWork.executeWithResult(chain::proceed); } catch (Exception e) { <START> throw new DeadlineException(format("An error occurred while processing the deadline %s %s", <END> deadlineName, deadlineId), e); } finally { scheduledTasks.remove(new DeadlineId(deadlineName, deadlineId)); } }</code><technical_language>term 'processing' is ambiguous in case of scheduling. I recommend 'triggering' here</technical_language>

Target:
public void run() { if (logger.isDebugEnabled()) { logger.debug("Triggered deadline"); } try { UnitOfWork<DeadlineMessage<?>> unitOfWork = new DefaultUnitOfWork<>(deadlineMessage); unitOfWork.attachTransaction(transactionManager); InterceptorChain chain = new DefaultInterceptorChain<>(unitOfWork, handlerInterceptors(), deadlineMessage -> { executeScheduledDeadline(deadlineMessage, deadlineScope); return null; }); unitOfWork.executeWithResult(chain::proceed); } catch (Exception e) { throw new DeadlineException(format("An error occurred while triggering the deadline %s %s", deadlineName, deadlineId), e); } finally { scheduledTasks.remove(new DeadlineId(deadlineName, deadlineId)); } }
Source:
<code>private boolean isNotSPM(VDSReturnValue returnValue) { <START> return returnValue != null && returnValue.getVdsError() != null && <END> returnValue.getVdsError().getCode() == VdcBllErrors.SpmStatusError; }</code><technical_language>checks squashed check - returnValue.getVdsError() != VdcBllErrors.SpmStatusError, I prefer !VdcBllErrors.SpmStatusError.equals(returnValue.getVdsError()) check removed, you..if changed check, method call replaced check :)</technical_language>

Target:
private boolean isNotSPM(VDSReturnValue returnValue) { return returnValue.getVdsError() != null && returnValue.getVdsError().getCode() == VdcBllErrors.SpmStatusError; }
Source:
<code>public void addTagForEntity(TaggedEntity taggedEntity, Long tagId) { String entityTagUrl = String.format("%s/%s/%s/%s/%s", tagRootUrl, tagId, "entities", taggedEntity.getNamespace(), taggedEntity.getId()); Response responseObject = client.target(entityTagUrl).request().post(Entity.json(taggedEntity)); String response = responseObject.readEntity(String.class); int responseCode = getResponseCode(response); <START> if (responseCode == CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND.getCode() <END> | responseCode == CatalogResponse.ResponseMessage.EXCEPTION.getCode()) { throw new RuntimeException("Error occurred while tagging entity : "+ getResponseMessage(response)); } }</code><technical_language>@omkreddy similar changes well?. I missed this in previous review</technical_language>

Target:
public void addTagForEntity(TaggedEntity taggedEntity, Long tagId) { String entityTagUrl = String.format("%s/%s/%s/%s/%s", tagRootUrl, tagId, "entities", taggedEntity.getNamespace(), taggedEntity.getId()); Response responseObject = client.target(entityTagUrl).request().post(Entity.json(taggedEntity)); String response = responseObject.readEntity(String.class); int responseCode = getResponseCode(response); if (responseCode != CatalogResponse.ResponseMessage.SUCCESS.getCode()) { throw new RuntimeException("Error occurred while tagging entity : "+ getResponseMessage(response)); } }
Source:
<code>public static String getWorkerPrefix(Map conf, TopologyDetails info) { <START> conf = getFullTopologyConfig(conf, info); <END> String prefix = (String) conf.get(WORKER_NAME_PREFIX); String delimiter = (String) conf.get(WORKER_NAME_PREFIX_DELIMITER); if (prefix == null) prefix = ""; if (delimiter == null) delimiter = DEFAULT_DELIMITER; return prefix + info.getName() + delimiter; }</code><technical_language>I a preference for single assignment for arguments. This is a nicety</technical_language>

Target:
public static String getWorkerPrefix(Map conf, TopologyDetails info) { Map topologyConf = getFullTopologyConfig(conf, info); String prefix = Optional.fromNullable((String) topologyConf.get(WORKER_NAME_PREFIX)).or(""); return prefix + info.getName() + getWorkerPrefixDelimiter(conf); }
Source:
<code>public void test_int_and_long_value() throws Exception { Integer[] expectedIntegerValues = {42, -7, 3, null, null, 0xff, 0b0100, 5678, 0xFF, 0b1100110}; Long[] expectedLongValues = {42L, 42L, -7L, -7L, +3L, +3L, null, null, 0xFFL, null, null, null, <START> Long.MAX_VALUE, Long.MAX_VALUE, 0b11010010_01101001_10010100_10010010L, 10010L, 0xFFL, 102L}; <END> int i = 0; int j = 0; for (VariableTree variableTree : variables) { if (variableTree.simpleName().name().startsWith("x")) { assertThat(LiteralUtils.intLiteralValue(variableTree.initializer())).isEqualTo(expectedIntegerValues[i++]); } else if (variableTree.simpleName().name().startsWith("y")) { assertThat(LiteralUtils.longLiteralValue(variableTree.initializer())).isEqualTo(expectedLongValues[j++]); } } }</code><technical_language>obvious 102L is 0B1100110L..</technical_language>

Target:
public void test_int_and_long_value() throws Exception { Integer[] expectedIntegerValues = {42, -7, 3, null, null, 0xff, 0b0100, 5678, 0xFF, 0b1100110}; Long[] expectedLongValues = {42L, 42L, -7L, -7L, +3L, +3L, null, null, 0xFFL, null, null, null, Long.MAX_VALUE, Long.MAX_VALUE, 0b11010010_01101001_10010100_10010010L, 10010L, 0xFFL, 0b1100110L}; int i = 0; int j = 0; for (VariableTree variableTree : variables) { if (variableTree.simpleName().name().startsWith("x")) { assertThat(LiteralUtils.intLiteralValue(variableTree.initializer())).isEqualTo(expectedIntegerValues[i++]); } else if (variableTree.simpleName().name().startsWith("y")) { assertThat(LiteralUtils.longLiteralValue(variableTree.initializer())).isEqualTo(expectedLongValues[j++]); } } }
Source:
<code><START> public void createProfiles() throws ConfigurationException { <END> List<ExtensionEntry> authnExtensions = ConfigurationLoader.getInstance().getExtensionsByService(AUTHN_SERVICE); for (ExtensionEntry authnExtension: authnExtensions) { String pluginName = authnExtension.getConfig().getString(AUTHN_AUTHZ_PLUGIN); ExtensionEntry authzExtension = ConfigurationLoader.getInstance().getExtensionByName(pluginName); if (authzExtension == null) { throw new ConfigurationException("The authentication extension " + authnExtension.getName() + " does not have a matching authorization extension"); } Directory directory = DirectoryManager.getInstance().parseDirectory(authzExtension.getConfig()); Authenticator authenticator = AuthenticatorManager.getInstance().parseAuthenticator(authzExtension.getConfig()); if (directory == null) { throw new ConfigurationException("No directory could be obtained for authorization plugin " + authzExtension.getName()); } if (authenticator == null) { throw new ConfigurationException("No authenticator could be obtained for authentication plugin " + authnExtension.getName()); } String profileName = authnExtension.getConfig().getString(AUTHN_PROFILE); if (profileName == null) { throw new ConfigurationException("Profile name could not be obtained from configuration of authentication plugin " + authnExtension.getName()); } AuthenticationProfile profile = new AuthenticationProfile(profileName, authenticator, directory); profiles.put(profileName, profile); } }</code><technical_language>this called private constructor? is meaning of calling singleton</technical_language>

Target:
public void createProfiles() throws ConfigurationException { for (ExtensionEntry authnExtension : ConfigurationLoader.getInstance().getExtensionsByService(AUTHN_SERVICE)) { AuthenticationProfile profile = new AuthenticationProfile(AuthenticatorManager.getInstance() .parseAuthenticator(authnExtension.getConfig()), DirectoryManager.getInstance() .parseDirectory(ConfigurationLoader.getInstance() .getExtensionByName(authnExtension.getConfig().getString(AUTHN_AUTHZ_PLUGIN)) .getConfig())); profiles.put(profile.getName(), profile); } }
Source:
<code>public void nullable_matcher() throws Exception { mock.oneArg((Character) null); <START> mock.oneArg((Character) 'x'); <END> verify(mock, times(2)).oneArg(nullable(Character.class)); }</code><technical_language>remove line part of improvements</technical_language>

Target:
public void nullable_matcher() throws Exception { mock.oneArg((Character) null); mock.oneArg(Character.valueOf('€')); verify(mock, times(2)).oneArg(nullable(Character.class)); }
Source:
<code><START> protected void subscribe() { <END> messageBusConnection = project.getMessageBus().connect(); }</code><technical_language>implementing a template method subscribe calls abstract method overwritten</technical_language>

Target:
private void subscribe() { messageBusConnection = project.getMessageBus().connect(); registerListeners(messageBusConnection); }
Source:
<code>public String toString(){ return String.format(" Host name: %s%n, Domain name: %s%n, DNS servers: %s%n, IPv4 Gateway: %s%n, IPv6 Gateway: %s%n" <START> ,this.getHostName(),this.getDomainName(),this.getDnsServers(),this.getIpv4DefaultGateway(),this.getIpv6DefaultGateway()); <END> }</code><technical_language>need Arrays.toString(this.getDnsServers()) here</technical_language>

Target:
public String toString(){ return String.format("Host name: %s, Domain name: %s, DNS servers: %s, IPv4 Gateway: %s, IPv6 Gateway: %s" ,this.getHostName(),this.getDomainName(),Arrays.toString(this.getDnsServers()),this.getIpv4DefaultGateway(),this.getIpv6DefaultGateway()); }
Source:
<code>public void rewritesOnSubqueryWithoutProjection() { tester().assertThat(rule) .on(p -> p.lateral( ImmutableList.of(p.symbol("corr")), p.values(p.symbol("corr")), p.enforceSingleRow( p.filter( p.expression("1 = a"), p.values(p.symbol("a")))))) .matches( project( filter( ensureScalarSubquery(), markDistinct( "is_distinct", ImmutableList.of("unique"), lateral( <START> ImmutableList.of("corr"), <END> assignUniqueId( "unique", values("corr")), filter( "1 = a", values("a"))))))); }</code><technical_language>values produces single row here, PROJECT/FILTER/MARK DISTINCT is needed</technical_language>

Target:
public void rewritesOnSubqueryWithoutProjection() { tester().assertThat(rule) .on(p -> p.lateral( ImmutableList.of(p.symbol("corr")), p.values(p.symbol("corr")), p.enforceSingleRow( p.filter( p.expression("1 = a"), p.values(ImmutableList.of(p.symbol("a")), TWO_ROWS))))) .matches( project( filter( ensureScalarSubquery(), markDistinct( "is_distinct", ImmutableList.of("unique"), lateral( ImmutableList.of("corr"), assignUniqueId( "unique", values("corr")), filter( "1 = a", values("a"))))))); }
Source:
<code><START> public void snapshotIndexes(GridH2QueryContext qctx, int segment) { <END> if (!snapshotEnabled) return; Object[] segmentSnapshot; for (long waitTime = 200; ; waitTime *= 2) { segmentSnapshot = actualSnapshot.get(segment); if (segmentSnapshot != null) { segmentSnapshot = doSnapshotIndexes(segmentSnapshot, qctx); if (segmentSnapshot != null) return; } if (tryLock(true, waitTime)) break; } try { ensureNotDestroyed(); segmentSnapshot = actualSnapshot.get(segment); if (segmentSnapshot != null) segmentSnapshot = doSnapshotIndexes(segmentSnapshot, qctx); if (segmentSnapshot == null) { segmentSnapshot = doSnapshotIndexes(null, qctx); assert segmentSnapshot != null; actualSnapshot.set(segment, segmentSnapshot); } } finally { unlock(true); } }</code><technical_language>I do do pass segment doSnapshotIndexes</technical_language>

Target:
public void snapshotIndexes(GridH2QueryContext qctx, int segment) { if (!snapshotEnabled) return; Object[] segmentSnapshot; for (long waitTime = 200; ; waitTime *= 2) { segmentSnapshot = actualSnapshot.get(segment); if (segmentSnapshot != null) { segmentSnapshot = doSnapshotIndexes(segment, segmentSnapshot, qctx); if (segmentSnapshot != null) return; } if (tryLock(true, waitTime)) break; } try { ensureNotDestroyed(); segmentSnapshot = actualSnapshot.get(segment); if (segmentSnapshot != null) segmentSnapshot = doSnapshotIndexes(segment, segmentSnapshot, qctx); if (segmentSnapshot == null) { segmentSnapshot = doSnapshotIndexes(segment,null, qctx); assert segmentSnapshot != null; actualSnapshot.set(segment, segmentSnapshot); } } finally { unlock(true); } }
Source:
<code>@Test public void callAdapterFactoryNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingCallAdapterFactory nonMatchingFactory = new NonMatchingCallAdapterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addCallAdapterFactory(nonMatchingFactory) .build(); try { retrofit.callAdapter(type, annotations); <START> } catch (IllegalArgumentException e) { <END> assertThat(e).hasMessage("" + "Could not locate call adapter for class java.lang.String.\n" + " Tried:\n" + " * retrofit2.helpers.NonMatchingCallAdapterFactory\n" + " * retrofit2.DefaultCallAdapterFactory"); } assertThat(nonMatchingFactory.called).isTrue(); }</code><technical_language>fail</technical_language>

Target:
@Test public void callAdapterFactoryNoMatchThrows() { Type type = String.class; Annotation[] annotations = new Annotation[0]; NonMatchingCallAdapterFactory nonMatchingFactory = new NonMatchingCallAdapterFactory(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("<LINK_0>") .addCallAdapterFactory(nonMatchingFactory) .build(); try { retrofit.callAdapter(type, annotations); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("" + "Could not locate call adapter for class java.lang.String.\n" + " Tried:\n" + " * retrofit2.helpers.NonMatchingCallAdapterFactory\n" + " * retrofit2.DefaultCallAdapterFactory"); } assertThat(nonMatchingFactory.called).isTrue(); }
Source:
<code>public static boolean removeActionBlocker(ZooKeeper zk, String node, VoltLogger log) { try { zk.delete(node, -1); } catch (KeeperException e) { if (e.code() != KeeperException.Code.NONODE) { if (log != null) { log.error("Failed to remove action blocker: " + node + "\n" + e.getMessage(), e); } return false; } } catch (InterruptedException e) { <START> log.error("Failed to remove action blocker: " + node + "\n" + e.getMessage(), e); <END> return false; } return true; }</code><technical_language>I include this message. interrupted exception killing thread, happen in shutdown in case error is misleading</technical_language>

Target:
public static boolean removeActionBlocker(ZooKeeper zk, String node, VoltLogger log) { try { zk.delete(node, -1); } catch (KeeperException e) { if (e.code() != KeeperException.Code.NONODE) { if (log != null) { log.error("Failed to remove action blocker: " + node + "\n" + e.getMessage(), e); } return false; } } catch (InterruptedException e) { return false; } return true; }
Source:
<code>protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) { boolean valid = super.processCustomRouteDocumentBusinessRules(document); if (doesAccountGlobalHaveAccountRestrictionCodeAndNoSubFUndGroupCode()) { valid = isTheNewRestrictionCodeValidForEachAccount() && valid; } <START> return valid; <END> }</code><technical_language>This if statement possibly refactored if (valid && doesAccountGlobalHaveAccountRestrictionCodeAndNoSubFundGroupCode()) { valid = isTheNewRestrictionCodeValidForEachAccount() }</technical_language>

Target:
protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) { boolean valid = super.processCustomRouteDocumentBusinessRules(document); if (doesAccountGlobalHaveAccountRestrictionCodeAndNoSubFundGroupCode()) { valid = isTheNewRestrictionCodeValidForEachAccount() && valid; } return valid; }
Source:
<code>void handleLostAll() { log.debug("Closing lost active tasks as zombies."); final Iterator<Task> iterator = tasks.values().iterator(); while (iterator.hasNext()) { final Task task = iterator.next(); if (task.isActive()) { cleanupTask(task); task.closeDirty(); <START> iterator.remove(); <END> } } }</code><technical_language>do remove task if active now</technical_language>

Target:
void handleLostAll() { log.debug("Closing lost active tasks as zombies."); final Iterator<Task> iterator = tasks.values().iterator(); while (iterator.hasNext()) { final Task task = iterator.next(); final Set<TopicPartition> inputPartitions = task.inputPartitions(); if (task.isActive()) { task.closeDirty(); changelogReader.remove(task.changelogPartitions()); } for (final TopicPartition inputPartition : inputPartitions) { partitionToTask.remove(inputPartition); } iterator.remove(); } }
Source:
<code>protected ValidationInfo doValidate() { final String resourceName = getResourceName(); final Module selectedModule = getModule(); final List<String> directoryNames = getDirNames(); final String fileName = getFileName(); <START> if (resourceName.length() == 0) { <END> return new ValidationInfo("specify resource name", myNameField); } else if (!AndroidResourceUtil.isCorrectAndroidResourceName(resourceName)) { return new ValidationInfo(resourceName + " is not correct resource name", myNameField); } else if (fileName.length() == 0) { return new ValidationInfo("specify file name", myFileNameCombo); } else if (selectedModule == null) { return new ValidationInfo("specify module", myModuleCombo); } else if (directoryNames.size() == 0) { return new ValidationInfo("choose directories", myDirectoriesList); } else if (resourceName.equals(ResourceHelper.prependResourcePrefix(myModule, null))) { return new ValidationInfo("specify more than resource prefix", myNameField); } final ValidationInfo info = CreateXmlResourceDialog.checkIfResourceAlreadyExists(selectedModule, resourceName, myResourceType, directoryNames, fileName); if (info != null) { return info; } return null; }</code><technical_language>isEmpty</technical_language>

Target:
protected ValidationInfo doValidate() { final String resourceName = getResourceName(); final Module selectedModule = getModule(); final List<String> directoryNames = getDirNames(); final String fileName = getFileName(); if (resourceName.isEmpty()) { return new ValidationInfo("specify resource name", myNameField); } else if (!AndroidResourceUtil.isCorrectAndroidResourceName(resourceName)) { return new ValidationInfo(resourceName + " is not correct resource name", myNameField); } else if (fileName.isEmpty()) { return new ValidationInfo("specify file name", myFileNameCombo); } else if (selectedModule == null) { return new ValidationInfo("specify module", myModuleCombo); } else if (directoryNames.isEmpty()) { return new ValidationInfo("choose directories", myDirectoriesList); } else if (resourceName.equals(ResourceHelper.prependResourcePrefix(myModule, null))) { return new ValidationInfo("specify more than resource prefix", myNameField); } return CreateXmlResourceDialog.checkIfResourceAlreadyExists(selectedModule, resourceName, myResourceType, directoryNames, fileName); }
Source:
<code>public ZKConfig(File configFile) throws ConfigException { <START> init(); <END> addConfiguration(configFile); }</code><technical_language>Instead of calling init explicitly here, call this() call default constructor ZKConfig</technical_language>

Target:
public ZKConfig(File configFile) throws ConfigException { this(); addConfiguration(configFile); }