auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public FactoryDto resolveFactory( @ApiParam(value = "Parameters provided to create factories") Map<String, String> parameters, @ApiParam( value = "Whether or not to validate values like it is done when accepting a Factory", allowableValues = "true,false", defaultValue = "false") @DefaultValue("false") @QueryParam(VALIDATE_QUERY_PARAMETER) Boolean validate) throws BadRequestException { requiredNotNull(parameters, "Factory build parameters"); FactoryDto resolvedFactory = null; for (FactoryParametersResolver resolver : specificFactoryParametersResolvers) { if (resolver.accept(parameters)) { resolvedFactory = resolver.createFactory(parameters); break; } } if (resolvedFactory == null) { resolvedFactory = defaultFactoryResolver.createFactory(parameters); } if (resolvedFactory != null) { if (validate) { acceptValidator.validateOnAccept(resolvedFactory); } return injectLinks(resolvedFactory); } <START> throw new BadRequestException(FACTORY_NOT_RESOLVABLE); <END> }</code><technical_language>I rewrite in way: java { .... if (resolvedFactory == null) { throw new BadRequestException(FACTORY_NOT_RESOLVABLE); } if (validate) { acceptValidator.validateOnAccept(resolvedFactory); } return injectLinks(resolvedFactory); }</technical_language>

Target:
public FactoryDto resolveFactory( @ApiParam(value = "Parameters provided to create factories") Map<String, String> parameters, @ApiParam( value = "Whether or not to validate values like it is done when accepting a Factory", allowableValues = "true,false", defaultValue = "false") @DefaultValue("false") @QueryParam(VALIDATE_QUERY_PARAMETER) Boolean validate) throws BadRequestException, ServerException { requiredNotNull(parameters, "Factory build parameters"); FactoryDto resolvedFactory = factoryParametersResolverHolder .getFactoryParametersResolver(parameters) .createFactory(parameters); if (resolvedFactory == null) { throw new BadRequestException(FACTORY_NOT_RESOLVABLE); } if (validate) { acceptValidator.validateOnAccept(resolvedFactory); } return injectLinks(resolvedFactory); }
Source:
<code>public void testNotCreatedByRead() throws IOException { final Context ctx = new Context(); final DataHandleService dhs = ctx.service(DataHandleService.class); final File nonExistentFile = File.createTempFile("FileHandleTest", "none xistent file"); final URI uri = nonExistentFile.toURI(); assertTrue(nonExistentFile.delete()); assertFalse(nonExistentFile.exists()); final FileLocation loc = new FileLocation(uri); final DataHandle<?> handle = dhs.create(loc); assertFalse(handle.exists()); try { handle.read(); fail("Read successfully from non-existing file!"); } <START> catch (final Exception exc) { <END> } assertFalse(handle.exists()); handle.close(); }</code><technical_language>catching IOException instead of Exception here</technical_language>

Target:
public void testNotCreatedByRead() throws IOException { final Context ctx = new Context(); final DataHandleService dhs = ctx.service(DataHandleService.class); final File nonExistentFile = File.createTempFile("FileHandleTest", "none xistent file"); final URI uri = nonExistentFile.toURI(); assertTrue(nonExistentFile.delete()); assertFalse(nonExistentFile.exists()); final FileLocation loc = new FileLocation(uri); try (final DataHandle<?> handle = dhs.create(loc)) { assertFalse(handle.exists()); handle.read(); fail("Read successfully from non-existing file!"); } catch (final IOException exc) { } assertFalse(nonExistentFile.exists()); }
Source:
<code>public static void addTypes(Biome biome, Type... types) { Preconditions.checkArgument(ForgeRegistries.BIOMES.containsValue(biome), "Cannot add types to unregistered biome %s", biome); <START> List<Type> subTypes = listSupertypes(types); <END> for (Type type : subTypes) { type.biomes.add(biome); } getBiomeInfo(biome).types.addAll(subTypes); }</code><technical_language>Change variable name supertypes match</technical_language>

Target:
public static void addTypes(Biome biome, Type... types) { Preconditions.checkArgument(ForgeRegistries.BIOMES.containsValue(biome), "Cannot add types to unregistered biome %s", biome); Collection<Type> supertypes = listSupertypes(types); for (Type type : supertypes) { type.biomes.add(biome); } getBiomeInfo(biome).types.addAll(supertypes); }
Source:
<code><START> public void testGetProcessImageViaUIClientTest() throws Exception { <END> String result = uiServicesClient.getProcessImage(CONTAINER_ID, HIRING_PROCESS_ID); logger.debug("Image content is '{}'", result); assertNotNull(result); assertFalse(result.isEmpty()); result = uiServicesClient.getProcessImage(CONTAINER_ID, HIRING_2_PROCESS_ID); logger.debug("Image content is '{}'", result); assertNotNull(result); assertFalse(result.isEmpty()); result = uiServicesClient.getProcessImage(CONTAINER_ID, HIRING_3_PROCESS_ID); logger.debug("Image content is '{}'", result); assertNotNull(result); assertFalse(result.isEmpty()); }</code><technical_language>this method similar 3 times - if a new method, e.g. "assertImageViaUIClient" introduced, prevent code duplication</technical_language>

Target:
public void testGetProcessImageViaUIClientTest() throws Exception { String result = uiServicesClient.getProcessImage(CONTAINER_ID, HIRING_PROCESS_ID); assertImageContent(result); result = uiServicesClient.getProcessImage(CONTAINER_ID, HIRING_2_PROCESS_ID); assertImageContent(result); result = uiServicesClient.getProcessImage(CONTAINER_ID, HIRING_3_PROCESS_ID); assertImageContent(result); }
Source:
<code>public View getDropDownView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = getActivity().getLayoutInflater() .inflate(R.layout.two_line_spinner_dropdown_item, null); } Choice c = this.getItem(position); TextView text1 = (TextView) convertView.findViewById(android.R.id.text1); TextView text2 = (TextView) convertView.findViewById(android.R.id.text2); text1.setText(c.getName()); <START> text2.setText(" - " + c.getDescription()); <END> return convertView; }</code><technical_language>description only, remove " - "</technical_language>

Target:
public View getDropDownView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = getActivity().getLayoutInflater() .inflate(R.layout.two_line_spinner_dropdown_item, parent, false); } Choice c = this.getItem(position); TextView text1 = (TextView) convertView.findViewById(android.R.id.text1); TextView text2 = (TextView) convertView.findViewById(android.R.id.text2); text1.setText(c.getName()); text2.setText(Html.fromHtml(c.getDescription())); return convertView; }
Source:
<code>protected ModelNode parseResponse(CloseableHttpResponse response) throws IOException { ModelNode result; String content = EntityUtils.toString(response.getEntity()); int status = response.getStatusLine().getStatusCode(); if (status == HttpStatus.SC_OK) { result = ModelNode.fromJSONString(content); } else { result = new ModelNode(); result.get(Constants.OUTCOME).set(Constants.FAILED); <START> result.get(Constants.FAILURE_DESCRIPTION).set(content); <END> } return result; }</code><technical_language>Hey, I ask for copying _everything_ code in WildFly Core test suite :-) I original, response parsed for status code 500, better</technical_language>

Target:
private ModelNode parseResponse(CloseableHttpResponse response) throws IOException { ModelNode result; String content = EntityUtils.toString(response.getEntity()); int status = response.getStatusLine().getStatusCode(); if (status == HttpStatus.SC_OK || status == HttpStatus.SC_INTERNAL_SERVER_ERROR) { result = ModelNode.fromJSONString(content); } else { throw new RuntimeException(String.format("Server responded %s%nMessage:%n%s", status, content)); } return result; }
Source:
<code>public ElasticsearchClient(ElasticsearchTableDescriptionProvider descriptions, Duration requestTimeout) <START> throws IOException <END> { tableDescriptions = requireNonNull(descriptions, "description is null"); timeout = requireNonNull(requestTimeout, "requestTimeout is null"); for (ElasticsearchTableDescription tableDescription : tableDescriptions.getAllTableDescriptions()) { if (!clients.containsKey(tableDescription.getClusterName())) { Settings settings = Settings.builder().put("cluster.name", tableDescription.getClusterName()).build(); TransportAddress address = new TransportAddress(InetAddress.getByName(tableDescription.getHost()), tableDescription.getPort()); TransportClient client = new PreBuiltTransportClient(settings).addTransportAddress(address); clients.put(tableDescription.getClusterName(), client); } } }</code><technical_language>please squash it, this idea (POC), production ready code. Surely requires more work</technical_language>

Target:
public ElasticsearchClient(ElasticsearchTableDescriptionProvider descriptions, Duration requestTimeout) throws IOException { tableDescriptions = requireNonNull(descriptions, "description is null"); timeout = requireNonNull(requestTimeout, "requestTimeout is null"); for (ElasticsearchTableDescription tableDescription : tableDescriptions.getAllTableDescriptions()) { if (!clients.containsKey(tableDescription.getClusterName())) { Settings settings = Settings.builder().put("cluster.name", tableDescription.getClusterName()).build(); TransportAddress address = new TransportAddress(InetAddress.getByName(tableDescription.getHost()), tableDescription.getPort()); TransportClient client = new PreBuiltTransportClient(settings).addTransportAddress(address); clients.put(tableDescription.getClusterName(), client); } } this.tableColumnsCache = CacheBuilder.newBuilder() .expireAfterWrite(30, MINUTES) .refreshAfterWrite(15, MINUTES) .maximumSize(500) .build(asyncReloading(CacheLoader.from(this::loadColumns), executor)); }
Source:
<code>public void annotationToMethodsReturnsUnmodifiableMap() { <START> exception.expect(UnsupportedOperationException.class); <END> TestClass tc = new TestClass(MethodsAnnotated.class); Map<Class<? extends Annotation>, List<FrameworkMethod>> annotationToMethods = tc.getAnnotationToMethods(); annotationToMethods.put(Ignore.class, null); }</code><technical_language>put this line right call annotationToMethods.put(Ignore.class, null)</technical_language>

Target:
public void annotationToMethodsReturnsUnmodifiableMap() { TestClass tc = new TestClass(MethodsAnnotated.class); Map<Class<? extends Annotation>, List<FrameworkMethod>> annotationToMethods = tc.getAnnotationToMethods(); exception.expect(UnsupportedOperationException.class); annotationToMethods.put(Ignore.class, null); }
Source:
<code><START> public SmeltingRecipe.Builder from(SmeltingRecipe value) { <END> this.exemplaryResult = value.getExemplaryResult(); this.exemplaryIngredient = value.getExemplaryIngredient(); this.experience = 0; return this; }</code><technical_language>checkNotNull(value, "value");</technical_language>

Target:
public SmeltingRecipe.Builder from(SmeltingRecipe value) { checkNotNull(value, "value"); this.exemplaryResult = value.getExemplaryResult(); this.exemplaryIngredient = value.getExemplaryIngredient(); this.experience = 0; return this; }
Source:
<code>public SessionAndContactsTreeView(@NotNull Project project) { super(new SarosTreeRootNode()); Disposer.register(project, this); SarosPluginContext.initComponent(this); sessionTreeRootNode = new SessionTreeRootNode(this); ((SarosTreeRootNode) getModel().getRoot()).add(sessionTreeRootNode); contactTreeRootNode = new ContactTreeRootNode(this); ((SarosTreeRootNode) getModel().getRoot()).add(contactTreeRootNode); addMouseListener(new TreeClickListener(this)); getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); setCellRenderer(renderer); connectionHandler.addConnectionStateListener(connectionStateListener); contactsUpdateListener = (contact, updateType) -> { <START> if (project.isDisposed()) { <END> return; } if (updateType == UpdateType.ADDED || updateType == UpdateType.REMOVED) { renderConnected(); } }; xmppContactsService.addListener(contactsUpdateListener); renderConnectionState(connectionHandler.getConnectionState()); sessionTreeRootNode.setInitialState(); }</code><technical_language>I do threading requirements logic work in SWT. This is called UI thread (which basically a dispose) if this returns false dispose happen check. I guess Swing is more graceful in handling this surprised happen in SWT this pattern</technical_language>

Target:
public SessionAndContactsTreeView(@NotNull Project project) { super(new SarosTreeRootNode()); this.project = project; Disposer.register(project, this); SarosPluginContext.initComponent(this); sessionTreeRootNode = new SessionTreeRootNode(this); ((SarosTreeRootNode) getModel().getRoot()).add(sessionTreeRootNode); contactTreeRootNode = new ContactTreeRootNode(this); ((SarosTreeRootNode) getModel().getRoot()).add(contactTreeRootNode); addMouseListener(new TreeClickListener(this)); getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); setCellRenderer(renderer); connectionHandler.addConnectionStateListener(connectionStateListener); xmppContactsService.addListener(contactsUpdateListener); renderConnectionState(connectionHandler.getConnectionState()); sessionTreeRootNode.setInitialState(); }
Source:
<code>public void scannerBlocksWhenFull() throws Exception { final AtomicLong timeBeforeBlock = new AtomicLong(); final AtomicLong timeAfterBlock = new AtomicLong(); final int queueDepth = 10; final CountDownLatch addProcessDone = new CountDownLatch(1); <START> final ResponseQueueReader reader = new ResponseQueueReader(10, defaultTimeout); <END> final ExecutorService executorService = Executors.newFixedThreadPool(1); final List<ReadRowsResponse> responses = generateReadRowsResponses("rowKey-%s", queueDepth * 2); executorService.submit(new Callable<Void>() { @Override public Void call() throws Exception { for (int i = 0; i < queueDepth; i++) { reader.add(ResultQueueEntry.<ReadRowsResponse> newResult(responses.get(i))); } timeBeforeBlock.set(System.currentTimeMillis()); reader.add(ResultQueueEntry.<ReadRowsResponse> newResult(responses.get(queueDepth))); timeAfterBlock.set(System.currentTimeMillis()); reader.add(ResultQueueEntry.<ReadRowsResponse> newCompletionMarker()); addProcessDone.countDown(); return null; } }); Assert.assertFalse(addProcessDone.await(500, TimeUnit.MILLISECONDS)); reader.getNextMergedRow(); reader.getNextMergedRow(); Assert.assertTrue( "Expected add process to complete within 500 ms", addProcessDone.await(500, TimeUnit.MILLISECONDS)); executorService.shutdownNow(); }</code><technical_language>new ResponseQueueReader(queueDepth, defaultTimeout)</technical_language>

Target:
public void scannerBlocksWhenFull() throws Exception { final AtomicLong timeBeforeBlock = new AtomicLong(); final AtomicLong timeAfterBlock = new AtomicLong(); final int queueDepth = 10; final CountDownLatch addProcessDone = new CountDownLatch(1); final ResponseQueueReader reader = new ResponseQueueReader(queueDepth, defaultTimeout); final ExecutorService executorService = Executors.newFixedThreadPool(1); final List<ReadRowsResponse> responses = generateReadRowsResponses("rowKey-%s", queueDepth * 2); executorService.submit(new Callable<Void>() { @Override public Void call() throws Exception { for (int i = 0; i < queueDepth; i++) { reader.add(ResultQueueEntry.<ReadRowsResponse> newResult(responses.get(i))); } timeBeforeBlock.set(System.currentTimeMillis()); reader.add(ResultQueueEntry.<ReadRowsResponse> newResult(responses.get(queueDepth))); timeAfterBlock.set(System.currentTimeMillis()); reader.add(ResultQueueEntry.<ReadRowsResponse> newCompletionMarker()); addProcessDone.countDown(); return null; } }); Assert.assertFalse(addProcessDone.await(500, TimeUnit.MILLISECONDS)); reader.getNextMergedRow(); reader.getNextMergedRow(); Assert.assertTrue( "Expected add process to complete within 500 ms", addProcessDone.await(500, TimeUnit.MILLISECONDS)); executorService.shutdownNow(); }
Source:
<code>public void dcConfigChangePropagatedAfterRestart() throws Exception { domainConfig.getSlaveConfiguration().setCachedDC(true); domainManager = DomainTestSupport.create(domainConfig); domainManager.start(); domainManager.getDomainSlaveLifecycleUtil().stop(); long deadline = System.currentTimeMillis() + 1000; while (true) { if (!domainManager.getDomainSlaveLifecycleUtil().isHostControllerStarted()) { break; } if (System.currentTimeMillis() > deadline) { <START> break; <END> } } Assert.assertEquals(false, domainManager.getDomainSlaveLifecycleUtil().isHostControllerStarted()); domainManager.getDomainMasterLifecycleUtil() .executeForResult(getCreateOperationTestLoggingCategory()); domainManager.stop(); domainConfig.getMasterConfiguration().setRewriteConfigFiles(false); domainConfig.getSlaveConfiguration().setRewriteConfigFiles(false); domainManager.getDomainSlaveLifecycleUtil().startAsync(); try (DomainClient clientSlave = getDomainClient(domainConfig.getSlaveConfiguration())) { waitForHostControllerBeingStarted(TIMEOUT_S, clientSlave); waitForServersBeingStarted(TIMEOUT_S, clientSlave); } domainManager.getDomainMasterLifecycleUtil().startAsync(); try (DomainClient clientMaster = getDomainClient(domainConfig.getSlaveConfiguration())) { waitForHostControllerBeingStarted(TIMEOUT_S, clientMaster); waitForServersBeingStarted(TIMEOUT_S, clientMaster); } runWithTimeout(TIMEOUT_S, () -> checkHostControllerLogFile(domainConfig.getSlaveConfiguration(), "WFLYHC0202")); }</code><technical_language>A small sleep in this loop good</technical_language>

Target:
public void dcConfigChangePropagatedAfterRestart() throws Exception { domainConfig.getSlaveConfiguration().setCachedDC(true); domainManager = DomainTestSupport.create(domainConfig); domainManager.start(); domainManager.getDomainSlaveLifecycleUtil().stop(); long deadline = System.currentTimeMillis() + 1000; while (true) { if (!domainManager.getDomainSlaveLifecycleUtil().isHostControllerStarted()) { break; } if (System.currentTimeMillis() > deadline) { break; } Thread.sleep(TIMEOUT_SLEEP_MILLIS); } Assert.assertEquals(false, domainManager.getDomainSlaveLifecycleUtil().isHostControllerStarted()); domainManager.getDomainMasterLifecycleUtil() .executeForResult(getCreateOperationTestLoggingCategory()); domainManager.stop(); domainConfig.getMasterConfiguration().setRewriteConfigFiles(false); domainConfig.getSlaveConfiguration().setRewriteConfigFiles(false); domainManager.getDomainSlaveLifecycleUtil().startAsync(); try (DomainClient clientSlave = getDomainClient(domainConfig.getSlaveConfiguration())) { waitForHostControllerBeingStarted(TIMEOUT_S, clientSlave); waitForServersBeingStarted(TIMEOUT_S, clientSlave); } domainManager.getDomainMasterLifecycleUtil().startAsync(); try (DomainClient clientMaster = getDomainClient(domainConfig.getSlaveConfiguration())) { waitForHostControllerBeingStarted(TIMEOUT_S, clientMaster); waitForServersBeingStarted(TIMEOUT_S, clientMaster); } runWithTimeout(TIMEOUT_S, () -> checkHostControllerLogFile(domainConfig.getSlaveConfiguration(), "WFLYHC0202")); }
Source:
<code>private void stop() { if (this.initializeFuture != null) { this.initializeFuture.cancel(true); this.initializeFuture = null; } this.initializeResult = null; if (this.languageServer != null) { try { this.languageServer.shutdown(); } catch (Exception ex) { } } if (this.launcherFuture != null) { this.launcherFuture.cancel(true); this.launcherFuture = null; } if (this.lspStreamProvider != null) { this.lspStreamProvider.stop(); } while (!this.documents.isEmpty()) { <START> for (IPath path : this.documents.keySet()) { <END> disconnect(path); } } this.languageServer = null; FileBuffers.getTextFileBufferManager().removeFileBufferListener(this); }</code><technical_language>this initially a bug? sense extract this change in patch</technical_language>

Target:
private void stop() { if (this.initializeFuture != null) { this.initializeFuture.cancel(true); this.initializeFuture = null; } this.initializeResult = null; if (this.languageServer != null) { try { this.languageServer.shutdown(); } catch (Exception ex) { } } if (this.launcherFuture != null) { this.launcherFuture.cancel(true); this.launcherFuture = null; } if (this.lspStreamProvider != null) { this.lspStreamProvider.stop(); } while (!this.documents.isEmpty()) { disconnect(this.documents.keySet().iterator().next()); } this.languageServer = null; FileBuffers.getTextFileBufferManager().removeFileBufferListener(fileBufferListener); }
Source:
<code>private void parseST(final STAlgorithm st) throws TypeImportException, XMLStreamException { String text = getAttributeValue(LibraryElementTags.TEXT_ATTRIBUTE); if <START> (text != null) { <END> st.setText(text); } else { throw new TypeImportException(Messages.FBTImporter_ST_TEXTNOTSET_EXCEPTION); } proceedToEndElementNamed(LibraryElementTags.ST_ELEMENT); }</code><technical_language>order of operands</technical_language>

Target:
private void parseST(final STAlgorithm st) throws TypeImportException, XMLStreamException { String text = getAttributeValue(LibraryElementTags.TEXT_ATTRIBUTE); if (null != text) { st.setText(text); } else { throw new TypeImportException(Messages.FBTImporter_ST_TEXTNOTSET_EXCEPTION); } proceedToEndElementNamed(LibraryElementTags.ST_ELEMENT); }
Source:
<code>public Schema createSchema(DocumentType input) { Schema schema = Schema.createRecord(getName(input), null, input.getNamespace().prefix, false); <START> new LogicalType("documentType").addToSchema(schema); <END> List<Field> fields = new ArrayList<>(input.getSchemas().size()); for (org.nuxeo.ecm.core.schema.types.Schema s : context.sort(input.getSchemas())) { fields.add(new Field(s.getName(), context.createSchema(s), null, (Object) null)); } schema.setFields(fields); return schema; }</code><technical_language>Constants</technical_language>

Target:
public Schema createSchema(DocumentType input) { Schema schema = Schema.createRecord(getName(input), null, input.getNamespace().prefix, false); new LogicalType(DocumentModelMapper.DOCUMENT_TYPE).addToSchema(schema); List<Field> fields = new ArrayList<>(input.getSchemas().size()); for (org.nuxeo.ecm.core.schema.types.Schema s : context.sort(input.getSchemas())) { fields.add(new Field(s.getName(), context.createSchema(s), null, (Object) null)); } schema.setFields(fields); return schema; }
Source:
<code>public void karmaIncOrDec( ReceivePrivmsg event ) { Matcher incOrDecMatcher = incOrDecPattern.matcher( event.getText() ); if ( incOrDecMatcher.matches() ) { if ( isPrivate( event ) ) { <START> decideIncOrDec( event, event.getSender() ); <END> return; } if ( !event.getChannel().matches( Vilebot.getConfig().get( "ircChannel1" ) ) ) { event.reply( "You must be in " + Vilebot.getConfig().get( "ircChannel1" ) + " to give or receive karma." ); return; } String wordBlob = incOrDecMatcher.group( 0 ); String sender = BaseNick.toBaseNick( event.getSender() ); Set<String> nicks = new HashSet<String>(); Matcher nickMatcher = incOrDecBlobPattern.matcher( wordBlob ); while ( nickMatcher.find() ) { nicks.add( BaseNick.toBaseNick( nickMatcher.group( 1 ) ) ); } boolean insult = false; for ( String nick : nicks ) { if ( !nick.equals( sender ) ) decideIncOrDec( event, nick ); else insult = true; } if ( insult ) event.reply( "I think I'm supposed to insult you now." ); } }</code><technical_language>want people do PM this ability, no? do inc/dec (remove karma sender instead) behaviour increasing karma of foobar</technical_language>

Target:
private void karmaIncOrDec( ReceivePrivmsg event ) { Matcher incOrDecMatcher = incOrDecPattern.matcher( event.getText() ); if ( incOrDecMatcher.matches() ) { if ( isPrivate( event ) ) { KarmaDB.modNounKarma( event.getSender(), -1 ); return; } if ( !event.getChannel().matches( Vilebot.getConfig().get( "ircChannel1" ) ) ) { event.reply( "You must be in " + Vilebot.getConfig().get( "ircChannel1" ) + " to give or receive karma." ); return; } String wordBlob = incOrDecMatcher.group( 0 ); String sender = BaseNick.toBaseNick( event.getSender() ); Set<String> nicks = new HashSet<String>(); Matcher nickMatcher = incOrDecBlobPattern.matcher( wordBlob ); while ( nickMatcher.find() ) { nicks.add( BaseNick.toBaseNick( nickMatcher.group( 1 ) ) ); } boolean insult = false; for ( String nick : nicks ) { if ( !nick.equals( sender ) ) decideIncOrDec( event, nick ); else insult = true; } if ( insult ) event.reply( "I think I'm supposed to insult you now." ); } }
Source:
<code>private QueryDefinition createErrorsQueryDefinition() { String queryExpression = "select * from ExecutionErrorInfo where ERROR_ACK = "; <START> if (TestConfig.getKieServerDataSourceDriverClass().startsWith("com.sybase")) { <END> queryExpression += "0"; } else { queryExpression += "'0'"; } QueryDefinition query = new QueryDefinition(); query.setName("unAckErrors"); query.setSource(System.getProperty("org.kie.server.persistence.ds", "jdbc/jbpm-ds")); query.setExpression(queryExpression); query.setTarget("CUSTOM"); return query; }</code><technical_language>idea, this condition extracted separate method more readable. TestConfig.isSybaseDataSource(). reused in future for other tests</technical_language>

Target:
private QueryDefinition createErrorsQueryDefinition() { String queryExpression = "select * from ExecutionErrorInfo where ERROR_ACK = "; queryExpression += TestConfig.isSybaseDataSource() ? "0" : "'0'"; QueryDefinition query = new QueryDefinition(); query.setName("unAckErrors"); query.setSource(System.getProperty("org.kie.server.persistence.ds", "jdbc/jbpm-ds")); query.setExpression(queryExpression); query.setTarget("CUSTOM"); return query; }
Source:
<code>static boolean supportsJetpackSpeedUpSettings(SiteModel site) { <START> String jetpackVersion = site.getJetpackVersion(); <END> if (site.isUsingWpComRestApi() && site.isJetpackConnected() && !TextUtils.isEmpty(jetpackVersion)) { try { int index = jetpackVersion.lastIndexOf("-"); if (index > 0) { jetpackVersion = jetpackVersion.substring(0, index); } Version siteJetpackVersion = new Version(jetpackVersion); Version minVersion = new Version("5.8"); return siteJetpackVersion.compareTo(minVersion) >= 0; } catch (IllegalArgumentException e) { String errorStr = "Invalid site jetpack version " + jetpackVersion; AppLog.e(AppLog.T.UTILS, errorStr, e); CrashlyticsUtils.logException(e, AppLog.T.UTILS, errorStr); return true; } } return false; }</code><technical_language>is opportunity generalize "check minimum Jetpack version" code is this place need (first is in PluginUtils.isPluginFeatureAvailable()). do introducing a helper method in SiteUtils do this</technical_language>

Target:
static boolean supportsJetpackSpeedUpSettings(SiteModel site) { return SiteUtils.checkMinimalJetpackVersion(site, SPEED_UP_SETTINGS_JETPACK_VERSION); }
Source:
<code>public void finishTree(final DetailAST root) { final String[] lines = this.getLines(); <START> for (int line = 0; line < lines.length; line += 1) { <END> if (this.methods.inRange(line + 1) && this.validInnerClassMethod(line + 1) && EmptyLinesCheck.PATTERN.matcher(lines[line]).find()) { this.log(line + 1, "Empty line inside method"); } } this.methods.clear(); this.anons.clear(); super.finishTree(root); }</code><technical_language>@JimDeanSpivey ++line</technical_language>

Target:
public void finishTree(final DetailAST root) { final String[] lines = this.getLines(); for (int line = 0; line < lines.length; ++line) { if (this.methods.inRange(line + 1) && this.validInnerClassMethod(line + 1) && EmptyLinesCheck.PATTERN.matcher(lines[line]).find()) { this.log(line + 1, "Empty line inside method"); } } this.methods.clear(); this.anons.clear(); super.finishTree(root); }
Source:
<code>public CommandResult<CanvasViolation> move(final Element[] elements, final Point2D[] locations) { if (elements.length != locations.length) { throw new IllegalArgumentException("The length for the elements to move " + "does not match the locations provided."); } Command<AbstractCanvasHandler, CanvasViolation> command; if (elements.length == 1) { command = createMoveCommand(elements[0], locations[0]); } else { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> builder = new CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation>() .forward(); int i = 0; for (final Element element : elements) { final CanvasCommand<AbstractCanvasHandler> c = createMoveCommand(element, locations[i]); builder.addCommand(c); i++; } command = builder.build(); } final CommandResult<CanvasViolation> result = getCommandManager().execute(canvasHandler, command); if (!CommandUtils.isError(result) && shapeLocationsChangedEvent != null) { Collection<String> uuids = new ArrayList<>(); <START> for (final Element element : elements) { <END> uuids.add(element.getUUID()); } shapeLocationsChangedEvent.fire(new ShapeLocationsChangedEvent(uuids, canvasHandler)); } return result; }</code><technical_language>@Josephblt in cases this a more functional code List<String> uuids = elements.stream().map(Element::getUUID).collect(Collectors.toList()); I is cleaner easier understand, a suggestion</technical_language>

Target:
public CommandResult<CanvasViolation> move(final Element[] elements, final Point2D[] locations) { if (elements.length != locations.length) { throw new IllegalArgumentException("The length for the elements to move " + "does not match the locations provided."); } Command<AbstractCanvasHandler, CanvasViolation> command; if (elements.length == 1) { command = createMoveCommand(elements[0], locations[0]); } else { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> builder = new CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation>() .forward(); int i = 0; for (final Element element : elements) { final CanvasCommand<AbstractCanvasHandler> c = createMoveCommand(element, locations[i]); builder.addCommand(c); i++; } command = builder.build(); } CommandResult<CanvasViolation> result = getCommandManager().allow(canvasHandler, command); if (!CommandUtils.isError(result)) { result = getCommandManager().execute(canvasHandler, command); if (!CommandUtils.isError(result)) { List<String> uuids = Arrays.stream(elements).map(Element::getUUID).collect(Collectors.toList()); shapeLocationsChangedEvent.fire(new ShapeLocationsChangedEvent(uuids, canvasHandler)); } } return result; }
Source:
<code>private String beginningOfMonthManipulation(String value) { DateTime dateTime = new DateTime(value); <START> return dateTime.dayOfMonth().withMinimumValue().toString(); <END> }</code><technical_language>I set time midnight well</technical_language>

Target:
private String beginningOfMonthManipulation(String value) { DateTime dateTime = new DateTime(value); return dateTime.dayOfMonth().withMinimumValue().withTime(0, 0, 0, 0).toString(); }
Source:
<code><START> public int readFrom(ReadableByteChannel channel) throws IOException { <END> int bytesRead = 0; if (buffer == null) { bytesRead = channel.read(sizeBuffer); if(bytesRead == -1) return -1; if (sizeBuffer.position() == sizeBuffer.capacity()) { sizeBuffer.flip(); sizeToRead = (int)sizeBuffer.getLong(); sizeRead += 8; buffer = ByteBuffer.allocate(sizeToRead - 8); } } if (buffer != null && sizeRead < sizeToRead) { sizeRead += channel.read(buffer); if (sizeRead == sizeToRead) { buffer.flip(); } } logger.trace("size read from channel {}", sizeRead); return bytesRead; }</code><technical_language>This implementation is complete</technical_language>

Target:
public long readFrom(ReadableByteChannel channel) throws IOException { long bytesRead = 0; if (buffer == null) { bytesRead = channel.read(sizeBuffer); if (bytesRead == -1) { return -1; } if (sizeBuffer.position() == sizeBuffer.capacity()) { sizeBuffer.flip(); sizeToRead = (int) sizeBuffer.getLong(); sizeRead += 8; bytesRead += 8; buffer = ByteBuffer.allocate(sizeToRead - 8); } } if (buffer != null && sizeRead < sizeToRead) { long bytesReadFromChannel = channel.read(buffer); sizeRead += bytesReadFromChannel; bytesRead += bytesReadFromChannel; if (sizeRead == sizeToRead) { buffer.flip(); } } logger.trace("size read from channel {}", sizeRead); return bytesRead; }
Source:
<code>protected void createExpression() { logger.info("Creating an expression for condition {}", condition); <START> expressionFunctions.addAll(optionalExpressionFunctions); <END> expr = PojoUtils.createExpression(inClazz, condition, Boolean.class, expressionFunctions.toArray(new String[expressionFunctions.size()])); }</code><technical_language>need add non-null elements expressionFunctions</technical_language>

Target:
protected void createExpression() { logger.info("Creating an expression for condition {}", condition); for (String expression : additionalExpressionFunctions) { if (expression != null) { expressionFunctions.add(expression); } } expr = PojoUtils.createExpression(inClazz, condition, Boolean.class, expressionFunctions.toArray(new String[expressionFunctions.size()])); }
Source:
<code>private void updateConsoleAddressPartiallyOverridden(VDSGroup cluster) { AsyncQuery query = new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { boolean toShowWarning = (Boolean) ((VdcQueryReturnValue) returnValue).getReturnValue(); setConsoleAddressPartiallyOverridden(toShowWarning); } } ); Frontend.RunQuery( VdcQueryType.GetHostsInClusterPartiallyOverridden, <START> new GetHostsInClusterPartiallyOverriddenParameters(cluster.getId()), <END> query ); }</code><technical_language>I guess classes names change</technical_language>

Target:
private void updateConsoleAddressPartiallyOverridden(VDSGroup cluster) { AsyncQuery query = new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { boolean isConsistent = (Boolean) ((VdcQueryReturnValue) returnValue).getReturnValue(); setConsoleAddressPartiallyOverridden(!isConsistent); } } ); Frontend.RunQuery( VdcQueryType.IsDisplayAddressConsistentInCluster, new IdQueryParameters(cluster.getId()), query ); }
Source:
<code>public static void main(String... args) throws IOException { if (Context.getJavaVersion() >= 9){ UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); System.exit(0); } if(!System.getProperty("os.arch").contains("64")) { <START> UILog.log("Parabot", "You are not running a 64-bit version of java, this might cause the client to lag or crash unexpectedly.\r\n" + <END> "It's recommended to upgrade to a 64-bit version."); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }</code><technical_language>Capitalize word Java</technical_language>

Target:
public static void main(String... args) throws IOException { if (Context.getJavaVersion() >= 9){ UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); System.exit(0); } if(!System.getProperty("os.arch").contains("64")) { UILog.log("Parabot", "You are not running a 64-bit version of Java, this might cause the client to lag or crash unexpectedly.\r\n" + "It's recommended to upgrade to a 64-bit version."); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }
Source:
<code>public BaseCouchbaseTableFunction(String bucketName, Class<V> valueClass, String... clusterNodes) { Preconditions.checkArgument(StringUtils.isNotEmpty(bucketName), "Bucket name is not allowed to be null or empty."); Preconditions.checkArgument(valueClass != null, "Value class is not allowed to be null."); Preconditions.checkArgument(ArrayUtils.isNotEmpty(clusterNodes), "Cluster nodes is not allowed to be null or empty."); this.bucketName = bucketName; this.clusterNodes = ImmutableList.copyOf(clusterNodes); <START> this.environmentConfigs = new CouchbaseEnvironmentConfigs(); <END> }</code><technical_language>"this" necessary</technical_language>

Target:
public BaseCouchbaseTableFunction(String bucketName, Class<V> valueClass, String... clusterNodes) { Preconditions.checkArgument(StringUtils.isNotEmpty(bucketName), "Bucket name is not allowed to be null or empty."); Preconditions.checkArgument(valueClass != null, "Value class is not allowed to be null."); Preconditions.checkArgument(ArrayUtils.isNotEmpty(clusterNodes), "Cluster nodes is not allowed to be null or empty."); this.bucketName = bucketName; this.clusterNodes = ImmutableList.copyOf(clusterNodes); environmentConfigs = new CouchbaseEnvironmentConfigs(); }
Source:
<code>public void before() { mapName = randomMapName(); noStatsMapName = mapName + "_no_stats"; <START> System.setProperty("hazelcast.proxy.destroy.timeout.millis", Integer.toString(PROXY_DESTROY_TIMEOUT)); <END> Config config = getConfig(); config.setProperty(PARTITION_COUNT.getName(), Integer.toString(PARTITIONS)); config.getMapConfig(mapName).setInMemoryFormat(inMemoryFormat); config.getMapConfig(noStatsMapName).setStatisticsEnabled(false); instance = createInstance(config); map = instance.getMap(mapName); noStatsMap = instance.getMap(noStatsMapName); queryTypes = initQueryTypes(); }</code><technical_language>Clear property test finishes</technical_language>

Target:
public void before() { mapName = randomMapName(); noStatsMapName = mapName + "_no_stats"; System.setProperty(HAZELCAST_PROXY_DESTROY_TIMEOUT_MILLIS, Integer.toString(PROXY_DESTROY_TIMEOUT)); Config config = getConfig(); config.setProperty(PARTITION_COUNT.getName(), Integer.toString(PARTITIONS)); config.getMapConfig(mapName).setInMemoryFormat(inMemoryFormat); config.getMapConfig(noStatsMapName).setStatisticsEnabled(false); instance = createInstance(config); map = instance.getMap(mapName); noStatsMap = instance.getMap(noStatsMapName); queryTypes = initQueryTypes(); }
Source:
<code>protected Predicate<GHHook> deleteWebhook() { return new Predicate<GHHook>() { public boolean apply(GHHook hook) { <START> if (hook ==null) { <END> return true; } try { hook.delete(); return true; } catch (IOException e) { throw new GHException("Failed to delete post-commit hook", e); } } }; }</code><technical_language>i get null instead of hook if call this method null. this is impossible, of hooks deleted filtering</technical_language>

Target:
protected Predicate<GHHook> deleteWebhook() { return new Predicate<GHHook>() { public boolean apply(GHHook hook) { try { Validate.notNull(hook).delete(); return true; } catch (IOException e) { throw new GHException("Failed to delete post-commit hook", e); } } }; }
Source:
<code>public static File[] getLogFiles(File[] logDirList,long snapshotZxid) { <START> List<File> files = Util.sortDataDir(logDirList, "log", true); <END> int lastIndex = files.size() - 1; List<File> v = new ArrayList<File>(5); for (int i = lastIndex; i >= 0; i--) { File f = files.get(i); long fzxid = Util.getZxidFromName(f.getName(), "log"); if (fzxid > snapshotZxid) { v.add(0, f); } else { v.add(0, f); break; } } return v.toArray(new File[0]); }</code><technical_language>param false a simpler for (File f : files) loop</technical_language>

Target:
public static File[] getLogFiles(File[] logDirList,long snapshotZxid) { List<File> files = Util.sortDataDir(logDirList, "log", false); List<File> v = new ArrayList<File>(5); for (File f : files) { if (!f.getName().startsWith("log.")) { continue; } long fzxid = Util.getZxidFromName(f.getName(), "log"); if (fzxid > snapshotZxid) { v.add(0, f); } else { v.add(0, f); break; } } return v.toArray(new File[0]); }
Source:
<code>public void testWorkManagerWork() throws Exception { MetricsTracker tracker = new MetricsTracker(); tracker.assertDiff(0, 0, 0, 0); <START> SleepWork work = new SleepWork(getDurationMillis()); <END> service.schedule(work); assertTrue(work.getSchedulingTime() != 0); Thread.sleep(getDurationMillis() / 3); assertState(RUNNING, work); tracker.assertDiff(0, 1, 0, 0); Thread.sleep(getDurationMillis()); tracker.assertDiff(0, 0, 1, 0); }</code><technical_language>Previously 3s set 200ms, ? I afraid this create randomness depending CI load</technical_language>

Target:
public void testWorkManagerWork() throws Exception { MetricsTracker tracker = new MetricsTracker(); tracker.assertDiff(0, 0, 0, 0); long duration = 3000; SleepWork work = new SleepWork(duration); service.schedule(work); assertTrue(work.getSchedulingTime() != 0); Thread.sleep(duration / 3); assertState(RUNNING, work); tracker.assertDiff(0, 1, 0, 0); Thread.sleep(duration); tracker.assertDiff(0, 0, 1, 0); }
Source:
<code>private void populateFields() { myProjectId.setText(""); myVersion.setText(""); Module appEngineModule = myModuleComboBox.getSelectedModule(); if (appEngineModule != null) { AppEngineGradleFacet facet = AppEngineGradleFacet.getAppEngineFacetByModule(appEngineModule); <START> if (facet == null) { <END> return; } final AppEngineWebApp appEngineWebApp = facet.getAppEngineWebXml(); if (appEngineWebApp == null) { return; } myProjectId.setText(appEngineWebApp.getApplication().getRawText()); myVersion.setText(appEngineWebApp.getVersion().getRawText()); } }</code><technical_language>I guess this happen in theory</technical_language>

Target:
private void populateFields() { myProjectId.setText(""); myVersion.setText(""); Module appEngineModule = myModuleComboBox.getSelectedModule(); if (appEngineModule != null) { AppEngineGradleFacet facet = AppEngineGradleFacet.getAppEngineFacetByModule(appEngineModule); if (facet == null) { Messages.showErrorDialog(this.getPeer().getOwner(), "Could not acquire App Engine module information.", "Deploy"); return; } final AppEngineWebApp appEngineWebApp = facet.getAppEngineWebXml(); if (appEngineWebApp == null) { Messages.showErrorDialog(this.getPeer().getOwner(), "Could not locate or parse the appengine-web.xml fle.", "Deploy"); return; } myProjectId.setText(appEngineWebApp.getApplication().getRawText()); myVersion.setText(appEngineWebApp.getVersion().getRawText()); } }
Source:
<code>public void onColumnsChange(MockDataFile dataFile) { <START> if (!this.dataFile.equals(dataFile)) { <END> return; } updateColumns(); }</code><technical_language>== sufficient faster .equals() testing identity of component equality</technical_language>

Target:
public void onColumnsChange(MockDataFile dataFile) { if (this.dataFile != dataFile) { return; } updateColumns(); }
Source:
<code>public void beforeNotify(Report report) { HttpServletRequest request = BugsnagServletRequestListener.getServletRequest(); if (request == null) { return; } report <START> .addToTab("request", "url", request.getRequestURL().toString()) <END> .addToTab("request", "method", request.getMethod()) .addToTab("request", "params", request.getParameterMap()) .addToTab("request", "clientIp", RequestUtils.getClientIp(request)) .addToTab("request", "headers", RequestUtils.getHeaderMap(request)); if (report.getContext() == null) { report.setContext(RequestUtils.generateContext(request)); } }</code><technical_language>this duplicates code RequestUtils RequestMetadataInterceptor , extract this out creating some method takes HttpServletRequest a parameter, returns a Map, add info is required</technical_language>

Target:
public void beforeNotify(Report report) { HttpServletRequest request = BugsnagServletRequestListener.getServletRequest(); if (request == null) { return; } report .addToTab("request", "url", request.getRequestURL().toString()) .addToTab("request", "method", request.getMethod()) .addToTab("request", "params", new HashMap<String, String[]>(request.getParameterMap())) .addToTab("request", "clientIp", getClientIp(request)) .addToTab("request", "headers", getHeaderMap(request)); if (report.getContext() == null) { report.setContext(request.getMethod() + " " + request.getRequestURI()); } }
Source:
<code><START> public void submit(C callable) { <END> WrappedTask wt = new WrappedTask(callable); wt.future = executorService.submit(wt); wrappedTasks.add(wt); }</code><technical_language>nice add a sanity check this fail if complete() called</technical_language>

Target:
public void submit(C callable) { if (isCompleting) { throw new ConcurrentModificationException( "TimeoutTaskExecutor is not a thread-safe class but complete() is currently in progress."); } WrappedTask wt = new WrappedTask(callable); wt.future = executorService.submit(wt); wrappedTasks.add(wt); }
Source:
<code>private String getContentOfStream(InputStream input) throws IOException { String charset = getRequestCharset(); <START> logger.debug("Using charset " + charset); <END> StringBuilder content = new StringBuilder(); byte[] buffer = new byte[1024]; int readed = 0; while ((readed = input.read(buffer)) != -1) { content.append(new String(buffer, 0, readed, charset)); } return content.toString(); }</code><technical_language><code>logger.debug("Using charset {}", charset)</code> instead</technical_language>

Target:
private String getContentOfStream(InputStream input) throws IOException { String charset = getRequestCharset(); logger.debug("Using charset {}", charset); StringBuilder content = new StringBuilder(); byte[] buffer = new byte[1024]; int readed = 0; while ((readed = input.read(buffer)) != -1) { content.append(new String(buffer, 0, readed, charset)); } return content.toString(); }
Source:
<code>public static void closeAllForUGI(UserGroupInformation ugi) throws IOException { if (LOGGER.isDebugEnabled()) { <START> debugLogFileSystemClose("closeAllForUGI", "UGI: " + ugi.toString()); <END> } CACHE.closeAll(ugi); }</code><technical_language>ugi automatic to.String work</technical_language>

Target:
public static void closeAllForUGI(UserGroupInformation ugi) throws IOException { debugLogFileSystemClose("closeAllForUGI", "UGI: " + ugi); CACHE.closeAll(ugi); }
Source:
<code><START> public Result<?> get(int rowIndex, int columnIndex) { <END> if (rowIndex < 0 || rowIndex >= rowCount) { throw new IllegalArgumentException( Messages.format( "Row index must be between zero and the row count ({}), but it was {}", rowCount, rowIndex)); } if (columnIndex < 0 || columnIndex >= columnCount) { throw new IllegalArgumentException( Messages.format( "Column index must be between zero and the column count ({}), but it was {}", columnCount, columnIndex)); } int index = (rowIndex * columnCount) + columnIndex; return values.get(index); }</code><technical_language>this is highly heavily called, benefit hotspot inlining adjustment: if (rowOrColumnIndexInvalid) { throw new IllegalArgumentException(generateMsg()); } // normal processing (as ArgChecker / Guava / JDK)</technical_language>

Target:
public Result<?> get(int rowIndex, int columnIndex) { if (rowIndex < 0 || rowIndex >= rowCount) { throw new IllegalArgumentException(invalidRowIndexMessage(rowIndex)); } if (columnIndex < 0 || columnIndex >= columnCount) { throw new IllegalArgumentException(invalidColumnIndexMessage(columnIndex)); } int index = (rowIndex * columnCount) + columnIndex; return items.get(index); }
Source:
<code>private RowType createJsonRowType(DataType databaseSchema) { DataType payload = DataTypes.ROW( DataTypes.FIELD("data", databaseSchema), <START> DataTypes.FIELD("old", databaseSchema), <END> DataTypes.FIELD("type", DataTypes.STRING())); return (RowType) payload.getLogicalType(); }</code><technical_language>maxwell-data.txt, insert delete produce field. remove this</technical_language>

Target:
private RowType createJsonRowType(DataType databaseSchema) { DataType payload = DataTypes.ROW( DataTypes.FIELD("data", databaseSchema), DataTypes.FIELD("type", DataTypes.STRING())); return (RowType) payload.getLogicalType(); }