auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void setSamplePurposes(Collection<SamplePurpose> samplePurposes) { <START> Map<Long, SamplePurpose> mapById = new HashMap<>(); <END> Map<String, SamplePurpose> mapByAlias = new HashMap<>(); for (SamplePurpose sp : samplePurposes) { if (mapByAlias.containsKey(sp.getAlias())) { throw new IllegalStateException("Duplicate SamplePurpose alias: " + sp.getAlias()); } mapByAlias.put(sp.getAlias(), sp); mapById.put(sp.getId(), sp); } this.samplePurposeById = mapById; this.samplePurposeByAlias = mapByAlias; }</code><technical_language>Is worth creating implementation of map throws a duplicate key put avoid this times</technical_language>

Target:
private void setSamplePurposes(Collection<SamplePurpose> samplePurposes) { Map<Long, SamplePurpose> mapById = new UniqueKeyHashMap<>(); Map<String, SamplePurpose> mapByAlias = new UniqueKeyHashMap<>(); for (SamplePurpose sp : samplePurposes) { mapByAlias.put(sp.getAlias(), sp); mapById.put(sp.getId(), sp); } this.samplePurposeById = mapById; this.samplePurposeByAlias = mapByAlias; }
Source:
<code>protected static WebArchive createDeployment() { final Package testPackage = SecurityAPITestCase.class.getPackage(); return ShrinkWrap.create(WebArchive.class, SecurityAPITestCase.class.getSimpleName() + ".war") .addClasses(SecurityAPITestCase.class, AbstractElytronSetupTask.class, ServerSetup.class) .addClasses(TestAuthenticationMechanism.class, TestIdentityStore.class) .addClasses(TestServlet.class) .addClasses(WhoAmI.class, WhoAmIBean.class) .addAsWebInfResource(Utils.getJBossWebXmlAsset("SecurityAPI"), "jboss-web.xml") .addAsWebInfResource(testPackage, "jboss-ejb3.xml", "jboss-ejb3.xml") <START> .addAsWebInfResource(testPackage, "beans.xml", "beans.xml"); <END> }</code><technical_language>For execution security manager, is necessary: .addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain")), "permissions.xml")</technical_language>

Target:
protected static WebArchive createDeployment() { final Package testPackage = SecurityAPITestCase.class.getPackage(); return ShrinkWrap.create(WebArchive.class, SecurityAPITestCase.class.getSimpleName() + ".war") .addClasses(SecurityAPITestCase.class, AbstractElytronSetupTask.class, ServerSetup.class) .addClasses(TestAuthenticationMechanism.class, TestIdentityStore.class) .addClasses(TestServlet.class) .addClasses(WhoAmI.class, WhoAmIBean.class) .addAsWebInfResource(Utils.getJBossWebXmlAsset("SecurityAPI"), "jboss-web.xml") .addAsWebInfResource(testPackage, "jboss-ejb3.xml", "jboss-ejb3.xml") .addAsWebInfResource(testPackage, "beans.xml", "beans.xml") .addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain")), "permissions.xml"); }
Source:
<code>public void addStressor(boolean failSilently) { int threadIndex = getNextThreadId(maxThreads); if (threadIndex < 0) { if (failSilently) { return; } reachedMax = true; log.warnf("Attempt to create more than %d threads!", maxThreads); Utils.threadDump(); <START> return; <END> } if (isSteadyState()) { if (failSilently) { return; } log.error("Creating new thread during steady-state!"); Utils.threadDump(); } waitingThreads.incrementAndGet(); Stressor stressor = new Stressor(threadIndex, this, logTransactionExceptions); synchronized (this) { if (!finished) { stressors.add(stressor); } } log.infof("Created stressor %s", stressor.getName()); stressor.start(); }</code><technical_language>this throw exception instead? this fails silently if failSilently == false</technical_language>

Target:
public void addStressor(boolean failSilently) { int threadIndex = getNextThreadId(maxThreads); if (threadIndex < 0) { if (failSilently) { return; } reachedMax = true; log.warnf("Attempt to create more than %d threads!", maxThreads); Utils.threadDump(); return; } if (isSteadyState()) { if (failSilently) { return; } log.error("Creating new thread during steady-state!"); Utils.threadDump(); } waitingThreads.incrementAndGet(); Stressor stressor = new Stressor(threadIndex, this, true, logTransactionExceptions); synchronized (this) { if (!finished) { stressors.add(stressor); } } log.infof("Created stressor %s", stressor.getName()); stressor.start(); }
Source:
<code>public Map<String, Model> filterDefinitions(SwaggerSpecFilter filter, Map<String, Model> definitions, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { if (definitions == null) { return null; } Map<String, Model> clonedDefinitions = new LinkedHashMap<String, Model>(); for (String key : definitions.keySet()) { Model definition = definitions.get(key); Map<String, Property> clonedProperties = new LinkedHashMap<String, Property>(); if (definition.getProperties() != null) { for (String propName : definition.getProperties().keySet()) { Property property = definition.getProperties().get(propName); if (property != null) { boolean shouldInclude = filter.isPropertyAllowed(definition, property, propName, params, cookies, headers); if (shouldInclude) { clonedProperties.put(propName, property); } } } } Model clonedModel = (Model) definition.clone(); <START> if (clonedModel.getProperties() != null) clonedModel.getProperties().clear(); <END> clonedModel.setProperties(clonedProperties); clonedDefinitions.put(key, clonedModel); } return clonedDefinitions; }</code><technical_language>Based [coding guidelines](<LINK_0> turn ifstatement a blocked one</technical_language>

Target:
public Map<String, Model> filterDefinitions(SwaggerSpecFilter filter, Map<String, Model> definitions, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { if (definitions == null) { return null; } Map<String, Model> clonedDefinitions = new LinkedHashMap<String, Model>(); for (String key : definitions.keySet()) { Model definition = definitions.get(key); Map<String, Property> clonedProperties = new LinkedHashMap<String, Property>(); if (definition.getProperties() != null) { for (String propName : definition.getProperties().keySet()) { Property property = definition.getProperties().get(propName); if (property != null) { boolean shouldInclude = filter.isPropertyAllowed(definition, property, propName, params, cookies, headers); if (shouldInclude) { clonedProperties.put(propName, property); } } } } Model clonedModel = (Model) definition.clone(); if (clonedModel.getProperties() != null) { clonedModel.getProperties().clear(); } clonedModel.setProperties(clonedProperties); clonedDefinitions.put(key, clonedModel); } return clonedDefinitions; }
Source:
<code>public void execute(String[] args, ConsoleReader reader) throws Exception { boolean provideDescription = false; <START> if (args.length == 3) { <END> if (args[2].equals("--with-description")) { provideDescription = true; } else { throw new CliException("Invalid parameter " + args[2]); } } try (AppPackage ap = newAppPackageInstance(new File(expandFileName(args[1], true)))) { JSONSerializationProvider jomp = new JSONSerializationProvider(); jomp.addSerializer(PropertyInfo.class, new AppPackage.PropertyInfoSerializer(provideDescription)); JSONObject apInfo = new JSONObject(jomp.getContext(null).writeValueAsString(ap)); apInfo.remove("name"); printJson(apInfo); } }</code><technical_language>more consistent other Commands process options</technical_language>

Target:
public void execute(String[] args, ConsoleReader reader) throws Exception { String[] tmpArgs = new String[args.length - 2]; System.arraycopy(args, 2, tmpArgs, 0, args.length - 2); GetAppPackageInfoCommandLineInfo commandLineInfo = getGetAppPackageInfoCommandLineInfo(tmpArgs); try (AppPackage ap = newAppPackageInstance(new File(expandFileName(args[1], true)))) { JSONSerializationProvider jomp = new JSONSerializationProvider(); jomp.addSerializer(PropertyInfo.class, new AppPackage.PropertyInfoSerializer(commandLineInfo.provideDescription)); JSONObject apInfo = new JSONObject(jomp.getContext(null).writeValueAsString(ap)); apInfo.remove("name"); printJson(apInfo); } }
Source:
<code>public long deleteHorizonMs() { if (isDeleteHorizonSet()) { return super.loadFullBatch().deleteHorizonMs(); <START> } <END> return RecordBatch.NO_TIMESTAMP; }</code><technical_language>need for for single line statement</technical_language>

Target:
public long deleteHorizonMs() { if (deleteHorizonSet()) return super.loadBatchHeader().deleteHorizonMs(); return RecordBatch.NO_TIMESTAMP; }
Source:
<code>public String getMessage() { <START> return format("line %s:%s: %s", getLineNumber(), getColumnNumber(), getWarning()); <END> }</code><technical_language>If change charPositionInLine columNumber fields directly</technical_language>

Target:
public String getMessage() { return format("lineNumber %s:%s: %s", lineNumber, columnNumber, getWarning()); }
Source:
<code>private boolean finishPacketRecovery(FlexFec03Packet fecPacket, RawPacket recoveredPacket) { recoveredPacket.getBuffer()[0] |= 0x80; recoveredPacket.getBuffer()[0] &= 0xbf; int length = RTPUtils.readUint16AsInt(recoveredPacket.getBuffer(), 2); if (length > recoveredPacket.getBuffer().length) { logger.error("Length field of recovered packet is larger" + " than its buffer"); return false; } <START> recoveredPacket.setLength(length + RawPacket.FIXED_HEADER_SIZE); <END> RTPUtils.writeShort(recoveredPacket.getBuffer(), 2, (short)missingSequenceNumber); RTPUtils.writeInt(recoveredPacket.getBuffer(), 8, (int)fecPacket.getProtectedSsrc()); return true; }</code><technical_language>check include fixed header length</technical_language>

Target:
private boolean finishPacketRecovery(FlexFec03Packet fecPacket, RawPacket recoveredPacket) { recoveredPacket.getBuffer()[0] |= 0x80; recoveredPacket.getBuffer()[0] &= 0xbf; int length = RTPUtils.readUint16AsInt(recoveredPacket.getBuffer(), 2); int lengthWithFixedHeader = length + RawPacket.FIXED_HEADER_SIZE; if (lengthWithFixedHeader > recoveredPacket.getBuffer().length) { logger.error("Length field of recovered packet is larger" + " than its buffer"); return false; } recoveredPacket.setLength(lengthWithFixedHeader); recoveredPacket.setSequenceNumber(missingSequenceNumber); recoveredPacket.setSSRC((int)fecPacket.getProtectedSsrc()); return true; }
Source:
<code>public void testSTCentroid() throws Exception { <START> assertQuery("select st_as_text(st_centroid(st_geometry_from_text('polygon ((1 1, 1 4, 4 4, 4 1))')))", "select 'POINT (2.5 2.5)'"); <END> }</code><technical_language>nit: consider testing st_centroid a non-polygon shape ditto other methods apply a restricted set of shape types</technical_language>

Target:
public void testSTCentroid() throws Exception { assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('LINESTRING EMPTY')))", VARCHAR, "POINT EMPTY"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('POINT (3 5)')))", VARCHAR, "POINT (3 5)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('MULTIPOINT (1 2, 2 4, 3 6, 4 8)')))", VARCHAR, "POINT (2.5 5)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('LINESTRING (1 1, 2 2, 3 3)')))", VARCHAR, "POINT (2 2)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))')))", VARCHAR, "POINT (3 2)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 4, 4 1))')))", VARCHAR, "POINT (2.5 2.5)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('POLYGON ((1 1, 5 1, 3 4))')))", VARCHAR, "POINT (3 2)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('MULTIPOLYGON (((1 1, 1 3, 3 3, 3 1)), ((2 4, 2 6, 6 6, 6 4)))')))", VARCHAR, "POINT (3.3333333333333335 4)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('POLYGON ((0 0, 0 5, 5 5, 5 0, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1))')))", VARCHAR, "POINT (2.5416666666666665 2.5416666666666665)"); }
Source:
<code>public IFileRevision[] getTargets(final IFileRevision ifr) { final IFileRevision[] allRevisions = getFileRevisions(); final List<IFileRevision> descendants = new ArrayList<IFileRevision>(); for (IFileRevision candidate : allRevisions) { <START> if (candidate.getTimestamp() < ifr.getTimestamp()) <END> descendants.add(candidate); } return descendants.toArray(new IFileRevision[descendants.size()]); }</code><technical_language>this is correct ? CommitFileRevision.getTimestamp() returns author time necessarily matching topological order of history graph</technical_language>

Target:
public IFileRevision[] getTargets(final IFileRevision ifr) { final IFileRevision[] allRevisions = getFileRevisions(); final List<IFileRevision> descendants = new ArrayList<IFileRevision>(); if (!(ifr instanceof CommitFileRevision)) { for (IFileRevision candidate : allRevisions) { if (candidate.getTimestamp() < ifr.getTimestamp()) descendants.add(candidate); } } else { final CommitFileRevision rev = (CommitFileRevision) ifr; final RevCommit rc = rev.getRevCommit(); for (IFileRevision candidate : allRevisions) { if (candidate instanceof CommitFileRevision) { final RevCommit candidateCommit = ((CommitFileRevision) candidate) .getRevCommit(); if (candidateCommit.getCommitTime() < rc.getCommitTime()) descendants.add(candidate); } } } return descendants.toArray(new IFileRevision[descendants.size()]); }
Source:
<code>private KubernetesServiceAddressResolver prepareResolver(boolean includeNotReadyAddresses) throws IOException { File account = File.createTempFile("kubernetes-test-account", ""); <START> new FileWriter(account).write("account-token"); <END> String accountFile = account.getAbsolutePath(); KubernetesConnectionConfiguration cfg = new KubernetesConnectionConfiguration(); cfg.setNamespace(namespace); cfg.setServiceName(service); cfg.setMasterUrl("https://localhost:" + mockServer.getLocalPort()); cfg.setAccountToken(accountFile); cfg.setIncludeNotReadyAddresses(includeNotReadyAddresses); return new KubernetesServiceAddressResolver(cfg); }</code><technical_language>Close FileWriter</technical_language>

Target:
private KubernetesServiceAddressResolver prepareResolver(boolean includeNotReadyAddresses) throws IOException { File account = File.createTempFile("kubernetes-test-account", ""); FileWriter fw = new FileWriter(account); fw.write("account-token"); fw.close(); String accountFile = account.getAbsolutePath(); KubernetesConnectionConfiguration cfg = new KubernetesConnectionConfiguration(); cfg.setNamespace(namespace); cfg.setServiceName(service); cfg.setMasterUrl("https://localhost:" + mockServer.getLocalPort()); cfg.setAccountToken(accountFile); cfg.setIncludeNotReadyAddresses(includeNotReadyAddresses); return new KubernetesServiceAddressResolver(cfg); }
Source:
<code>private void checkActivityRecordValidity() throws ServerException { for (String runningWsId : workspaceRuntimes.getRunning()) { WorkspaceActivity activity = activityDao.findActivity(runningWsId); long idleTimeout = workspaceActivityManager.getIdleTimeout(runningWsId); if (activity == null) { createMissingActivityRecord(runningWsId, idleTimeout); } else { rectifyCreatedTime(activity); long now = clock.millis(); <START> Long lastKnownActivity = newestActivity(activity); <END> boolean noLastRunningTime = rectifyLastRunningTime(activity, now, lastKnownActivity); rectifyExpirationTime(activity, now, noLastRunningTime, lastKnownActivity, idleTimeout); } } }</code><technical_language>changes a I a bit name lastActivityTime. I expect lastKnownActivity string stopped, created. consider renaming newestActivity -> latestActivityTime</technical_language>

Target:
private void checkActivityRecordValidity() throws ServerException { for (String runningWsId : workspaceRuntimes.getRunning()) { WorkspaceActivity activity = activityDao.findActivity(runningWsId); long idleTimeout = workspaceActivityManager.getIdleTimeout(runningWsId); if (activity == null) { createMissingActivityRecord(runningWsId, idleTimeout); } else { rectifyCreatedTime(activity); long now = clock.millis(); Long latestActivityTime = getLatestActivityTime(activity); boolean noLastRunningTime = rectifyLastRunningTime(activity, now, latestActivityTime); rectifyExpirationTime(activity, now, noLastRunningTime, latestActivityTime, idleTimeout); } } }
Source:
<code>private static boolean isSuccess(int responseCode) { int startingNumber = (responseCode / 100); <START> return startingNumber == SUCCESS; <END> }</code><technical_language>if(200 <= responseCode && responseCode < 300)</technical_language>

Target:
private static boolean isSuccess(int responseCode) { return (responseCode >= 200 && responseCode < 300); }
Source:
<code>public Lot createLotForAdd( final Integer gid, final Integer locationId, final Integer scaleId, final String comment, final Integer userId, final CropType cropType) throws MiddlewareQueryException { final Lot lot = new Lot(null, userId, EntityType.GERMPLSM.name(), gid, locationId, scaleId, LotStatus.ACTIVE.getIntValue(), LotBuilder.LOT_NOT_DERIVED_FROM_ANOTHER, comment); <START> this.lotIDGenerator = new LotIDGeneratorImpl(); <END> this.lotIDGenerator.generateLotIds(cropType, Lists.newArrayList(lot)); return lot; }</code><technical_language>@vmaletta lotIDGenerator @Autowired, remove manually construction</technical_language>

Target:
public Lot createLotForAdd( final Integer gid, final Integer locationId, final Integer scaleId, final String comment, final Integer userId, final CropType cropType) throws MiddlewareQueryException { final Lot lot = new Lot(null, userId, EntityType.GERMPLSM.name(), gid, locationId, scaleId, LotStatus.ACTIVE.getIntValue(), LotBuilder.LOT_NOT_DERIVED_FROM_ANOTHER, comment); this.getInventoryDataManager().generateLotIds(cropType, Lists.newArrayList(lot)); return lot; }
Source:
<code>protected CoapResponse doInBackground(String... args) { CoapClient client = new CoapClient(args[0]); <START> if (isSecure) { <END> CoapEndpoint.CoapEndpointBuilder endpointBuilder = new CoapEndpoint.CoapEndpointBuilder(); DtlsConnectorConfig.Builder dtlsConfig = new DtlsConnectorConfig.Builder(); dtlsConfig.setClientOnly(); ConfigureDtls.loadCredentials(getApplicationContext(), dtlsConfig, CLIENT_NAME); DTLSConnector dtlsConnector = new DTLSConnector(dtlsConfig.build()); endpointBuilder.setConnector(dtlsConnector); client.setEndpoint(endpointBuilder.build()); } return client.get(); }</code><technical_language>Means: if localhost dtls service is running, dtls used. Do yo else, determine, if want dtls/coaps plain/coap</technical_language>

Target:
protected CoapResponse doInBackground(String... args) { CoapClient client = new CoapClient(args[0]); return client.get(); }
Source:
<code><START> public static void removeDiskFromVm(Guid vmGuid, Disk disk) { <END> DbFacade.getInstance().getVmDeviceDAO().remove(new VmDeviceId(disk.getId(), vmGuid)); }</code><technical_language>this delete disk also, removeDisk (and belongs elsewhere)</technical_language>

Target:
public static void removeDiskFromVm(Guid vmGuid, Disk disk) { DbFacade.getInstance().getVmDeviceDAO().remove(new VmDeviceId(disk.getId(), vmGuid)); DbFacade.getInstance().getDiskDao().remove(disk.getId()); }
Source:
<code>public void gracefullyHandlesBrokenBack() throws Exception { <START> secure(new TkFailure("Jeffrey Lebowski")).exec( <END> new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { new JdkRequest(home) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_INTERNAL_ERROR) .assertBody(Matchers.containsString("Lebowski")); } } ); }</code><technical_language>@bdragan add full path static method calls - qulice complained here</technical_language>

Target:
public void gracefullyHandlesBrokenBack() throws Exception { FtSecureTest.secure(new TkFailure("Jeffrey Lebowski")).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { new JdkRequest(home) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_INTERNAL_ERROR) .assertBody(Matchers.containsString("Lebowski")); } } ); }
Source:
<code>public ImmutableSpongeBreathingData(int maxAir, int remainingAir) { super(ImmutableBreathingData.class); this.maxAir = maxAir; this.remainingAir = remainingAir; <START> remainingAirValue = new ImmutableSpongeBoundedValue<>(Keys.REMAINING_AIR, <END> this.remainingAir, this.maxAir, ComparatorUtil.intComparator(), -20, this.maxAir); maxAirValue = new ImmutableSpongeBoundedValue<>(Keys.MAX_AIR, this.maxAir, 300, ComparatorUtil.intComparator(), 0, Integer.MAX_VALUE); registerGetters(); }</code><technical_language>SpongeValueBuilder.boundedBuilder(..</technical_language>

Target:
public ImmutableSpongeBreathingData(int maxAir, int remainingAir) { super(ImmutableBreathingData.class); this.maxAir = maxAir; this.remainingAir = remainingAir; remainingAirValue = SpongeValueBuilder.boundedBuilder(Keys.REMAINING_AIR) .actualValue(remainingAir) .defaultValue(this.maxAir) .minimum(-20) .maximum(this.maxAir) .build() .asImmutable(); maxAirValue = SpongeValueBuilder.boundedBuilder(Keys.MAX_AIR) .actualValue(this.maxAir) .defaultValue(300) .minimum(0) .maximum(Integer.MAX_VALUE) .build() .asImmutable(); registerGetters(); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { <START> final RebaseOperation rebase = createRebaseOperation(event); <END> execute(rebase); return null; }</code><technical_language>extract repository calling createRepositoryOperation change signature of createRepositoryOperation accept a Repository need getRepository() extractRepository() next change top of this need subclass concrete handlers anymore</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository repository = getRepository(event); execute(repository); return null; }
Source:
<code>public static CrateInstances fromStream(byte[] value) throws IOException { if (value.length == 0) { return new CrateInstances(); } ByteArrayInputStream in = new ByteArrayInputStream(value); try (ObjectInputStream objectInputStream = new ObjectInputStream(in)) { CrateInstances crateInstances = (CrateInstances) objectInputStream.readObject(); crateInstances.hosts = null; return crateInstances; } catch (ClassNotFoundException e) { <START> LOGGER.error("Failed to deserialize CrateInstances: {}", e.getMessage()); <END> e.printStackTrace(); } return null; }</code><technical_language>pass exception argument instead of passing a string</technical_language>

Target:
public static CrateInstances fromStream(byte[] value) throws IOException { if (value.length == 0) { return new CrateInstances(); } ByteArrayInputStream in = new ByteArrayInputStream(value); try (ObjectInputStream objectInputStream = new ObjectInputStream(in)) { CrateInstances crateInstances = (CrateInstances) objectInputStream.readObject(); crateInstances.hosts = null; return crateInstances; } catch (ClassNotFoundException e) { LOGGER.error("Failed to deserialize CrateInstances:", e); e.printStackTrace(); } return null; }
Source:
<code>private void showFinalSelection(UIContextImpl context) { <START> UISelection<?> selection = context.getSelection(); <END> if (!selection.isEmpty()) { selectResourceFor(selection.get()); } }</code><technical_language>selection null</technical_language>

Target:
private void showFinalSelection(UIContextImpl context) { UISelection<?> selection = context.getSelection(); if (selection != null && !selection.isEmpty()) { selectResourceFor(selection.get()); } }
Source:
<code>public void visitLiteral(LiteralTree tree) { String literal = tree.value().toLowerCase(Locale.ROOT); <START> if (literal.contains(OPENSSL_DES)) { <END> context().newIssue(this, tree, MESSAGE); } super.visitLiteral(tree); }</code><technical_language>literal.startsWith reduce potential FP</technical_language>

Target:
public void visitLiteral(LiteralTree tree) { String literal = trimQuotes(tree.value().toLowerCase(Locale.ROOT)); if (literal.startsWith(OPENSSL_DES)) { context().newIssue(this, tree, MESSAGE); } super.visitLiteral(tree); }
Source:
<code>public void setFontFamily(@NonNull String fontFamily) { if (!fontFamily.equals(Prefs.getFontFamily())) { Prefs.setFontFamily(fontFamily); <START> bus.post(new ThemeChangeEvent()); <END> } }</code><technical_language>rename more generic ThemeFontChangeEvent() AppearanceChangeEvent()</technical_language>

Target:
public void setFontFamily(@NonNull String fontFamily) { if (!fontFamily.equals(Prefs.getFontFamily())) { Prefs.setFontFamily(fontFamily); bus.post(new ThemeFontChangeEvent()); } }
Source:
<code>private String getSuggestedBranchName() { if (fullBranch != null) { String branchName = Repository.shortenRefName(fullBranch); StoredConfig config = repository.getConfig(); BranchConfig branchConfig = new BranchConfig(config, branchName); String merge = branchConfig.getMerge(); if (!branchConfig.isRemoteLocal() && merge != null && merge.startsWith(Constants.R_HEADS)) { return Repository.shortenRefName(merge); } else if (merge == null) { <START> if (fullBranch != null <END> && fullBranch.startsWith(Constants.R_HEADS)) { return branchName; } } } return ""; }</code><technical_language>fullBranch is non-null here</technical_language>

Target:
private String getSuggestedBranchName() { if (fullBranch != null) { String branchName = Repository.shortenRefName(fullBranch); StoredConfig config = repository.getConfig(); BranchConfig branchConfig = new BranchConfig(config, branchName); String merge = branchConfig.getMerge(); if (!branchConfig.isRemoteLocal() && merge != null && merge.startsWith(Constants.R_HEADS)) { return Repository.shortenRefName(merge); } else if (merge == null && fullBranch.startsWith(Constants.R_HEADS)) { return branchName; } } return ""; }
Source:
<code>public boolean isDecorationReady(Object element, IDecorationContext context) { <START> if (isUpdateJobRunning.get()) { <END> return internalGetResult(element, context) != null; } return false; }</code><technical_language>this is called UI, I replace threadlocal a simple boolean</technical_language>

Target:
public boolean isDecorationReady(Object element, IDecorationContext context) { if (isUpdateJobRunning) { return internalGetResult(element, context) != null; } return false; }
Source:
<code>public Iterable<Signed<Timestamp>> asChangeSequence() { <START> return Lists.newArrayList(this.getSigned(0)); <END> }</code><technical_language>Collections.singletonList() instead</technical_language>

Target:
public Iterable<Signed<Timestamp>> asChangeSequence() { return Collections.singletonList(this.getSigned(0)); }
Source:
<code>private void doClose() { if (CollectionUtils.isNotEmpty(tasks)) { for (Timeout timeout : tasks) { <START> timeout.cancel(); <END> } tasks.clear(); } }</code><technical_language>timeout.cancel success task expired once,because in this case status ST_EXPIRED , in this case, based org.apache.dubbo.common.timer.HashedWheelTimer.HashedWheelTimeout#cancel method code public boolean cancel() { // update state removed HashedWheelBucket next tick. if (!compareAndSetState(ST_INIT, ST_CANCELLED)) { return false; } // If a task canceled put this another queue processed tick. // this means a GC latency of max. 1 tick duration is good enough. This // of MpscLinkedQueue minimize locking / overhead possible. timer.cancelledTimeouts.add(this); return true; } compareAndSetState reture false. I right</technical_language>

Target:
private void doClose() { heartBeatTimerTask.cancel(); reconnectTimerTask.cancel(); }
Source:
<code><START> public boolean useTls() { <END> return StringUtils.startsWithIgnoreCase( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), "https"); }</code><technical_language>this private</technical_language>

Target:
private boolean useTls() { return StringUtils.startsWithIgnoreCase( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), "https"); }
Source:
<code>public void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException { String key = KEY.resolveModelAttribute(context, model).asString(); ModelNode value = VALUE.resolveModelAttribute(context, model); <START> attribute.get(key).set(value); <END> }</code><technical_language>thinking out loud here, add a debug trace log if previously defined is replaced? debugf("Value '%s' for key '%s' replaced '%s'.", oldValue, key, value);</technical_language>

Target:
void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException { String key = KEY.resolveModelAttribute(context, model).asString(); ModelNode value = VALUE.resolveModelAttribute(context, model); attribute.get(key).set(value); }
Source:
<code>public boolean equals(Object obj) { if (obj instanceof SecureStoreData) { SecureStoreData o = (SecureStoreData) obj; <START> return Objects.equal(storeName, o.storeName); <END> } return equals(obj); }</code><technical_language>reason Objects.equal handle null cases for parameters. I storeName canno null so: storeName.equals(o.storeName) is good enough</technical_language>

Target:
public boolean equals(Object obj) { if (obj instanceof SecureStoreData) { SecureStoreData o = (SecureStoreData) obj; return storeName.equals(o.storeName); } return super.equals(obj); }
Source:
<code>public int delete(String table, String key) { try { MongoCollection<Document> collection = database.getCollection(table); Document query = new Document("_id", key); DeleteResult result = collection.withWriteConcern(writeConcern).deleteOne(query); if (result.wasAcknowledged() && result.getDeletedCount() == 0) { System.err.println("Nothing deleted for key " + key); <START> return StatusCode.ERROR; <END> } return StatusCode.OK; } catch (Exception e) { System.err.println(e.toString()); return StatusCode.ERROR; } }</code><technical_language>ERROR->NOT_FOUND</technical_language>

Target:
public Status delete(String table, String key) { try { MongoCollection<Document> collection = database.getCollection(table); Document query = new Document("_id", key); DeleteResult result = collection.withWriteConcern(writeConcern).deleteOne(query); if (result.wasAcknowledged() && result.getDeletedCount() == 0) { System.err.println("Nothing deleted for key " + key); return Status.NOT_FOUND; } return Status.OK; } catch (Exception e) { System.err.println(e.toString()); return Status.ERROR; } }
Source:
<code>private ValidationResult validateExternalNetwork() { if (!getNetwork().getProvidedBy().isSetPhysicalNetworkId()) { return ValidationResult.VALID; } Network physicalNetwork = networkDao.get(getNetwork().getProvidedBy().getPhysicalNetworkId()); <START> return ValidationResult.failWith(EngineMessage.ACTIVATE_DEACTIVATE_NETWORK_NOT_IN_VDS) <END> .when(!networkAttachedToVds(physicalNetwork.getName(), getVdsId())); }</code><technical_language>Please add a new message for this validation. user understand this network is required</technical_language>

Target:
private ValidationResult validateExternalNetwork() { if (!getNetwork().getProvidedBy().isSetPhysicalNetworkId()) { return ValidationResult.VALID; } Network physicalNetwork = networkDao.get(getNetwork().getProvidedBy().getPhysicalNetworkId()); return ValidationResult.failWith(EngineMessage.PHYSICAL_NETWORK_LINKED_TO_EXTERNAL_NOT_IN_VDS) .when(!networkAttachedToVds(physicalNetwork.getName(), getVdsId())); }
Source:
<code>protected void parse(AddressParametersHeader addressParametersHeader) throws ParseException { dbg_enter("AddressParametersParser.parse"); try { AddressParser addressParser = new AddressParser(this.getLexer()); AddressImpl addr = addressParser.address(false); addressParametersHeader.setAddress(addr); lexer.SPorHT(); char la = this.lexer.lookAhead(0); if ( this.lexer.hasMoreChars() && la != '\0' && la != '\n' && this.lexer.startsId()) { super.parseNameValueList(addressParametersHeader); } else { lexer.SPorHT(); <START> if (this.lexer.lookAhead(0) == ';') { <END> if (this.allowParameters == false) { throw new ParseException(this.lexer.getBuffer() + "is not valid. This Header Field cannot has Parameters" , this.lexer.getPtr()); } } super.parse(addressParametersHeader); } } catch (ParseException ex) { throw ex; } finally { dbg_leave("AddressParametersParser.parse"); } }</code><technical_language>i this order previous one, Actually, previous commit is totally overwritten this. Next time try do PR minimum commmits possible. For this kind of bug, a single commit ideal including code changes junit test case</technical_language>

Target:
protected void parse(AddressParametersHeader addressParametersHeader) throws ParseException { dbg_enter("AddressParametersParser.parse"); try { AddressParser addressParser = new AddressParser(this.getLexer()); AddressImpl addr = addressParser.address(false); addressParametersHeader.setAddress(addr); lexer.SPorHT(); char la = this.lexer.lookAhead(0); if ( this.lexer.hasMoreChars() && la != '\0' && la != '\n' && this.lexer.startsId()) { super.parseNameValueList(addressParametersHeader); } else { if (this.allowParameters == false) { lexer.SPorHT(); if (this.lexer.lookAhead(0) == ';') { throw new ParseException(this.lexer.getBuffer() + "is not valid. This Header Field cannot has Parameters" , this.lexer.getPtr()); } } super.parse(addressParametersHeader); } } catch (ParseException ex) { throw ex; } finally { dbg_leave("AddressParametersParser.parse"); } }
Source:
<code>public void updataMaxVmsInPool() { AsyncDataProvider.getInstance().getInstance().getMaxVmsInPool(new AsyncQuery(this, <START> new INewAsyncCallback() { <END> @Override public void onSuccess(Object target, Object returnValue) { VmModelBehaviorBase behavior = (VmModelBehaviorBase) target; behavior.setMaxVmsInPool((Integer) returnValue); behavior.updateMaxNumOfVmCpus(); } } )); }</code><technical_language>getInstance().getInstance()</technical_language>

Target:
public void updataMaxVmsInPool() { AsyncDataProvider.getInstance().getMaxVmsInPool(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { VmModelBehaviorBase behavior = (VmModelBehaviorBase) target; behavior.setMaxVmsInPool((Integer) returnValue); behavior.updateMaxNumOfVmCpus(); } } )); }
Source:
<code>private void disableRequestChunkingIfNecessary(Client client, Invocation.Builder requestBuilder) { <START> if (client instanceof org.apache.cxf.jaxrs.client.spec.ClientImpl) { <END> if (LOG.isDebugEnabled()) { LOG.debug("disableRequestChunkingIfNecessary: Explicitly disabling chunking because KFS is using a CXF JAX-RS client"); } ClientConfiguration cxfConfig = WebClient.getConfig(requestBuilder); HTTPConduit conduit = cxfConfig.getHttpConduit(); HTTPClientPolicy clientPolicy = conduit.getClient(); clientPolicy.setAllowChunking(false); } else if (LOG.isDebugEnabled()) { LOG.debug("disableRequestChunkingIfNecessary: The JAX-RS client implementation does not need to explicitly disable chunking"); } }</code><technical_language>I thought this a problem request a size, 30 vendors so. disable chunking instance is coded size limit is reached</technical_language>

Target:
private void disableRequestChunkingIfNecessary(Client client, Invocation.Builder requestBuilder) { if (client instanceof org.apache.cxf.jaxrs.client.spec.ClientImpl) { LOG.info("disableRequestChunkingIfNecessary: Explicitly disabling chunking because KFS is using a JAX-RS client of CXF type " + client.getClass().getName()); ClientConfiguration cxfConfig = WebClient.getConfig(requestBuilder); HTTPConduit conduit = cxfConfig.getHttpConduit(); HTTPClientPolicy clientPolicy = conduit.getClient(); clientPolicy.setAllowChunking(false); } else { LOG.info("disableRequestChunkingIfNecessary: There is no need to explicitly disable chunking for a JAX-RS client of type " + client.getClass().getName()); } }
Source:
<code>protected void onNewIntent(Intent intent) { super.onNewIntent(intent); if (mNotificationManager == null) { mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); } if (mBuilder == null) { mBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this) .setContentTitle(getString(R.string.notif_title)) .setColor(ContextCompat.getColor(this, R.color.notif_background)); } String action = intent.getAction(); String type = intent.getType(); if (Intent.ACTION_SEND.equals(action) && type != null) { if ("text/plain".equals(type)) { handleSentText(intent); } else { handleSentFile((Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM)); } } String filePath = intent.getStringExtra(Intent.EXTRA_TEXT); if (action == null) { if (!TextUtils.isEmpty(filePath)) { File photoFile = new File(filePath); uploadFile(photoFile); } else { dispatchTakePictureIntent(); } <START> } else if (action.equals(ACTION_MESSAGE_PUSH_NOTIFICATION)) { <END> } }</code><technical_language>cool, structurally I handle this case in preceding if-else is for discerning actions. Works</technical_language>

Target:
protected void onNewIntent(Intent intent) { super.onNewIntent(intent); if (mNotificationManager == null) { mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); } if (mBuilder == null) { mBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this) .setContentTitle(getString(R.string.notif_title)) .setColor(ContextCompat.getColor(this, R.color.notif_background)); } String action = intent.getAction(); String type = intent.getType(); if (Intent.ACTION_SEND.equals(action) && type != null) { if ("text/plain".equals(type)) { handleSentText(intent); } else { handleSentFile((Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM)); } } else if (ACTION_MESSAGE_PUSH_NOTIFICATION.equals(action)) { return; } String filePath = intent.getStringExtra(Intent.EXTRA_TEXT); if (action == null) { if (!TextUtils.isEmpty(filePath)) { File photoFile = new File(filePath); uploadFile(photoFile); } else { dispatchTakePictureIntent(); } } }
Source:
<code>public OwApplicability getOrCreateApplicability(OwArtifact artifact) { OwApplicability app = null; <START> app = artifact.getAppId(); <END> if (app == null) { app = new OwApplicability(); artifact.setAppId(app); } return app; }</code><technical_language>combine lines -> OwApplicability app = artifact.getAppId();</technical_language>

Target:
public OwApplicability getOrCreateApplicability(OwArtifact artifact) { OwApplicability app = artifact.getAppId(); if (app == null) { app = new OwApplicability(); artifact.setAppId(app); } return app; }
Source:
<code>public void write(DataIdentifier identifier, File file) throws DataStoreException { File dest = getFile(identifier, fsPathDir); <START> if (dest.exists()) { <END> long now = System.currentTimeMillis(); if (getLastModified(dest) < now + ACCESS_TIME_RESOLUTION) { setLastModified(dest, now + ACCESS_TIME_RESOLUTION); } } else { try { File parent = dest.getParentFile(); parent.mkdirs(); if (file.renameTo(dest)) { file = null; } else { throw new IOException( "Can not rename " + file.getAbsolutePath() + " to " + dest.getAbsolutePath() + " (media read only?)"); } } catch (IOException ie) { LOG.error("failed to copy to [{}]", file.getAbsolutePath(), dest.getAbsolutePath()); throw new DataStoreException("Not able to write file [" + identifier + "]", ie); } } }</code><technical_language>is required is copy file created in caching layer (which is local fs) a temp file in NFS (which FSBackend typically represent) do in synchronized block</technical_language>

Target:
public void write(DataIdentifier identifier, File file) throws DataStoreException { TransientFileFactory fileFactory = TransientFileFactory.getInstance(); File tmpFile = null; File dest = getFile(identifier, fsPathDir); if(dest.exists()) { long now = System.currentTimeMillis(); if (getLastModified(dest) < now + ACCESS_TIME_RESOLUTION) { setLastModified(dest, now + ACCESS_TIME_RESOLUTION); } } else { try { tmpFile = fileFactory.createTransientFile("fsbackend", null, fsPathDir); try { FileUtils.copyFile(file, tmpFile); } catch (IOException ie) { LOG.error("failed to copy to temporary file [{}]", file.getAbsolutePath(), tmpFile.getAbsolutePath()); throw new DataStoreException("Not able to copy file [" + identifier + "] to temporary file", ie); } File parent = dest.getParentFile(); parent.mkdirs(); synchronized (this) { if (tmpFile.renameTo(dest)) { tmpFile = null; } else { throw new IOException( "Can not rename " + tmpFile.getAbsolutePath() + " to " + dest.getAbsolutePath() + " (media read only?)"); } } } catch (IOException e) { throw new DataStoreException("Could not add record", e); } finally { if (tmpFile != null) { tmpFile.delete(); } } } }
Source:
<code>public PostAggregator toPostAggregator( PlannerContext plannerContext, RowSignature rowSignature, RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor ) { final List<RexNode> operands = ((RexCall) rexNode).getOperands(); final List<PostAggregator> inputPostAggs = new ArrayList<>(); Integer lgK = null; String tgtHllType = null; int operandCounter = 0; for (RexNode operand : operands) { final PostAggregator convertedPostAgg = OperatorConversions.toPostAggregator( plannerContext, rowSignature, operand, postAggregatorVisitor ); if (convertedPostAgg == null) { if (operandCounter == 0) { try { <START> lgK = RexLiteral.intValue(operand); <END> } catch (RuntimeException re) { return null; } } else if (operandCounter == 1) { if (lgK == null) { return null; } try { tgtHllType = RexLiteral.stringValue(operand); } catch (RuntimeException re) { return null; } } else { return null; } } else { inputPostAggs.add(convertedPostAgg); operandCounter++; } } return new HllSketchUnionPostAggregator( postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), inputPostAggs, lgK, tgtHllType ); }</code><technical_language>check kind of operand is LITERAL call intValue()? Otherwise, this line throw AssertionError is caught catch</technical_language>

Target:
public PostAggregator toPostAggregator( PlannerContext plannerContext, RowSignature rowSignature, RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor ) { final List<RexNode> operands = ((RexCall) rexNode).getOperands(); final List<PostAggregator> inputPostAggs = new ArrayList<>(); Integer lgK = null; String tgtHllType = null; int operandCounter = 0; for (RexNode operand : operands) { final PostAggregator convertedPostAgg = OperatorConversions.toPostAggregator( plannerContext, rowSignature, operand, postAggregatorVisitor ); if (convertedPostAgg == null) { if (operandCounter == 0) { if (!operand.isA(SqlKind.LITERAL)) { return null; } try { lgK = RexLiteral.intValue(operand); } catch (ClassCastException re) { return null; } } else if (operandCounter == 1) { if (!operand.isA(SqlKind.LITERAL)) { return null; } if (lgK == null) { return null; } try { tgtHllType = RexLiteral.stringValue(operand); } catch (ClassCastException re) { return null; } } else { return null; } } else { inputPostAggs.add(convertedPostAgg); operandCounter++; } } return new HllSketchUnionPostAggregator( postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), inputPostAggs, lgK, tgtHllType ); }
Source:
<code>public void testSanity() throws Exception { File baseDir = Files.createTempDir(); <START> baseDir.deleteOnExit(); <END> try { FileSmoosher smoosher = new FileSmoosher(baseDir, 21); for (int i = 0; i < 20; ++i) { File tmpFile = File.createTempFile(String.format("smoosh-%s", i), ".bin"); tmpFile.deleteOnExit(); Files.write(Ints.toByteArray(i), tmpFile); smoosher.add(String.format("%d", i), tmpFile); tmpFile.delete(); } smoosher.close(); File[] files = baseDir.listFiles(); Arrays.sort(files); Assert.assertEquals(5, files.length); for (int i = 0; i < 4; ++i) { Assert.assertEquals(FileSmoosher.makeChunkFile(baseDir, i), files[i]); } Assert.assertEquals(FileSmoosher.metaFile(baseDir), files[files.length - 1]); SmooshedFileMapper mapper = SmooshedFileMapper.load(baseDir); for (int i = 0; i < 20; ++i) { ByteBuffer buf = mapper.mapFile(String.format("%d", i)); Assert.assertEquals(0, buf.position()); Assert.assertEquals(4, buf.remaining()); Assert.assertEquals(4, buf.capacity()); Assert.assertEquals(i, buf.getInt()); } mapper.close(); } finally { for (File file : baseDir.listFiles()) { file.delete(); } } }</code><technical_language>TemporaryFolder @Rule for junit for this</technical_language>

Target:
public void testSanity() throws Exception { File baseDir = folder.newFolder("base"); try (FileSmoosher smoosher = new FileSmoosher(baseDir, 21)) { for (int i = 0; i < 20; ++i) { File tmpFile = folder.newFile(String.format("smoosh-%s.bin", i)); Files.write(Ints.toByteArray(i), tmpFile); smoosher.add(String.format("%d", i), tmpFile); } } File[] files = baseDir.listFiles(); Arrays.sort(files); Assert.assertEquals(5, files.length); for (int i = 0; i < 4; ++i) { Assert.assertEquals(FileSmoosher.makeChunkFile(baseDir, i), files[i]); } Assert.assertEquals(FileSmoosher.metaFile(baseDir), files[files.length - 1]); try (SmooshedFileMapper mapper = SmooshedFileMapper.load(baseDir)) { for (int i = 0; i < 20; ++i) { ByteBuffer buf = mapper.mapFile(String.format("%d", i)); Assert.assertEquals(0, buf.position()); Assert.assertEquals(4, buf.remaining()); Assert.assertEquals(4, buf.capacity()); Assert.assertEquals(i, buf.getInt()); } } }
Source:
<code>public void closeEditors() { IFile file = getBookmarksFile(); FileEditorInput input = new FileEditorInput(file); IWorkbench wb = PlatformUI.getWorkbench(); for (IWorkbenchWindow wbWindow : wb.getWorkbenchWindows()) { for (IWorkbenchPage wbPage : wbWindow.getPages()) { for (IEditorReference editorReference : wbPage.getEditorReferences()) { try { if (editorReference.getEditorInput().equals(input)) { wbPage.closeEditor(editorReference.getEditor(false), false); } } catch (PartInitException e) { <START> e.printStackTrace(); <END> } } } } if (getParent() instanceof TmfTraceFolder) { TmfExperimentFolder experimentFolder = getProject().getExperimentsFolder(); for (ITmfProjectModelElement experiment : experimentFolder.getChildren()) { for (ITmfProjectModelElement child : experiment.getChildren()) { if (child.getName().equals(getName())) { ((TmfExperimentElement) experiment).closeEditors(); break; } } } } else if (getParent() instanceof TmfExperimentElement) { TmfExperimentElement experiment = (TmfExperimentElement) getParent(); experiment.closeEditors(); } }</code><technical_language>log error in error log? (Activator.getDefault().logError()</technical_language>

Target:
public void closeEditors() { IFile file = getBookmarksFile(); FileEditorInput input = new FileEditorInput(file); IWorkbench wb = PlatformUI.getWorkbench(); for (IWorkbenchWindow wbWindow : wb.getWorkbenchWindows()) { for (IWorkbenchPage wbPage : wbWindow.getPages()) { for (IEditorReference editorReference : wbPage.getEditorReferences()) { try { if (editorReference.getEditorInput().equals(input)) { wbPage.closeEditor(editorReference.getEditor(false), false); } } catch (PartInitException e) { Activator.getDefault().logError("Error closing editor for trace " + getName(), e); } } } } if (getParent() instanceof TmfTraceFolder) { TmfExperimentFolder experimentFolder = getProject().getExperimentsFolder(); for (ITmfProjectModelElement experiment : experimentFolder.getChildren()) { for (ITmfProjectModelElement child : experiment.getChildren()) { if (child.getName().equals(getName())) { ((TmfExperimentElement) experiment).closeEditors(); break; } } } } else if (getParent() instanceof TmfExperimentElement) { TmfExperimentElement experiment = (TmfExperimentElement) getParent(); experiment.closeEditors(); } }
Source:
<code>public Security withoutSecurity() { String bsUrl = "coap://" + bootstrapServer.getUnsecuredAddress().getHostString() + ":" + bootstrapServer.getUnsecuredAddress().getPort(); <START> return new Security(bsUrl, true, 3, new byte[0], new byte[0], new byte[0], 0, CertificateUsage.DOMAIN_ISSUER_CERTIFICATE.code); <END> }</code><technical_language>replace this : return Security.noSecBootstap(bsUrl);</technical_language>

Target:
public Security withoutSecurity() { String bsUrl = "coap://" + bootstrapServer.getUnsecuredAddress().getHostString() + ":" + bootstrapServer.getUnsecuredAddress().getPort(); return Security.noSecBootstap(bsUrl); }
Source:
<code>public void setUp() { account = CloudantClientHelper.getClient(); <START> db = account.database("lightcouch-db-test", true); <END> db.syncDesignDocsWithDb(); }</code><technical_language>If database names static this hard do parallel test runs account/server. In sync-android generally append current epoch time database names unique. This is scope of PR worth separately auditing test code for this</technical_language>

Target:
public void setUp() { account = CloudantClientHelper.getClient(); dbName = "view-pagination-test-" + Utils.generateUUID(); db = account.database(dbName, true); db.syncDesignDocsWithDb(); }