auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ObjectId triggerUpdate(String ref) throws Exception { new Git(serverDb).checkout().setName(ref).call(); new FileWriter("foo.txt").append('U').close(); RevCommit commit = new Git(serverDb).commit() .setAll(true).setMessage("pubsub push").call(); ObjectId parent; <START> try { <END> parent = commit.getParent(0); } catch (ArrayIndexOutOfBoundsException e) { parent = ObjectId.zeroId(); } List<ReceiveCommand> updates = new ArrayList<ReceiveCommand>(); updates.add(new ReceiveCommand(parent, commit.getId(), ref)); publisher.onPush(serverDb, updates); return commit.getId(); }</code><technical_language>Nit: exceptions for control flow if avoid it: parent = commit.getParentCount() > 0 ? commit.getParent(0) : ObjectId.zeroId() (or something)</technical_language>

Target:
private ObjectId triggerUpdate(String ref) throws Exception { serverGit.checkout().setName(ref).call(); new FileWriter("foo.txt").append('U').close(); RevCommit commit = new Git(serverDb).commit() .setAll(true).setMessage("pubsub push").call(); ObjectId parent = commit.getParentCount() > 0 ? commit.getParent(0) : ObjectId.zeroId(); List<ReceiveCommand> updates = new ArrayList<ReceiveCommand>(); updates.add(new ReceiveCommand(parent, commit.getId(), ref)); publisher.onPush(serverDb, updates); return commit.getId(); }
Source:
<code>public PostsCreator clearOpenGraph() { <START> getEditor().findElement(getOpenGraphContainer()).findElement(By.className("og-close")).click(); <END> return this; }</code><technical_language>move By.className("og-close") PostsCreatorDesktop selectors consistent</technical_language>

Target:
public PostsCreator clearOpenGraph() { getOpenGraphDeleteButton().click(); return this; }
Source:
<code>public void sessionDestroyed(final HttpSession session) { if(!started) { return; } final HttpSessionEvent sre = new HttpSessionEvent(session); for (int i = httpSessionListeners.length - 1; i >= 0; --i) { ManagedListener listener = httpSessionListeners[i]; try { this.<HttpSessionListener> get(listener).sessionDestroyed(sre); } catch (Exception e) { <START> UndertowLogger.ROOT_LOGGER.debugf(e, "Exception happens in sessionDestroyed for session %s ", session); <END> } } }</code><technical_language>This error level</technical_language>

Target:
public void sessionDestroyed(final HttpSession session) { if(!started) { return; } final HttpSessionEvent sre = new HttpSessionEvent(session); for (int i = httpSessionListeners.length - 1; i >= 0; --i) { ManagedListener listener = httpSessionListeners[i]; try { this.<HttpSessionListener> get(listener).sessionDestroyed(sre); } catch (Exception e) { UndertowServletLogger.REQUEST_LOGGER.errorInvokingListener("sessionDestroyed", listener.getListenerInfo().getListenerClass(), e); } } }
Source:
<code><START> protected RulesCache ( @GerritServerConfig Config config, SitePaths site) { <END> this.cacheDir = site.resolve( config.getString("cache", null, "directory")); if (this.cacheDir != null) { this.rulesDir = new File(cacheDir, "rules"); } else { this.rulesDir = null; } }</code><technical_language>Style-nit: space (</technical_language>

Target:
protected RulesCache (@GerritServerConfig Config config, SitePaths site) { cacheDir = site.resolve( config.getString("cache", null, "directory")); if (cacheDir != null) { rulesDir = new File(cacheDir, "rules"); } else { rulesDir = null; } }
Source:
<code>@Test public void shouldBePayiQForm() throws IOException { String authBookingFormJson = IOUtils.toString(getClass(). getResourceAsStream("/auth-payiq-form.json"), Charset.defaultCharset()); JsonReader reader = new JsonReader(new StringReader(authBookingFormJson)); <START> reader.setLenient(true); <END> BookingForm bookingForm = gson.fromJson(reader, BookingForm.class); assertThat(bookingForm.isPayIQAuthForm()).isTrue(); }</code><technical_language>I setLenient(boolean) is needed. Based docs <LINK_0> I tested tests work fine it. removing</technical_language>

Target:
@Test public void shouldBePayiQForm() throws IOException { String authBookingFormJson = IOUtils.toString(getClass(). getResourceAsStream("/auth-payiq-form.json"), Charset.defaultCharset()); JsonReader reader = new JsonReader(new StringReader(authBookingFormJson)); BookingForm bookingForm = gson.fromJson(reader, BookingForm.class); assertThat(bookingForm.isPayIQAuthForm()).isTrue(); }
Source:
<code>private void addSuiteByRunAndNode(SuiteResult s) { <START> if (suitesByRunAndNode.get(s.getRunId()) == null) { <END> suitesByRunAndNode.put(s.getRunId(), new HashMap<String, List<SuiteResult>>()); } if (suitesByRunAndNode.get(s.getRunId()).get(s.getNodeId()) == null) { suitesByRunAndNode.get(s.getRunId()).put(s.getNodeId(), new ArrayList<SuiteResult>()); } suitesByRunAndNode.get(s.getRunId()).get(s.getNodeId()).add(s); }</code><technical_language>This block is confusing follow, successive puts, please consider restructuring nesting of conditionals clear flow of execution go</technical_language>

Target:
private void addSuiteByRunAndNode(SuiteResult s) { String runId = s.getRunId(); String nodeId = s.getNodeId(); if (runId != null && nodeId != null) { if (suitesByRunAndNode.get(runId) == null) { suitesByRunAndNode.put(runId, new HashMap<String, List<SuiteResult>>()); } if (suitesByRunAndNode.get(runId).get(nodeId) == null) { suitesByRunAndNode.get(runId).put(nodeId, new ArrayList<SuiteResult>()); } suitesByRunAndNode.get(runId).get(nodeId).add(s); List<String> enclosingBlocks = new ArrayList<>(s.getEnclosingBlocks()); if (!enclosingBlocks.isEmpty()) { populateBlocks(runId, enclosingBlocks, nodeId, null); } } }
Source:
<code>private static String getProjectId(String projectName, String token) { String projectId = null; HttpsURLConnection connection = null; InputStream inputStream = null; JsonParser jsonParser = null; try { String path = "api/v1/namespaces/" + projectName; URL url = new URL(NamespaceHandler.KUBERNETES_MASTER_URL + "/" + path); connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Authorization", "Bearer " + token); connection.connect(); int responseCode = connection.getResponseCode(); if (responseCode == 200) { JsonFactory jsonFactory = new JsonFactory(); jsonFactory.setCodec(new ObjectMapper()); inputStream = connection.getInputStream(); jsonParser = jsonFactory.createParser(inputStream); JsonNode jsonNode = jsonParser.readValueAsTree(); if (jsonNode != null) { JsonNode metadata = jsonNode.get("metadata"); projectId = metadata.get("uid").asText(); } } else { log.warnf("Error getting project metadata. Code %s: %s", responseCode, connection.getResponseMessage()); } } catch (IOException io) { log.error(io); } finally { try { if (jsonParser != null) { jsonParser.close(); } if (inputStream != null) { inputStream.close(); } } catch (IOException io) { log.error(io); } if (connection != null) { <START> connection.disconnect(); <END> } } return projectId; }</code><technical_language>This left open, if jsonParser throws Exception</technical_language>

Target:
private static String getProjectId(String projectName, String token) { String projectId = null; HttpsURLConnection connection = null; InputStream inputStream = null; JsonParser jsonParser = null; try { String path = "api/v1/namespaces/" + projectName; URL url = new URL(NamespaceHandler.KUBERNETES_MASTER_URL + "/" + path); connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Authorization", "Bearer " + token); connection.connect(); int responseCode = connection.getResponseCode(); if (responseCode == 200) { JsonFactory jsonFactory = new JsonFactory(); jsonFactory.setCodec(new ObjectMapper()); inputStream = connection.getInputStream(); jsonParser = jsonFactory.createParser(inputStream); JsonNode jsonNode = jsonParser.readValueAsTree(); if (jsonNode != null) { JsonNode metadata = jsonNode.get("metadata"); projectId = metadata.get("uid").asText(); } } else { log.warnf("Error getting project metadata. Code %s: %s", responseCode, connection.getResponseMessage()); } } catch (IOException io) { log.error(io); } finally { try { if (jsonParser != null) { jsonParser.close(); } } catch (IOException io) { log.error(io); } try { if (inputStream != null) { inputStream.close(); } } catch (IOException io) { log.error(io); } if (connection != null) { connection.disconnect(); } } return projectId; }
Source:
<code>public boolean install(Resource r, ResourceLocation location, Reference ref, ResourceTable table, CommCareInstance instance, boolean upgrade) throws UnresolvedResourceException, UnfullfilledRequirementsException { try { <START> OfflineUserRestore offlineUserRestore = OfflineUserRestore.buildInMemoryUserRestore(ref.getStream()); <END> storage().write(offlineUserRestore); if (upgrade) { table.commit(r, Resource.RESOURCE_STATUS_INSTALLED); } else { table.commit(r, Resource.RESOURCE_STATUS_UPGRADE); } cacheLocation = offlineUserRestore.getID(); } catch (IOException e) { throw new UnresolvedResourceException(r, e.getMessage()); } return true; }</code><technical_language>catching exceptions for invalid file contents that? Currently feels fail throwing generic exceptions IO exceptions other network traffic problems</technical_language>

Target:
public boolean install(Resource r, ResourceLocation location, Reference ref, ResourceTable table, CommCareInstance instance, boolean upgrade) throws UnresolvedResourceException, UnfullfilledRequirementsException { try { OfflineUserRestore offlineUserRestore = OfflineUserRestore.buildInMemoryUserRestore(ref.getStream()); storage().write(offlineUserRestore); if (upgrade) { table.commit(r, Resource.RESOURCE_STATUS_INSTALLED); } else { table.commit(r, Resource.RESOURCE_STATUS_UPGRADE); } cacheLocation = offlineUserRestore.getID(); } catch (IOException | XmlPullParserException | InvalidStructureException e) { throw new UnresolvedResourceException(r, e.getMessage()); } return true; }
Source:
<code>public void testSerialization() throws Exception { final Subscription subscription = new Subscription( Arrays.asList(new TimerEvent("0 * * * * *"), new TimerEvent("1 * * * * *")), new Condition("true"), new Template("test message"), <START> Arrays.asList("/gdc/account/profile/876ec68f5630b38de65852ed5d6236ff/channelConfigurations/59dca8f160b2c601f3c72e1b"), <END> new Meta("test subscription")); assertThat(subscription, jsonEquals(resource("notification/subscriptionToCreate.json"))); }</code><technical_language>I suggest Idea's hint singletonList</technical_language>

Target:
public void testSerialization() throws Exception { final Subscription subscription = new Subscription( Arrays.asList(new TimerEvent("0 * * * * *"), new TimerEvent("1 * * * * *")), new TriggerCondition("true"), new MessageTemplate("test message"), singletonList("/gdc/account/profile/876ec68f5630b38de65852ed5d6236ff/channelConfigurations/59dca62e60b2c601f3c72e18"), new Meta("test subscription")); assertThat(subscription, jsonEquals(resource("notification/subscriptionToCreate.json"))); }
Source:
<code>public void testMultiThreadedShared() throws Exception { secureHttpClientFactory.activate(createConfigMap(10, 200, 60, 5, 10, 60)); ThreadPoolExecutor workers = new ThreadPoolExecutor(20, 80, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(50 * 50), new NamedThreadFactory("workers")); List<HttpClientFacade> clients = new ArrayList<>(); final int CLIENTS = 2; final int REQUESTS = 2; for (int i = 0; i < CLIENTS; i++) { HttpClientFacade httpClient = secureHttpClientFactory.getHttpClient(); clients.add(httpClient); } final List<String> failures = new ArrayList<>(); for (int i = 0; i < REQUESTS; i++) { for (final HttpClientFacade client : clients) { workers.execute(new Runnable() { @Override public void run() { try { <START> ContentResponse response = client.GET("<LINK_0>"); <END> if (response.getStatus() != 200) { System.out.println(response.getStatus()); failures.add("Statuscode != 200"); } } catch (InterruptedException | ExecutionException | TimeoutException e) { failures.add("Unexpected exception:" + e.getMessage()); } } }); } } workers.shutdown(); workers.awaitTermination(120, TimeUnit.SECONDS); if (!failures.isEmpty()) { fail(failures.toString()); } secureHttpClientFactory.deactivate(); }</code><technical_language>if receiving requests tests. www.eclipse.org target</technical_language>

Target:
public void testMultiThreadedShared() throws Exception { secureHttpClientFactory.activate(createConfigMap(10, 200, 60, 5, 10, 60)); ThreadPoolExecutor workers = new ThreadPoolExecutor(20, 80, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(50 * 50)); List<CommonHttpClient> clients = new ArrayList<>(); final int CLIENTS = 2; final int REQUESTS = 2; for (int i = 0; i < CLIENTS; i++) { CommonHttpClient httpClient = secureHttpClientFactory.getCommonHttpClient(); clients.add(httpClient); } final List<String> failures = new ArrayList<>(); for (int i = 0; i < REQUESTS; i++) { for (final CommonHttpClient client : clients) { workers.execute(new Runnable() { @Override public void run() { try { ContentResponse response = client.GET(TEST_URL); if (response.getStatus() != 200) { System.out.println(response.getStatus()); failures.add("Statuscode != 200"); } } catch (InterruptedException | ExecutionException | TimeoutException e) { failures.add("Unexpected exception:" + e.getMessage()); } } }); } } workers.shutdown(); workers.awaitTermination(120, TimeUnit.SECONDS); if (!failures.isEmpty()) { fail(failures.toString()); } secureHttpClientFactory.deactivate(); }
Source:
<code>public int compareTo( Item item ) { if ( item == null ) { return ( value == 0 ) ? 0 : 1; } switch ( item.getType() ) { case INT_ITEM: { int itemValue = ( (IntItem) item ).value; return ( value < itemValue ) ? -1 : ( ( value == itemValue ) ? 0 : 1 ); } case LONG_ITEM: { long itemValue = ( (LongItem) item ).value; return ( value < itemValue ) ? -1 : ( ( value == itemValue ) ? 0 : 1 ); } case BIGINTEGER_ITEM: return BigInteger.valueOf( value ).compareTo( ( (BigIntegerItem) item ).value ); <START> case STRING_ITEM: <END> return 1; case LIST_ITEM: return 1; default: throw new RuntimeException( "invalid item: " + item.getClass() ); } }</code><technical_language>if this is IntItem item a LongItem BigIntegerItem, item is bigger, right (since control optimized value)</technical_language>

Target:
public int compareTo( Item item ) { if ( item == null ) { return ( value == 0 ) ? 0 : 1; } switch ( item.getType() ) { case INT_ITEM: int itemValue = ( (IntItem) item ).value; return ( value < itemValue ) ? -1 : ( ( value == itemValue ) ? 0 : 1 ); case LONG_ITEM: case BIGINTEGER_ITEM: return -1; case STRING_ITEM: return 1; case LIST_ITEM: return 1; default: throw new IllegalStateException( "invalid item: " + item.getClass() ); } }
Source:
<code>public void removePortletDefinition(IPortletDefinition portletDefinition, IPerson person) { IPortletDefinition portletDef = portletDefinitionDao.getPortletDefinition(portletDefinition.getPortletDefinitionId()); String portletDefinitionId = portletDefinition.getPortletDefinitionId().getStringId(); IEntity channelDefEntity = GroupService.getEntity(portletDefinitionId, IPortletDefinition.class); Iterator<IEntityGroup> iter = channelDefEntity.getAncestorGroups().iterator(); while (iter.hasNext()) { <START> IEntityGroup group = iter.next(); <END> group.removeChild(channelDefEntity); group.update(); } AuthorizationService authService = AuthorizationService.instance(); String target = PermissionHelper.permissionTargetIdForPortletDefinition(portletDefinition); IUpdatingPermissionManager upm = authService.newUpdatingPermissionManager(IPermission.PORTAL_SUBSCRIBE); IPermission[] oldPermissions = upm.getPermissionsForTarget(target); upm.removePermissions(oldPermissions); marketplaceRatingDao.clearRatingsForPortlet(portletDef); portletDefinitionDao.deletePortletDefinition(portletDef); }</code><technical_language>For refactor</technical_language>

Target:
public void removePortletDefinition(IPortletDefinition portletDefinition, IPerson person) { IPortletDefinition portletDef = portletDefinitionDao.getPortletDefinition(portletDefinition.getPortletDefinitionId()); String portletDefinitionId = portletDefinition.getPortletDefinitionId().getStringId(); IEntity channelDefEntity = GroupService.getEntity(portletDefinitionId, IPortletDefinition.class); for (IEntityGroup group : channelDefEntity.getAncestorGroups()) { group.removeChild(channelDefEntity); group.update(); } AuthorizationService authService = AuthorizationService.instance(); String target = PermissionHelper.permissionTargetIdForPortletDefinition(portletDefinition); IUpdatingPermissionManager upm = authService.newUpdatingPermissionManager(IPermission.PORTAL_SUBSCRIBE); IPermission[] oldPermissions = upm.getPermissionsForTarget(target); upm.removePermissions(oldPermissions); marketplaceRatingDao.clearRatingsForPortlet(portletDef); portletDefinitionDao.deletePortletDefinition(portletDef); }
Source:
<code>public void testAffiliationVocabTerm() throws Exception { SAXBuilder builder = new SAXBuilder(); Document modsDoc = builder.build(new FileInputStream(new File( "src/test/resources/datastream/inventoryMods.xml"))); when(dip.getMods()).thenReturn(modsDoc.detachRootElement()); <START> Map<String, List<List<String>>> authTerms = new HashMap<String, List<List<String>>>(); <END> List<List<String>> terms = new ArrayList<List<String>>(); List<String> depts = new ArrayList<String>(); depts.add("Music"); terms.add(depts); authTerms.put("<LINK_0>", terms); when(vocabManager.getAuthoritativeForms(any(PID.class), any(Element.class))).thenReturn(authTerms); filter.filter(dip); verify(idb).setDepartment(listCaptor.capture()); assertTrue(listCaptor.getValue().contains("Music")); }</code><technical_language>HashMap declaration need parameterized, HashMap<> sufficient. terms depts</technical_language>

Target:
public void testAffiliationVocabTerm() throws Exception { SAXBuilder builder = new SAXBuilder(); Document modsDoc = builder.build(new FileInputStream(new File( "src/test/resources/datastream/inventoryMods.xml"))); when(dip.getMods()).thenReturn(modsDoc.detachRootElement()); Map<String, List<List<String>>> authTerms = new HashMap<>(); List<List<String>> terms = new ArrayList<>(); List<String> depts = new ArrayList<>(); depts.add("Music"); terms.add(depts); authTerms.put("<LINK_0>", terms); when(vocabManager.getAuthoritativeForms(any(PID.class), any(Element.class))).thenReturn(authTerms); filter.filter(dip); verify(idb).setDepartment(listCaptor.capture()); assertTrue(listCaptor.getValue().contains("Music")); }
Source:
<code>public ValuesSourceConfig( ValuesSourceType valuesSourceType, FieldContext fieldContext, boolean unmapped, AggregationScript.LeafFactory script, ValueType scriptValueType, Object missing, ZoneId timeZone, DocValueFormat format, LongSupplier nowSupplier ) { if (unmapped && fieldContext != null) { throw new IllegalStateException("value source config is invalid; marked as unmapped but specified a mapped field"); } this.valuesSourceType = valuesSourceType; this.fieldContext = fieldContext; this.unmapped = unmapped; this.script = script; this.scriptValueType = scriptValueType; this.missing = missing; this.timeZone = timeZone; this.format = format == null ? DocValueFormat.RAW : format; this.nowSupplier = nowSupplier; if (!valid()) { throw new IllegalStateException( "value source config is invalid; must have either a field context or a script or marked as unwrapped"); } <START> final ValuesSource vs; <END> if (this.unmapped) { vs = valueSourceType().getEmpty(); } else { if (fieldContext() == null) { vs = valueSourceType().getScript(script(), scriptValueType()); } else { vs = valueSourceType().getField(fieldContext(), script()); } } if (missing() != null) { valuesSource = valueSourceType().replaceMissing(vs, missing, format, nowSupplier); } else { valuesSource = vs; } }</code><technical_language>This'd a cleaner a private final method early returns</technical_language>

Target:
public ValuesSourceConfig( ValuesSourceType valuesSourceType, FieldContext fieldContext, boolean unmapped, AggregationScript.LeafFactory script, ValueType scriptValueType, Object missing, ZoneId timeZone, DocValueFormat format, LongSupplier nowSupplier ) { if (unmapped && fieldContext != null) { throw new IllegalStateException("value source config is invalid; marked as unmapped but specified a mapped field"); } this.valuesSourceType = valuesSourceType; this.fieldContext = fieldContext; this.unmapped = unmapped; this.script = script; this.scriptValueType = scriptValueType; this.missing = missing; this.timeZone = timeZone; this.format = format == null ? DocValueFormat.RAW : format; this.nowSupplier = nowSupplier; if (!valid()) { throw new IllegalStateException( "value source config is invalid; must have either a field context or a script or marked as unwrapped"); } valuesSource = ConstructValuesSource(missing, format, nowSupplier); }
Source:
<code>public Map<Guid, GlusterAsyncTask> getTaskListForCluster(Guid id) { VDS upServer = ClusterUtils.getInstance().getUpServer(id); if (upServer == null) { <START> log.debug("No up server in cluster"); <END> return null; } VDSReturnValue returnValue =runVdsCommand(VDSCommandType.GlusterTasksList, new VdsIdVDSCommandParametersBase(upServer.getId())); if (returnValue.getSucceeded()) { List<GlusterAsyncTask> tasks = (List<GlusterAsyncTask>)returnValue.getReturnValue(); Map<Guid, GlusterAsyncTask> tasksMap = new HashMap<>(); for (GlusterAsyncTask task: tasks) { tasksMap.put(task.getTaskId(),task); } return tasksMap; } else { log.error(returnValue.getVdsError()); return null; } }</code><technical_language>change deug? interesting log? info</technical_language>

Target:
public Map<Guid, GlusterAsyncTask> getTaskListForCluster(Guid id) { VDS upServer = ClusterUtils.getInstance().getUpServer(id); if (upServer == null) { log.info("No up server in cluster"); return null; } VDSReturnValue returnValue =runVdsCommand(VDSCommandType.GlusterTasksList, new VdsIdVDSCommandParametersBase(upServer.getId())); if (returnValue.getSucceeded()) { List<GlusterAsyncTask> tasks = (List<GlusterAsyncTask>)returnValue.getReturnValue(); Map<Guid, GlusterAsyncTask> tasksMap = new HashMap<>(); for (GlusterAsyncTask task: tasks) { tasksMap.put(task.getTaskId(),task); } return tasksMap; } else { log.error(returnValue.getVdsError()); return null; } }
Source:
<code>public static AbstractCheck cloneCheck(AbstractCheck check) { final AbstractCheck clone; if (check instanceof OneCheckInstancePerApplication) { clone = check; } else if (check instanceof OneCheckInstancePerThread) { final ClassLoader classLoader = CheckCloneService.class.getClassLoader(); final ModuleFactory factory = new PackageObjectFactory( Checker.class.getPackage().getName(), classLoader); clone = doCloneCheck(check, factory); clone.init(); } else { if (LOG.isDebugEnabled()) { final String checkClassName = check.getClass().getSimpleName(); final String message = String.format(Locale.ROOT, CHECK_MUST_IMPLEMENT_INTERFACE_MSG, checkClassName); LOG.debug(message); } <START> clone = check; <END> } return clone; }</code><technical_language>default clone strongest cloning, is OneCheckInstancePerThread OneCheckInstancePerApplication? This amount of trobules for 3rd party checks upgraded</technical_language>

Target:
public static AbstractCheck cloneCheck(AbstractCheck check) { final AbstractCheck clone; if (check.getClass().isAnnotationPresent(FileStatefulCheck.class)) { clone = doCloneCheck(check); } else if (check.getClass().isAnnotationPresent(StatelessCheck.class) || check.getClass().isAnnotationPresent(GlobalStatefulCheck.class)) { clone = check; } else { final String checkClassName = check.getClass().getSimpleName(); final LocalizedMessage message = new LocalizedMessage(0, Definitions.CHECKSTYLE_BUNDLE, MODULE_MUST_IMPLEMENT_MT_INTERFACE, new String[] {checkClassName}, null, CheckCloneService.class, null); LOG.debug(message.getMessage()); clone = doCloneCheck(check); } return clone; }
Source:
<code>public void testVerificationResourceFields() throws HTTPError { BankAccount bankAccount = createdAssociatedBankAccount(); BankAccountVerification verification = bankAccount.verify(); assertNotNull(verification.attempts); assertNotNull(verification.attempts_remaining); assertNotNull(verification.created_at); assertNotNull(verification.deposit_status); assertNotNull(verification.href); assertNotNull(verification.id); <START> assertNotNull(verification.bank_account); <END> assertNotNull(verification.meta); assertNotNull(verification.updated_at); assertNotNull(verification.verification_status); }</code><technical_language>Assert verification.bank_account.href matches bankAccount.href</technical_language>

Target:
public void testVerificationResourceFields() throws HTTPError { BankAccount bankAccount = createdAssociatedBankAccount(); BankAccountVerification verification = bankAccount.verify(); assertEquals(verification.attempts.intValue(), 0); assertEquals(verification.attempts_remaining.intValue(), 3); assertNotNull(verification.created_at); assertEquals(verification.deposit_status, "succeeded"); assertTrue(verification.href.contains("/verifications/BZ")); assertTrue(verification.id.contains("BZ")); assertEquals(verification.bank_account.href, bankAccount.href); assertNotNull(verification.updated_at); assertEquals(verification.verification_status, "pending"); }
Source:
<code>public TabletState getState(Set<TServerInstance> liveServers) { <START> if (suspend != null) { <END> return TabletState.SUSPENDED; } TServerInstance server = getServer(); if (server == null) return TabletState.UNASSIGNED; if (server.equals(current) || server.equals(future)) { if (liveServers.contains(server)) if (server.equals(future)) { return TabletState.ASSIGNED; } else { return TabletState.HOSTED; } else { return TabletState.ASSIGNED_TO_DEAD_SERVER; } } return TabletState.UNASSIGNED; }</code><technical_language>AFAICT master set suspend column future is set. In MetaDataStateStore.suspend() suspend column is set tls.current != null && suspensionTimestamp >= 0</technical_language>

Target:
public TabletState getState(Set<TServerInstance> liveServers) { switch ((current == null ? 0 : _HAS_CURRENT) | (future == null ? 0 : _HAS_FUTURE) | (suspend == null ? 0 : _HAS_SUSPEND)) { case 0: return TabletState.UNASSIGNED; case _HAS_SUSPEND: return TabletState.SUSPENDED; case _HAS_FUTURE: case (_HAS_FUTURE | _HAS_SUSPEND): return liveServers.contains(future) ? TabletState.ASSIGNED : TabletState.ASSIGNED_TO_DEAD_SERVER; case _HAS_CURRENT: case (_HAS_CURRENT | _HAS_SUSPEND): return liveServers.contains(current) ? TabletState.HOSTED : TabletState.ASSIGNED_TO_DEAD_SERVER; default: throw new IllegalStateException(); } }
Source:
<code>private void prepareRetransmission(final Exchange exchange, final RetransmissionTask task) { if (executor.isShutdown()) { LOGGER.info("Endpoint is being destroyed: skipping retransmission"); return; } exchange.setRetransmissionHandle(null); updateRetransmissionTimeout(exchange); task.message.addMessageObserver(new MessageObserverAdapter() { @Override public void onSent() { task.message.removeMessageObserver(this); if (!exchange.isComplete()) { exchange.execute(new StripedExchangeJob(exchange) { @Override public void runStriped() { task.startTimer(); } }); } } @Override public void onSendError(Throwable error) { exchange.executeComplete(); <START> } <END> }); }</code><technical_language>Cleanup "ReliabilityLayer" work for CON, request leak. if leshan requests, I prefer add cleanup "ExchangeCleanupLayer" extending/add a cleanup for "CON responses". I feel, checking "failed()" callback (instead of "onSendError") )is a good idea</technical_language>

Target:
private void prepareRetransmission(final Exchange exchange, final RetransmissionTask task) { if (executor.isShutdown()) { LOGGER.info("Endpoint is being destroyed: skipping retransmission"); return; } exchange.setRetransmissionHandle(null); updateRetransmissionTimeout(exchange); task.message.addMessageObserver(new MessageObserverAdapter() { @Override public void onSent() { task.message.removeMessageObserver(this); if (!exchange.isComplete()) { exchange.execute(new StripedExchangeJob(exchange) { @Override public void runStriped() { task.startTimer(); } }); } } }); }
Source:
<code>public void testByteBufferRead() throws Exception { <START> prepareData(); <END> doByteBufferRead(jceCipherClass, false); doByteBufferRead(opensslCipherClass, false); doByteBufferRead(jceCipherClass, true); doByteBufferRead(opensslCipherClass, true); }</code><technical_language>Is move prepareData method? need generate data twice</technical_language>

Target:
public void testByteBufferRead() throws Exception { doByteBufferRead(jceCipherClass, false); doByteBufferRead(opensslCipherClass, false); doByteBufferRead(jceCipherClass, true); doByteBufferRead(opensslCipherClass, true); }
Source:
<code>public void invalidWhenDestinationEndsWithSlash() { <START> assertNotNull(new RefSpec("refs/heads/*:refs/heads/")); <END> }</code><technical_language>This is invalid change LHS a wildcard RHS not</technical_language>

Target:
public void invalidWhenDestinationEndsWithSlash() { assertNotNull(new RefSpec("refs/heads/master:refs/heads/")); }
Source:
<code>public void onSupportActionModeFinished(ActionMode mode) { mActionMode = null; if (selectedTextView != null) selectedTextView.setWindowFocusWait(false); <START> if (mSelectionModeActive == false) { <END> selectedTextView = null; } super.onSupportActionModeFinished(mode); }</code><technical_language>if (!mselectionModeActive)</technical_language>

Target:
public void onSupportActionModeFinished(ActionMode mode) { mActionMode = null; if (selectedTextView != null) selectedTextView.setWindowFocusWait(false); if (!selectionModeActive) { selectedTextView = null; } super.onSupportActionModeFinished(mode); }
Source:
<code>public void shouldRecordProcessRatio() { task = createStatelessTask(createConfig(false, "0"), StreamsConfig.METRICS_LATEST); final KafkaMetric metric = getMetric("active-process", "%s-ratio", task.id().toString(), StreamsConfig.METRICS_LATEST); assertEquals(0.0d, (double) metric.metricValue(), 0.0001d); <START> <END> task.recordProcessBatchTime(10L); task.recordProcessBatchTime(15L); task.recordProcessTimeRatioAndBufferSize(100L); assertEquals(0.25d, (double) metric.metricValue(), 0.0001d); task.recordProcessBatchTime(10L); assertEquals(0.25d, (double) metric.metricValue(), 0.0001d); task.recordProcessBatchTime(10L); task.recordProcessTimeRatioAndBufferSize(20L); assertEquals(1.0d, (double) metric.metricValue(), 0.0001d); }</code><technical_language>req: Please rename this unit test reflect new verifications</technical_language>

Target:
public void shouldRecordProcessRatio() { task = createStatelessTask(createConfig(false, "0"), StreamsConfig.METRICS_LATEST); final KafkaMetric metric = getMetric("active-process", "%s-ratio", task.id().toString(), StreamsConfig.METRICS_LATEST); assertThat(metric.metricValue(), equalTo(0.0d)); task.recordProcessBatchTime(10L); task.recordProcessBatchTime(15L); task.recordProcessTimeRatioAndBufferSize(100L); assertThat(metric.metricValue(), equalTo(0.25d)); task.recordProcessBatchTime(10L); assertThat(metric.metricValue(), equalTo(0.25d)); task.recordProcessBatchTime(10L); task.recordProcessTimeRatioAndBufferSize(20L); assertThat(metric.metricValue(), equalTo(1.0d)); }
Source:
<code>private void identifyDuplicateFieldDefinitionsForMessages(final List<Message> messages) { final StringBuilder errorMessage = new StringBuilder(); for (final Message message : messages) { final Set<Integer> allFieldsForMessage = new HashSet<>(); identifyDuplicateFieldDefinitionsForMessage( message.name(), message, allFieldsForMessage, new ArrayDeque<>(), errorMessage); } if (errorMessage.length() > 0) { if (!Boolean.getBoolean(CodecGenerationTool.VALIDATION_ALLOW_DUPLICATES)) { <START> throw new IllegalStateException(errorMessage.toString()); <END> } } }</code><technical_language>update error message in order users this option in order switch duplicate field validation off</technical_language>

Target:
private void identifyDuplicateFieldDefinitionsForMessages(final List<Message> messages) { final StringBuilder errorMessage = new StringBuilder(); for (final Message message : messages) { final Set<Integer> allFieldsForMessage = new HashSet<>(); identifyDuplicateFieldDefinitionsForMessage( message.name(), message, allFieldsForMessage, new ArrayDeque<>(), errorMessage); } if (errorMessage.length() > 0) { if (!allowDuplicates) { throw new IllegalStateException(String.format( "%sUse -D%s=true to allow duplicated fields (Dangerous. May broke parser).", errorMessage, CodecGenerationTool.FIX_CODECS_ALLOW_DUPLICATE_FIELDS)); } } }
Source:
<code>private void skipBytes(Stack stack, long byteCount) throws IOException, FormatException { boolean hasChunks = stack.chunkLogicalPositions != null; if (!stack.compression && !hasChunks) { <START> in.seek(in.getFilePointer() + byteCount); <END> state.nextReadPosition += byteCount; } else if (stack.compression) { if (skipBuffer == null) { skipBuffer = new byte[8192]; } while (byteCount > 0) { int readSize = (int)Math.min(skipBuffer.length, byteCount); readFromStack(stack, skipBuffer, 0, readSize); byteCount -= readSize; } } else { long remainingBytesInChunk = remainingBytesInChunk(stack); while (byteCount > 0) { while (remainingBytesInChunk == 0) { switchChunk(stack, state.currentChunk + 1); in.seek(state.chunkFileStart); remainingBytesInChunk = remainingBytesInChunk(stack); } long skipSize = Math.min(remainingBytesInChunk, byteCount); in.seek(in.getFilePointer() + skipSize); byteCount -= skipSize; remainingBytesInChunk -= skipSize; } } }</code><technical_language>This simplified in.skipBytes(byteCount), RandomAccessInputStream a skipBytes(long) method</technical_language>

Target:
private void skipBytes(Stack stack, long byteCount) throws IOException, FormatException { boolean hasChunks = stack.chunkLogicalPositions != null; if (!stack.compression && !hasChunks) { in.skipBytes(byteCount); state.nextReadPosition += byteCount; } else if (stack.compression) { if (skipBuffer == null) { skipBuffer = new byte[8192]; } while (byteCount > 0) { int readSize = (int)Math.min(skipBuffer.length, byteCount); readFromStack(stack, skipBuffer, 0, readSize); byteCount -= readSize; } } else { while(byteCount > 0) { int skipSize = (int)Math.min(byteCount, Integer.MAX_VALUE); readFromStackRaw(stack, null, 0, skipSize); byteCount -= skipSize; } } }
Source:
<code>public void run(IResources resources, IAnathemaModel anathemaModel, IAnathemaView view) { File legacyDatabaseFile = new File( anathemaModel.getRepository().getRepositoryPath() + "equipment/Equipment.yap" ); database = GsonEquipmentDatabase.CreateFrom(anathemaModel); EquipmentGson gson = new EquipmentGson(); if( !legacyDatabaseFile.exists() && isDatabaseEmpty() ) { ProxySplashscreen.getInstance().displayStatusMessage( resources.getString("Equipment.Bootjob.DefaultDatabaseSplashmessage")); try { ZipInputStream jarFile = new ZipInputStream( new BufferedInputStream( getJarFileLocation().openStream() ) ); ZipEntry file; while( (file = jarFile.getNextEntry()) != null ) { if( file.getName().matches( EQUIPMENT_REGEX ) ){ String itemJSON = getStringFromStream( jarFile ); database.saveTemplate( gson.fromJson( itemJSON ) ); } <START> } <END> } catch ( IOException e ) { throw new RuntimeException("Could not create default database."); } catch ( NoSuchElementException e ) { throw new RuntimeException("Could not create default database."); } } }</code><technical_language>this block duplicates functionality cover in AnathemaReflections.getResourcesMatching(String namepattern). moving item files resources\data, handing in instance of AnathemaReflections bootjobs, leverage them</technical_language>

Target:
public void run(IResources resources, IAnathemaModel anathemaModel, IAnathemaView view) { File legacyDatabaseFile = new File( anathemaModel.getRepository().getRepositoryPath(), "equipment" + File.separatorChar + "Equipment.yap" ); database = GsonEquipmentDatabase.CreateFrom(anathemaModel); EquipmentGson gson = new EquipmentGson(); if( !legacyDatabaseFile.exists() && isDatabaseEmpty() ) { ProxySplashscreen.getInstance().displayStatusMessage( resources.getString("Equipment.Bootjob.DefaultDatabaseSplashmessage")); try { for( IAnathemaResourceFile file : anathemaModel.getReflections().getResourcesMatching( EQUIPMENT_REGEX ) ) { String itemJSON = getStringFromStream( file.getURL().openStream() ); database.saveTemplateNoOverwrite( gson.fromJson( itemJSON ) ); } } catch ( IOException e ) { throw new RuntimeException("Could not create default database."); } } }
Source:
<code>private static boolean copyFile(String sourceFileName, String destinationFileName) { File sourceFile = new File(sourceFileName); File destinationFile = new File(destinationFileName); LOG.debug("copy file from-to: {}, {}", sourceFileName, destinationFileName); if (sourceFile.exists()) { try { <START> org.apache.commons.io.FileUtils.copyFile(sourceFile, destinationFile, false); <END> LOG.info("copy successful: {}", destinationFileName); gatewayNew = null; return true; } catch (IOException e) { LOG.error("error while copy: {}", destinationFileName, e); } } else { LOG.error("error while copy source not found: {}", sourceFileName); } return false; }</code><technical_language>do full name here? I another FileUtils here</technical_language>

Target:
private static boolean copyFile(String sourceFileName, String destinationFileName) { File sourceFile = new File(sourceFileName); File destinationFile = new File(destinationFileName); LOG.debug("copy file from-to: {}, {}", sourceFileName, destinationFileName); if (sourceFile.exists()) { try { FileUtils.copyFile(sourceFile, destinationFile, false); LOG.info("copy successful: {}", destinationFileName); return true; } catch (IOException e) { LOG.error("error while copy: {}", destinationFileName, e); } } else { LOG.error("error while copy source not found: {}", sourceFileName); } return false; }
Source:
<code>public synchronized void close(Handler<AsyncResult<Void>> completionHandler) { if (closed || eventBus == null) { if (completionHandler != null) { completionHandler.handle(Future.succeededFuture()); } return; } closed = true; closeHooks.run(ar -> { deploymentManager.undeployAll(ar1 -> { this.executeBlocking(fut -> { <START> if (haManager() != null) { <END> haManager().stop(); } fut.complete(); }, false, ar2 -> { addressResolver.close(ar3 -> { eventBus.close(ar4 -> { closeClusterManager(ar5 -> { Set<HttpServer> httpServers = new HashSet<>(sharedHttpServers.values()); Set<NetServerImpl> netServers = new HashSet<>(sharedNetServers.values()); sharedHttpServers.clear(); sharedNetServers.clear(); int serverCount = httpServers.size() + netServers.size(); AtomicInteger serverCloseCount = new AtomicInteger(); Handler<AsyncResult<Void>> serverCloseHandler = res -> { if (res.failed()) { log.error("Failure in shutting down server", res.cause()); } if (serverCloseCount.incrementAndGet() == serverCount) { deleteCacheDirAndShutdown(completionHandler); } }; for (HttpServer server : httpServers) { server.close(serverCloseHandler); } for (NetServerImpl server : netServers) { server.close(serverCloseHandler); } if (serverCount == 0) { deleteCacheDirAndShutdown(completionHandler); } }); }); }); }); }); }); }</code><technical_language>move test task execute task is need</technical_language>

Target:
public synchronized void close(Handler<AsyncResult<Void>> completionHandler) { if (closed || eventBus == null) { if (completionHandler != null) { completionHandler.handle(Future.succeededFuture()); } return; } closed = true; closeHooks.run(ar -> { deploymentManager.undeployAll(ar1 -> { HAManager haManager = haManager(); Future<Void> haFuture = Future.future(); if (haManager != null) { this.executeBlocking(fut -> { haManager.stop(); fut.complete(); }, false, haFuture); } else { haFuture.complete(); } haFuture.setHandler(ar2 -> { addressResolver.close(ar3 -> { eventBus.close(ar4 -> { closeClusterManager(ar5 -> { Set<HttpServer> httpServers = new HashSet<>(sharedHttpServers.values()); Set<NetServerImpl> netServers = new HashSet<>(sharedNetServers.values()); sharedHttpServers.clear(); sharedNetServers.clear(); int serverCount = httpServers.size() + netServers.size(); AtomicInteger serverCloseCount = new AtomicInteger(); Handler<AsyncResult<Void>> serverCloseHandler = res -> { if (res.failed()) { log.error("Failure in shutting down server", res.cause()); } if (serverCloseCount.incrementAndGet() == serverCount) { deleteCacheDirAndShutdown(completionHandler); } }; for (HttpServer server : httpServers) { server.close(serverCloseHandler); } for (NetServerImpl server : netServers) { server.close(serverCloseHandler); } if (serverCount == 0) { deleteCacheDirAndShutdown(completionHandler); } }); }); }); }); }); }); }
Source:
<code>private void writeFileParameter(@NonNull final Parameter param) throws IOException { mOut.writeBytes(PREFIX); mOut.writeBytes(mBoundary); mOut.writeBytes(NEWLINE); final String fileName = <START> param.mFileName != null ? param.mFileName : param.mFile != null ? param.mFile.getName() : ""; <END> mOut.writeBytes("Content-Disposition: form-data; name=\"" + param.mName + "\"; filename=\"" + fileName + "\""); mOut.writeBytes(NEWLINE); final MediaType type = param.mType != null ? param.mType : MediaType.APPLICATION_OCTET_STREAM; mOut.writeBytes("Content-Type: " + type.mType); mOut.writeBytes(NEWLINE); mOut.writeBytes(NEWLINE); if (param.mFile != null) { final Closer closer = Closer.create(); try { final InputStream in = closer.register(new FileInputStream(param.mFile)); IOUtils.copy(in, mOut); } catch (final Throwable t) { throw closer.rethrow(t); } finally { closer.close(); } } mOut.writeBytes(NEWLINE); }</code><technical_language>I parens readability here. java final String fileName = ( param.mFileName != null ? param.mFileName : ( param.mFile != null ? param.mFile.getName() : "" ) ); java final String fileName = param.mFileName != null ? param.mFileName : ( param.mFile != null ? param.mFile.getName() : "" ); do think</technical_language>

Target:
private void writeFileParameter(@NonNull final Parameter param) throws IOException { mOut.writeBytes(PREFIX); mOut.writeBytes(mBoundary); mOut.writeBytes(NEWLINE); String fileName = param.mFileName; if (fileName == null && param.mFile != null) { fileName = param.mFile.getName(); } if (fileName == null) { fileName = ""; } mOut.writeBytes("Content-Disposition: form-data; name=\"" + param.mName + "\"; filename=\"" + fileName + "\""); mOut.writeBytes(NEWLINE); final MediaType type = param.mType != null ? param.mType : MediaType.APPLICATION_OCTET_STREAM; mOut.writeBytes("Content-Type: " + type.mType); mOut.writeBytes(NEWLINE); mOut.writeBytes(NEWLINE); if (param.mFile != null) { final Closer closer = Closer.create(); try { final InputStream in = closer.register(new FileInputStream(param.mFile)); IOUtils.copy(in, mOut); } catch (final Throwable t) { throw closer.rethrow(t); } finally { closer.close(); } } mOut.writeBytes(NEWLINE); }
Source:
<code>public void exec(final Shell shell) throws IOException { final String dir = FilenameUtils.getFullPathNoEndSeparator(this.path); final String mask = FilenameUtils.getName(this.path); final String url = String.format( "<LINK_0>", this.bucket, this.prefix ); final int files = new Terminal(shell).exec( new StringBuilder() .append("CONFIG=$(mktemp /tmp/s3cmdput-XXXX)") .append(" && cat > $CONFIG") .append(" && HEAD=") .append( Terminal.quotate( Terminal.escape( String.format( "s3://%s/%s", this.bucket, this.prefix ) ) ) ) .append(" && cd ") .append(Terminal.quotate(Terminal.escape(dir))) .append(" && if [ -e ").append(mask).append(" ];then") .append(" FILES=$(find ").append(mask).append(" -type f)") <START> .append(" && for f in $FILES; do s3cmd --config=$CONFIG put $f \"$HEAD$f\" > /dev/null && echo $f; done; fi") <END> .toString(), new StringBuilder() .append("[default]\n") .append("access_key=").append(this.key).append('\n') .append("secret_key=").append(this.secret).append('\n') .toString() ).split("\n").length; if (mask.contains("*")) { final String href = String.format("%sindex.html", url); this.tag(String.format("see [%d files](%s)", files, href), href); } else { final String href = String.format("%s%s", url, mask); this.tag(String.format("see [%s](%s) file", mask, href), href); } }</code><technical_language>nice else output "No files mask ${mask}"</technical_language>

Target:
public void exec(final Shell shell) throws IOException { final String dir = FilenameUtils.getFullPathNoEndSeparator(this.path); final String mask = FilenameUtils.getName(this.path); final String url = String.format( "<LINK_0>", this.bucket, this.prefix ); final int files = new Terminal(shell).exec( new StringBuilder() .append("CONFIG=$(mktemp /tmp/s3cmdput-XXXX)") .append(" && cat > $CONFIG") .append(" && HEAD=") .append( Terminal.quotate( Terminal.escape( String.format( "s3://%s/%s", this.bucket, this.prefix ) ) ) ) .append(" && cd ") .append(Terminal.quotate(Terminal.escape(dir))) .append(" && if [ -e ").append(mask).append(" ];then") .append(" FILES=$(find ").append(mask).append(" -type f)") .append(" && for f in $FILES; do s3cmd --config=$CONFIG put $f \"$HEAD$f\" > /dev/null && echo $f; done;") .append(" else echo No files found by mask ").append(mask) .append("; fi;") .toString(), new StringBuilder() .append("[default]\n") .append("access_key=").append(this.key).append('\n') .append("secret_key=").append(this.secret).append('\n') .toString() ).split("\n").length; if (mask.contains("*")) { final String href = String.format("%sindex.html", url); this.tag(String.format("see [%d files](%s)", files, href), href); } else { final String href = String.format("%s%s", url, mask); this.tag(String.format("see [%s](%s) file", mask, href), href); } }
Source:
<code>public void createFullTextResource() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { ResponseEntity<String> response = storeTestAnnotation(FULL_TEXT_RESOURCE); validateResponse(response); Annotation storedAnno = getApiClient().parseResponseBody(response); <START> assertEquals(storedAnno.getBody().getInternalType(), ResourceTypes.FULL_TEXT_RESOURCE.name()); <END> }</code><technical_language>of full text verified well, comparison json file is needed</technical_language>

Target:
public void createFullTextResource() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { ResponseEntity<String> response = storeTestAnnotation(FULL_TEXT_RESOURCE); validateResponse(response); Annotation storedAnno = getApiClient().parseResponseBody(response); assertEquals(storedAnno.getBody().getInternalType(), ResourceTypes.FULL_TEXT_RESOURCE.name()); assertTrue(storedAnno.getBody().getValue().equals(FULL_TEXT_RESOURCE_VALUE)); }
Source:
<code>public void testCustomCleaner() throws Exception { deployContrib("org.nuxeo.ecm.platform.query.api.test", "configuration-test-contrib.xml"); <START> applyInlineDeployments(); <END> ConfigurationService cs = Framework.getService(ConfigurationService.class); String s = cs.getProperty(NXQLQueryBuilder.IGNORED_CHARS_KEY); assertEquals("&/{}()", s); assertNotNull(s); assertEquals("= 'a $ b'", NXQLQueryBuilder.serializeFullText("a $ b")); assertEquals("= '10.3'", NXQLQueryBuilder.serializeFullText("10.3")); }</code><technical_language>pushInlineDeployments ? - of deployContrib a test contribution</technical_language>

Target:
public void testCustomCleaner() throws Exception { pushInlineDeployments("org.nuxeo.ecm.platform.query.api.test:configuration-test-contrib.xml"); ConfigurationService cs = Framework.getService(ConfigurationService.class); String s = cs.getProperty(NXQLQueryBuilder.IGNORED_CHARS_KEY); assertEquals("&/{}()", s); assertNotNull(s); assertEquals("= 'a $ b'", NXQLQueryBuilder.serializeFullText("a $ b")); assertEquals("= '10.3'", NXQLQueryBuilder.serializeFullText("10.3")); }