auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ScoreFunction parse(QueryParseContext parseContext, XContentParser parser) throws IOException, QueryParsingException { String currentFieldName = null; String field = null; String text = null; String missing = null; XContentParser.Token token; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentFieldName = parser.currentName(); } else if (token.isValue()) { if ("field".equals(currentFieldName)) { field = parser.text(); } else if ("text".equals(currentFieldName)) { text = parser.text(); } else if ("missing".equals(currentFieldName)) { missing = parser.text(); } else { throw new QueryParsingException(parseContext, NAMES[0] + " query does not support [" + currentFieldName + "]"); } } } if (field == null) { throw new QueryParsingException(parseContext, "[" + NAMES[0] + "] required field 'field' missing"); } if (text == null) { throw new QueryParsingException(parseContext, "[" + NAMES[0] + "] required field 'text' missing"); } SearchContext searchContext = SearchContext.current(); MappedFieldType fieldType = searchContext.smartNameFieldType(field); if (fieldType == null) { throw new ElasticsearchException("Unable to find a field mapper for field [" + field + "]"); } return new LevenshteinDistanceScore(parseContext.lookup(), fieldType, text, missing); }

Target:
public ScoreFunction parse(QueryParseContext parseContext, XContentParser parser) throws IOException, QueryParsingException { String currentFieldName = null; String field = null; String text = null; String missing = null; XContentParser.Token token; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentFieldName = parser.currentName(); } else if (token.isValue()) { if ("field".equals(currentFieldName)) { field = parser.text(); } else if ("text".equals(currentFieldName)) { text = parser.text(); } else if ("missing".equals(currentFieldName)) { missing = parser.text(); } else { throw new QueryParsingException(parseContext, NAMES[0] + " query does not support [" + currentFieldName + "]"); } } } if (field == null) { throw new QueryParsingException(parseContext, "[" + NAMES[0] + "] required field 'field' missing"); } if (text == null) { throw new QueryParsingException(parseContext, "[" + NAMES[0] + "] required field 'text' missing"); } SearchContext searchContext = SearchContext.current(); MappedFieldType fieldType = searchContext.smartNameFieldType(field); if (fieldType == null) { throw new ElasticsearchException("Unable to load field type for field [" + field + "]"); } return new LevenshteinDistanceScore(parseContext.lookup(), fieldType, text, missing); }
Source:
public void writeSingleResult() throws Exception { Server server = Server.builder().build(); Query query = Query.builder().build(); Result result = new Result(System.currentTimeMillis(), "attributeName", "className", "objDomain", "classNameAlias", "typeName", ImmutableMap.of("key", (Object)1)); ByteArrayOutputStream out = new ByteArrayOutputStream(); OpenTSDBWriter writer = getOpenTSDBWriter(out); writer.doWrite(server, query, of(result)); Assertions.assertThat(out.toString()).startsWith("put classNameAlias.attributeName ") .contains("type=key") .contains("host=") .endsWith("\n"); }

Target:
public void writeSingleResult() throws Exception { Server server = Server.builder().build(); Query query = Query.builder().build(); Result result = new Result(System.currentTimeMillis(), "attributeName", "className", "objDomain", "classNameAlias", "typeName", ImmutableMap.of("key", (Object)1)); ByteArrayOutputStream out = new ByteArrayOutputStream(); OpenTSDBWriter writer = getOpenTSDBWriter(out); writer.doWrite(server, query, of(result)); assertThat(out.toString()).startsWith("put classNameAlias.attributeName ") .contains("type=key") .contains("host=") .endsWith("\n"); }
Source:
public void testWriteAdvHandle() throws Exception { Map<String, byte[]> customMetadata = new HashMap<>(); customMetadata.put("test", "test".getBytes(StandardCharsets.UTF_8)); try (WriteAdvHandle writer = result(newCreateLedgerOp() .withAckQuorumSize(1) .withWriteQuorumSize(2) .withEnsembleSize(3) .withDigestType(DigestType.MAC) .withCustomMetadata(customMetadata) .withPassword("password".getBytes(StandardCharsets.UTF_8)) .makeAdv() .execute());) { long entryId = 0; byte[] data = "foo".getBytes(StandardCharsets.UTF_8); writer.write(entryId++, ByteBuffer.wrap(data)).get(); writer.write(entryId++, ByteBuffer.wrap(data)).get(); writer.write(entryId++, Unpooled.wrappedBuffer(data)).get(1, TimeUnit.MINUTES); writer.write(entryId++, ByteBuffer.wrap(data)).get(1, TimeUnit.MINUTES); long expectedEntryId = writer.write(entryId++, ByteBuffer.wrap(data)).get(1, TimeUnit.MINUTES); assertEquals(expectedEntryId, writer.getLastAddConfirmed()); } }

Target:
public void testWriteAdvHandle() throws Exception { long ledgerId = 12345; setNewGeneratedLedgerId(ledgerId); try (WriteAdvHandle writer = result(newCreateLedgerOp() .withAckQuorumSize(1) .withWriteQuorumSize(2) .withEnsembleSize(3) .withPassword(password) .makeAdv() .execute());) { assertEquals(ledgerId, writer.getId()); long entryId = 0; result(writer.write(entryId++, ByteBuffer.wrap(data))); result(writer.write(entryId++, Unpooled.wrappedBuffer(data))); long expectedEntryId = result(writer.write(entryId++, ByteBuffer.wrap(data))); assertEquals(expectedEntryId, writer.getLastAddConfirmed()); } }
Source:
public Account getAccountByName(String accountName) { if (!isOpen) { throw new IllegalStateException("AccountService is closed."); } if (accountName == null) { throw new IllegalArgumentException("accountName cannot be null."); } return cache.getAccountByName(accountName); }

Target:
public Account getAccountByName(String accountName) { checkOpen(); Objects.requireNonNull(accountName, "accountName cannot be null."); return accountInfoMapRef.get().getAccountByName(accountName); }
Source:
public WorkflowAction findAction(final String actionId, final String stepId, final User user) throws DotDataException, DotSecurityException { Logger.debug(this, "Finding the action: " + actionId + " for the step: " + stepId); final WorkflowAction workflowAction = this.workFlowFactory.findAction(actionId, stepId); if (null != workflowAction) { if (!SYSTEM_WORKFLOW_ID.equals(workflowAction.getSchemeId())) { if (!hasValidLicense() && !this.getFriendClass().isFriend()) { throw new DotSecurityException( "You must have a valid license to see any available action."); } } } return workflowAction; }

Target:
public WorkflowAction findAction(final String actionId, final String stepId, final User user) throws DotDataException, DotSecurityException { Logger.debug(this, "Finding the action: " + actionId + " for the step: " + stepId); final WorkflowAction workflowAction = this.workFlowFactory.findAction(actionId, stepId); if (null != workflowAction) { if (!SYSTEM_WORKFLOW_ID.equals(workflowAction.getSchemeId())) { if (!hasValidLicense() && !this.getFriendClass().isFriend()) { throw new DotSecurityException("Workflow-Actions-License-required"); } } } return workflowAction; }
Source:
public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8(fieldName); ByteBuffer buf = ByteBuffer .allocate(1 + fieldNameBytes.length + Floats.BYTES * breaks.length) .put(CACHE_TYPE_ID) .put(fieldNameBytes) .put((byte)0); buf.asFloatBuffer().put(breaks); return buf.array(); }

Target:
public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8(fieldName); ByteBuffer buf = ByteBuffer .allocate(1 + fieldNameBytes.length + Floats.BYTES * breaks.length) .put(CACHE_TYPE_ID) .put(fieldNameBytes) .put((byte)0xFF); buf.asFloatBuffer().put(breaks); return buf.array(); }
Source:
private <IN, OUT> int addOperatorToStreamGraph( StreamOperatorFactory<OUT> operatorFactory, int inputId, TypeInformation<IN> inTypeInfo, TypeInformation<OUT> outTypInfo, String prefix, int parallelism, int maxParallelism, SinkTransformation<InputT, CommT, WriterStateT, GlobalCommT> sinkTransformation, Context context) { final StreamGraph streamGraph = context.getStreamGraph(); final String slotSharingGroup = context.getSlotSharingGroup(); final int transformationId = Transformation.getNewNodeId(); final ChainingStrategy chainingStrategy = sinkTransformation.getChainingStrategy(); if (chainingStrategy != null) { operatorFactory.setChainingStrategy(chainingStrategy); } streamGraph.addOperator( transformationId, slotSharingGroup, sinkTransformation.getCoLocationGroupKey(), operatorFactory, inTypeInfo, outTypInfo, String.format("%s %s", prefix, sinkTransformation.getName())); streamGraph.setParallelism(transformationId, parallelism); streamGraph.setMaxParallelism(transformationId, maxParallelism); StreamGraphUtils.configureBufferTimeout( streamGraph, transformationId, sinkTransformation, context.getDefaultBufferTimeout()); if (sinkTransformation.getUid() != null) { streamGraph.setTransformationUID( transformationId, String.format("%s %s", prefix, sinkTransformation.getUid())); } streamGraph.addEdge(inputId, transformationId, 0); return transformationId; }

Target:
private <IN, OUT> int addOperatorToStreamGraph( StreamOperatorFactory<OUT> operatorFactory, int inputId, TypeInformation<IN> inTypeInfo, TypeInformation<OUT> outTypInfo, String prefix, int parallelism, int maxParallelism, SinkTransformation<InputT, CommT, WriterStateT, GlobalCommT> sinkTransformation, Context context) { final StreamGraph streamGraph = context.getStreamGraph(); final String slotSharingGroup = context.getSlotSharingGroup(); final int transformationId = Transformation.getNewNodeId(); streamGraph.addOperator( transformationId, slotSharingGroup, sinkTransformation.getCoLocationGroupKey(), operatorFactory, inTypeInfo, outTypInfo, String.format("%s %s", prefix, sinkTransformation.getName())); streamGraph.setParallelism(transformationId, parallelism); streamGraph.setMaxParallelism(transformationId, maxParallelism); StreamGraphUtils.configureBufferTimeout( streamGraph, transformationId, sinkTransformation, context.getDefaultBufferTimeout()); if (sinkTransformation.getUid() != null) { streamGraph.setTransformationUID( transformationId, String.format("%s %s", prefix, sinkTransformation.getUid())); } streamGraph.addEdge(inputId, transformationId, 0); return transformationId; }
Source:
private FastPipedInputStream sink() throws IOException { FastPipedInputStream s = sink.get(); if (s==null) throw (IOException) new IOException("Reader side has already been abandoned", allocatedAt); return s; }

Target:
private FastPipedInputStream sink() throws IOException { FastPipedInputStream s = sink.get(); if (s==null) throw new IOException("Reader side has already been abandoned", allocatedAt); return s; }
Source:
private AuthenticationResult tryAcquireTokenSilent(final AuthenticationRequest authenticationRequest) throws AuthenticationException { AuthenticationResult authenticationResult = null; if (shouldTrySilentFlow(authenticationRequest)) { Logger.v(TAG, "Try to acquire token silently, return valid AT or use RT in the cache."); try { authenticationResult = acquireTokenSilentFlow(authenticationRequest); } catch (final AuthenticationException exception) { if (exception.getCode() == ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED && authenticationRequest.isSilent()) { Logger.e(TAG, exception.getMessage(), authenticationRequest.getLogInfo(), exception.getCode()); throw exception; } else if (exception.getCode() == ADALError.DEVICE_CONNECTION_IS_NOT_AVAILABLE) { Logger.e(TAG, exception.getMessage(), authenticationRequest.getLogInfo(), exception.getCode()); throw exception; } } final boolean isAccessTokenReturned = isAccessTokenReturned(authenticationResult); if (!isAccessTokenReturned && authenticationRequest.isSilent()) { final String errorInfo = authenticationResult == null ? "No result returned from acquireTokenSilent" : authenticationResult.getErrorLogInfo(); Logger.e(TAG, "Prompt is not allowed and failed to get token:", authenticationRequest.getLogInfo() + " " + errorInfo, ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED); throw new AuthenticationException( ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED, authenticationRequest.getLogInfo() + " " + errorInfo); } if (isAccessTokenReturned) { Logger.v(TAG, "Token is successfully returned from silent flow. "); } } return authenticationResult; }

Target:
private AuthenticationResult tryAcquireTokenSilent(final AuthenticationRequest authenticationRequest) throws AuthenticationException { AuthenticationResult authenticationResult = null; if (shouldTrySilentFlow(authenticationRequest)) { Logger.v(TAG, "Try to acquire token silently, return valid AT or use RT in the cache."); authenticationResult = acquireTokenSilentFlow(authenticationRequest); final boolean isAccessTokenReturned = isAccessTokenReturned(authenticationResult); if (!isAccessTokenReturned && authenticationRequest.isSilent()) { final String errorInfo = authenticationResult == null ? "No result returned from acquireTokenSilent" : authenticationResult.getErrorLogInfo(); Logger.e(TAG, "Prompt is not allowed and failed to get token:", authenticationRequest.getLogInfo() + " " + errorInfo, ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED); throw new AuthenticationException( ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED, authenticationRequest.getLogInfo() + " " + errorInfo); } if (isAccessTokenReturned) { Logger.v(TAG, "Token is successfully returned from silent flow. "); } } return authenticationResult; }
Source:
public void onResume() { super.onResume(); final String totalCards = ((CardDataAdapter) mListAdapter).getTotalCards() + " "; mDeckCards.setText(totalCards); mPriceSetting = Integer.parseInt(getFamiliarActivity().mPreferenceAdapter.getTradePrice()); mShowTotalDecklistPrice = getFamiliarActivity().mPreferenceAdapter .getShowtotalDecklistPrice(); mCompressedDecklist.clear(); readAndCompressDecklist(null, mCurrentDeck); mListAdapter.notifyDataSetChanged(); }

Target:
public void onResume() { super.onResume(); final String totalCards = Integer.toString(((CardDataAdapter) mListAdapter).getTotalCards()) + " "; mDeckCards.setText(totalCards); mPriceSetting = Integer.parseInt(getFamiliarActivity().mPreferenceAdapter.getTradePrice()); mShowTotalDecklistPrice = getFamiliarActivity().mPreferenceAdapter .getShowTotalDecklistPrice(); mCompressedDecklist.clear(); readAndCompressDecklist(null, mCurrentDeck); mListAdapter.notifyDataSetChanged(); }
Source:
static public void write(Reader in, OutputStream out) throws IOException { try { char[] charArray = new char[BUFFER_SIZE * 2]; byte[] byteArray; while (in.read(charArray) != -1) { byteArray = new String(charArray).getBytes(StandardCharsets.UTF_8); out.write(byteArray); } } finally { in.close(); } }

Target:
static public void write(Reader in, OutputStream out) throws IOException { write(in, new OutputStreamWriter(out)); }
Source:
private static boolean definesSimilarMethod(IType type, IMethod method) { String methodName= method.getElementName(); String[] parameterTypes= method.getParameterTypes(); IMethod methodOfType= type.getMethod(methodName, parameterTypes); return methodOfType.exists(); }

Target:
private static boolean definesSimilarMethod(IType type, IMethod method) throws JavaModelException { String methodName= method.getElementName(); IMethod[] typeMethods= type.getMethods(); return Arrays.asList(typeMethods).stream().anyMatch(typeMethod -> methodName.equals(typeMethod.getElementName())); }
Source:
public boolean processEntryCommands(List<String> args, String activeCommand) throws IOException, ApiException { if (null != activeCommand) { boolean processed = processEntrySpecificCommands(args, activeCommand); if (processed) { return true; } switch (activeCommand) { case "info": info(args); break; case "list": list(args); break; case "search": search(args); break; case "publish": publish(args); break; case "star": star(args); break; case WDL_STRING: descriptor(args, WDL_STRING); break; case CWL_STRING: descriptor(args, CWL_STRING); break; case "refresh": refresh(args); break; case "label": label(args); break; case "manual_publish": manualPublish(args); break; case "convert": convert(args); break; case LAUNCH: launch(args); break; case DOWNLOAD: download(args); break; case "verify": verify(args); break; case "test_parameter": testParameter(args); break; case "wes": isWesCommand = true; if (getEntryType().toLowerCase().equals(WORKFLOW)) { processWesCommands(args); } else { errorMessage("WES API calls are only valid for workflows not tools.", CLIENT_ERROR); } break; default: return false; } return true; } return false; }

Target:
public boolean processEntryCommands(List<String> args, String activeCommand) throws IOException, ApiException { if (null != activeCommand) { boolean processed = processEntrySpecificCommands(args, activeCommand); if (processed) { return true; } switch (activeCommand) { case "info": info(args); break; case "list": list(args); break; case "search": search(args); break; case "publish": publish(args); break; case "star": star(args); break; case WDL_STRING: descriptor(args, WDL_STRING); break; case CWL_STRING: descriptor(args, CWL_STRING); break; case "refresh": refresh(args); break; case "label": label(args); break; case "manual_publish": manualPublish(args); break; case "convert": convert(args); break; case LAUNCH: launch(args); break; case DOWNLOAD: download(args); break; case "verify": verify(args); break; case "test_parameter": testParameter(args); break; case "wes": isWesCommand = true; if (WORKFLOW.equalsIgnoreCase(getEntryType())) { processWesCommands(args); } else { errorMessage("WES API calls are only valid for workflows not tools.", CLIENT_ERROR); } break; default: return false; } return true; } return false; }
Source:
public void testDefault() { assertRecordedDefaults(recordDefaults(BenchmarkSuiteConfig.class) .setDatabase(null) .setSuitesTableName("benchmark_suites") .setQueriesTableName("benchmark_queries") .setSuite(null)); }

Target:
public void testDefault() { assertRecordedDefaults(recordDefaults(BenchmarkSuiteConfig.class) .setSuite(null) .setSuitesTableName("benchmark_suites") .setQueriesTableName("benchmark_queries")); }
Source:
public SerializedPage serialize(Page page) { SliceOutput serializationBuffer = new DynamicSliceOutput(toIntExact(page.getSizeInBytes() + Integer.BYTES)); writeRawPage(page, serializationBuffer, blockEncodingSerde); Slice slice = serializationBuffer.slice(); return serialize(slice, page.getPositionCount()); }

Target:
public SerializedPage serialize(Page page) { SliceOutput serializationBuffer = new DynamicSliceOutput(toIntExact(page.getSizeInBytes() + Integer.BYTES)); writeRawPage(page, serializationBuffer, blockEncodingSerde); Slice slice = serializationBuffer.slice(); int uncompressedSize = serializationBuffer.size(); byte markers = PageCodecMarker.none(); if (compressor.isPresent()) { ByteBuffer compressionBuffer = ByteBuffer.allocate(compressor.get().maxCompressedLength(uncompressedSize)); compressor.get().compress(slice.toByteBuffer(), compressionBuffer); compressionBuffer.flip(); if ((((double) compressionBuffer.remaining()) / uncompressedSize) <= MINIMUM_COMPRESSION_RATIO) { slice = Slices.wrappedBuffer(compressionBuffer); markers = COMPRESSED.set(markers); } } if (spillCipher.isPresent()) { slice = Slices.wrappedBuffer(spillCipher.get().encrypt(slice.toByteBuffer())); markers = ENCRYPTED.set(markers); } else { slice = Slices.copyOf(slice); } return new SerializedPage(slice, markers, page.getPositionCount(), uncompressedSize); }
Source:
long query(CorfuStoreMetadata.Timestamp timestamp, LogReplicationMetadataType key) { long val = -1; String str = queryString(timestamp, key); if (str != null) { val = Long.parseLong(str); } return val; }

Target:
public long query(CorfuStoreMetadata.Timestamp timestamp, LogReplicationMetadataType key) { long val = -1; String str = queryString(timestamp, key); if (str != null) { val = Long.parseLong(str); } return val; }
Source:
public void testIsVariant() { assertTrue(VariantUtils.isVariant(DataUtils.makeVariant("chr7", 200000, 200001, "A", newArrayList("C"), (Call[]) null))); assertFalse(VariantUtils.isVariant(DataUtils.makeVariant("chr7", 200000, 200001, "A", emptyAlt, (Call[]) null))); assertFalse(VariantUtils.isVariant(DataUtils.makeVariant("chr7", 200000, 200001, "A", null, (Call[]) null))); }

Target:
public void testIsVariant() { assertTrue(VariantUtils.isVariant(DataUtils.makeVariant("chr7", 200000, 200001, "A", Arrays.asList("C"), (Call[]) null))); assertFalse(VariantUtils.isVariant(DataUtils.makeVariant("chr7", 200000, 200001, "A", emptyAlt, (Call[]) null))); assertFalse(VariantUtils.isVariant(DataUtils.makeVariant("chr7", 200000, 200001, "A", null, (Call[]) null))); }
Source:
public RevCommit parseCommit(final AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { initializeShallowCommits(); RevObject c = peel(parseAny(id)); if (!(c instanceof RevCommit)) throw new IncorrectObjectTypeException(id.toObjectId(), Constants.TYPE_COMMIT); return (RevCommit) c; }

Target:
public RevCommit parseCommit(final AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { RevObject c = peel(parseAny(id)); if (!(c instanceof RevCommit)) throw new IncorrectObjectTypeException(id.toObjectId(), Constants.TYPE_COMMIT); return (RevCommit) c; }
Source:
private Template getTemplateFromElement(NodeList templateNodes) { ArrayList<Element> templateElements = new ArrayList<Element>(4); for (int i = 0; i < templateNodes.getLength(); i++) { Node node = templateNodes.item(i); if (node instanceof Element) { templateElements.add((Element) node); } } Text name = (Text) templateElements.get(0).getFirstChild(); Text filename = (Text) templateElements.get(1).getFirstChild(); Text description = (Text) templateElements.get(2).getFirstChild(); Text source = (Text) templateElements.get(3).getFirstChild(); return new Template(name.getData(), getFullPathToTemplate(filename.getData()), description.getData(), source.getData()); }

Target:
private Template getTemplateFromElement(NodeList templateNodes) { ArrayList<Element> templateElements = new ArrayList<Element>(4); for (int i = 0; i < templateNodes.getLength(); i++) { Node node = templateNodes.item(i); if (node instanceof Element) { templateElements.add((Element) node); } } Template template = new Template(); for (Element templateElement : templateElements) { Text elementText = (Text) templateElement.getFirstChild(); String elementString = elementText.getData(); switch (templateElement.getTagName()) { case "name": template.setName(elementString); break; case "filename": template.setPath(getFullPathToTemplate(elementString)); break; case "description": template.setDescription(elementString); break; case "source": template.setSource(elementString); break; } } return template; }
Source:
public ATCommandPacket(int frameID, String command, byte[] parameter) { super(XBeeAPIType.AT_COMMAND); this.frameID = frameID; this.command = command; this.parameter = parameter; }

Target:
public ATCommandPacket(int frameID, String command, byte[] parameter) { super(APIFrameType.AT_COMMAND); if (command == null) throw new NullPointerException("Command cannot be null."); if (frameID < 0 || frameID > 255) throw new IllegalArgumentException("Frame ID must be between 0 and 255."); this.frameID = frameID; this.command = command; this.parameter = parameter; }
Source:
public void canSearchForRepos() throws Exception { final String coords = "test/test"; final Search search = new RtGithub( new FakeRequest().withBody( Json.createObjectBuilder() .add("total_count", 1) .add( "items", Json.createArrayBuilder().add( Json.createObjectBuilder().add("full_name", coords) ) ).build().toString() ) ).search(); MatcherAssert.assertThat( search.repos("test", "stars", "desc").iterator().next() .coordinates().toString(), Matchers.equalTo(coords) ); }

Target:
public void canSearchForRepos() throws Exception { final String coords = "test-user1/test-repo1"; final Search search = new RtGithub( new FakeRequest().withBody( Json.createObjectBuilder() .add("total_count", 1) .add( "items", Json.createArrayBuilder().add( Json.createObjectBuilder().add("full_name", coords) ) ).build().toString() ) ).search(); MatcherAssert.assertThat( search.repos("test", "stars", "desc").iterator().next() .coordinates().toString(), Matchers.equalTo(coords) ); }
Source:
public void isSameAllergen_shouldBeCaseInsensitiveForNonCodedAllergen() { Concept concept = Context.getConceptService().getConceptByUuid(otherNonCodedConceptUuid); Assert.assertTrue(new Allergen(null, concept, "other value").isSameAllergen(new Allergen(null, concept, "OTHER VALUE"))); }

Target:
public void isSameAllergen_shouldBeCaseInsensitiveForNonCodedAllergen() { Concept concept = Context.getConceptService().getConceptByUuid(Allergen.getOtherNonCodedConceptUuid()); Assert.assertTrue(new Allergen(null, concept, "other value").isSameAllergen(new Allergen(null, concept, "OTHER VALUE"))); }
Source:
public void tearDown() throws Exception { for (MachineLocation machineLocation: machinesToTearDown) { try { location.release(machineLocation); } catch (Exception e) { } } if (managementContext != null) managementContext.terminate(); }

Target:
public void tearDown() throws Exception { Set<Exception> exceptions = Collections.EMPTY_SET; for (MachineLocation machineLocation: machinesToTearDown) { try { location.release(machineLocation); } catch (Exception e) { exceptions.add(e); } } if (managementContext != null) managementContext.terminate(); if (exceptions.size() > 0) { throw new CompoundRuntimeException("Exception during tear down", exceptions); } }
Source:
public static IdentityProviderSyncMode combineIdpAndMapperSyncMode(IdentityProviderSyncMode syncMode, IdentityProviderMapperSyncMode mapperSyncMode) { switch (mapperSyncMode) { case INHERIT: return syncMode; case IMPORT: return IdentityProviderSyncMode.IMPORT; case LEGACY: return IdentityProviderSyncMode.LEGACY; case FORCE: return IdentityProviderSyncMode.FORCE; default: throw new IllegalArgumentException("Should not happen"); } }

Target:
public static IdentityProviderSyncMode combineIdpAndMapperSyncMode(IdentityProviderSyncMode syncMode, IdentityProviderMapperSyncMode mapperSyncMode) { return IdentityProviderMapperSyncMode.INHERIT.equals(mapperSyncMode) ? syncMode : IdentityProviderSyncMode.valueOf(mapperSyncMode.toString()); }
Source:
public String getImplementedCapability() { return "Optaplanner"; }

Target:
public String getImplementedCapability() { return "OptaPlanner"; }
Source:
public CatalogProtos.PartitionDescProto getPartition(String databaseName, String tableName, String partitionName) throws CatalogException { throw new RuntimeException("not supported!"); }

Target:
public CatalogProtos.PartitionDescProto getPartition(String databaseName, String tableName, String partitionName) throws CatalogException { if (partitions.containsKey(tableName) && partitions.get(tableName).containsKey(partitionName)) { return partitions.get(tableName).get(partitionName); } else { throw new NoSuchPartitionException(partitionName); } }
Source:
public static int deepHashCode(final @Nullable Object o) { if (o == null) { return 0; } if (o.getClass().isArray()) { final int prime = 31; int result = 1; for (int i = 0; i < Array.getLength(o); i++) { result = prime * result + deepHashCode(Array.get(o, i)); } return result; } if (o instanceof Collection) { Collection<?> c = (Collection<?>) o; if (o instanceof Set) { int result = 0; for (Object e : c) { result += deepHashCode(e); } return result; } final int prime = 31; int result = 1; for (Object e : c) { result = prime * result + deepHashCode(e); } return result; } return o.hashCode(); }

Target:
public static int deepHashCode(final @Nullable Object o) { if (o == null) { return 0; } if (o.getClass().isArray()) { final int prime = 31; int result = 1; for (int i = 0; i < Array.getLength(o); i++) { result = prime * result + deepHashCode(Array.get(o, i)); } return result; } if (o instanceof Collection) { Collection<?> c = (Collection<?>) o; if (o instanceof Set && !(o instanceof SortedSet<?>)) { int result = 0; for (Object e : c) { result += deepHashCode(e); } return result; } final int prime = 31; int result = 1; for (Object e : c) { result = prime * result + deepHashCode(e); } return result; } return o.hashCode(); }
Source:
public void waitForVideoStart(String slotName) { waitForVideoPlayerVisible(slotName); }

Target:
public void waitForVideoStart(String slotName) { wait.forElementVisible(By.cssSelector(String.format(UI_ELEMENT_SELECTOR_FORMAT, slotName))); }
Source:
protected void analyzeRemoveChange(Compare.DiffResults diffResult, Map<Impact, List<Change>> impactSort) { for (RemoveChange removeAction : diffResult.getRemoveChanges()) { MetadataVisitable element = removeAction.getElement(); if (element instanceof ComplexTypeMetadata) { impactSort.get(Impact.MEDIUM).add(removeAction); } else if (element instanceof ContainedTypeFieldMetadata) { impactSort.get(Impact.HIGH).add(removeAction); } else if (element instanceof FieldMetadata) { impactSort.get(Impact.MEDIUM).add(removeAction); } else { throw new NotImplementedException(); } } }

Target:
protected void analyzeRemoveChange(Compare.DiffResults diffResult, Map<Impact, List<Change>> impactSort) { List<RemoveChange> removeChanges = diffResult.getRemoveChanges(); for (RemoveChange removeAction : removeChanges) { MetadataVisitable element = removeAction.getElement(); if (element instanceof ContainedTypeFieldMetadata) { impactSort.get(Impact.HIGH).add(removeAction); } else if (element instanceof ComplexTypeMetadata ) { impactSort.get(Impact.MEDIUM).add(removeAction); } else if (element instanceof FieldMetadata) { if (hasAncestor(removeChanges, (FieldMetadata) element, StringUtils.EMPTY)) { impactSort.get(Impact.HIGH).add(removeAction); } else { impactSort.get(Impact.MEDIUM).add(removeAction); } } else { throw new NotImplementedException(); } } }
Source:
public void deleteDigitalTwin(String digitalTwinId) { deleteDigitalTwinWithResponse(digitalTwinId, new RequestOptions(), Context.NONE).getValue(); }

Target:
public void deleteDigitalTwin(String digitalTwinId) { deleteDigitalTwinWithResponse(digitalTwinId, new DeleteDigitalTwinRequestOptions(), Context.NONE); }
Source:
private Multimap<String, ?> extractParameters(DispatchCommand dcmd) { String[] cmdArgs = dcmd.getArguments(); String paramName = null; int argPos = 0; Multimap<String, String> parms = ArrayListMultimap.create(); for (int i = 2; i < cmdArgs.length; i++) { String arg = cmdArgs[i]; if (arg.equals("--")) { for (i = i + 1; i < cmdArgs.length; i++) parms.put("$" + argPos++, cmdArgs[i]); continue; } int eqPos = arg.indexOf('='); if (arg.startsWith("--") && eqPos > 0) { parms.put(arg.substring(0, eqPos), arg.substring(eqPos + 1)); continue; } if (arg.startsWith("-")) { if (paramName != null) { parms.put(paramName, null); } paramName = arg; continue; } if (paramName == null) { parms.put("$" + argPos++, arg); } else { parms.put(paramName, arg); paramName = null; } } if(paramName != null) { parms.put(paramName, null); } return parms; }

Target:
private Multimap<String, ?> extractParameters(DispatchCommand dcmd) { String[] cmdArgs = dcmd.getArguments(); String paramName = null; int argPos = 0; Multimap<String, String> parms = ArrayListMultimap.create(); for (int i = 2; i < cmdArgs.length; i++) { String arg = cmdArgs[i]; if (arg.equals("--")) { for (i++; i < cmdArgs.length; i++) { parms.put("$" + argPos++, cmdArgs[i]); } break; } int eqPos = arg.indexOf('='); if (arg.startsWith("--") && eqPos > 0) { parms.put(arg.substring(0, eqPos), arg.substring(eqPos + 1)); continue; } if (arg.startsWith("-")) { if (paramName != null) { parms.put(paramName, null); } paramName = arg; continue; } if (paramName == null) { parms.put("$" + argPos++, arg); } else { parms.put(paramName, arg); paramName = null; } } if (paramName != null) { parms.put(paramName, null); } return parms; }
Source:
public ClassCodeContentPanel(TabbedPane panel, JNode jnode) { super(panel, jnode); javaCodePanel = new CodePanel(this); smaliCodePanel = new CodePanel(this) { @Override protected AbstractCodeArea createCodeArea(ContentPanel contentPanel) { return new SmaliArea(contentPanel); } }; setLayout(new BorderLayout()); areaTabbedPane.add(javaCodePanel, NLS.str("tabs.code")); areaTabbedPane.add(smaliCodePanel, NLS.str("tabs.smali")); add(areaTabbedPane); javaCodePanel.load(); areaTabbedPane.addChangeListener(e -> { CodePanel selectedPanel = (CodePanel) areaTabbedPane.getSelectedComponent(); selectedPanel.load(); }); }

Target:
public ClassCodeContentPanel(TabbedPane panel, JNode jnode) { super(panel, jnode); javaCodePanel = new CodePanel(this, new CodeArea(this)); smaliCodePanel = new CodePanel(this, new SmaliArea(this)); setLayout(new BorderLayout()); areaTabbedPane.add(javaCodePanel, NLS.str("tabs.code")); areaTabbedPane.add(smaliCodePanel, NLS.str("tabs.smali")); add(areaTabbedPane); javaCodePanel.load(); areaTabbedPane.addChangeListener(e -> { CodePanel selectedPanel = (CodePanel) areaTabbedPane.getSelectedComponent(); selectedPanel.load(); }); }
Source:
private Collection<IHyperlink> createHyperlinks(IRegion lineInfo, Optional<Matcher> fileRefPatternAtOffset) { Builder<IHyperlink> hyperlinks = ImmutableList.builder(); fileRefPatternAtOffset.ifPresent(matcher -> { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); Region linkRegion = new Region(lineInfo.getOffset() + matcher.start(1), matcher.end(1) - matcher.start(1)); IPath path = new Path(matcher.group(1)); IFile file = project.getFile(path); if (file != null && file.exists()) { if (file != null && file.exists()) { hyperlinks.add(new EditFileHyperlink(file, linkRegion)); } } else { file = root.getFile(path); if (file != null && file.exists()) { hyperlinks.add(new EditFileHyperlink(file, linkRegion)); } } }); return hyperlinks.build(); }

Target:
private Collection<IHyperlink> createHyperlinks(IRegion lineInfo, Optional<Matcher> fileRefPatternAtOffset) { Builder<IHyperlink> hyperlinks = ImmutableList.builder(); fileRefPatternAtOffset.ifPresent(matcher -> { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); Region linkRegion = new Region(lineInfo.getOffset() + matcher.start(1), matcher.end(1) - matcher.start(1)); IPath path = new Path(matcher.group(1)); IFile file = project.getFile(path); if (file != null && file.exists()) { hyperlinks.add(new EditFileHyperlink(file, linkRegion)); } else { file = root.getFile(path); if (file != null && file.exists()) { hyperlinks.add(new EditFileHyperlink(file, linkRegion)); } } }); return hyperlinks.build(); }
Source:
public void configure(Map<String, String> options) { useCache = Optional.ofNullable(options.get("cache")) .map(Boolean::parseBoolean) .orElse(true); if (options.containsKey("fileRoot")) { fileRoot = new File(options.get("fileRoot")); } }

Target:
public void configure(Map<String, String> options) { useCache = Optional.ofNullable(options.get("cache")).map(Boolean::parseBoolean).orElse(true); fileRoot = Optional.ofNullable(options.get("fileRoot")).map(File::new); }
Source:
public TimeoutLifecycleManager(ZeppelinConfiguration zConf) { this.checkInterval = zConf.getLong(ZeppelinConfiguration.ConfVars .ZEPPELIN_INTERPRETER_LIFECYCLE_MANAGER_TIMEOUT_CHECK_INTERVAL); this.timeoutThreshold = zConf.getLong( ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_LIFECYCLE_MANAGER_TIMEOUT_THRESHOLD); this.checkScheduler = Executors.newScheduledThreadPool(1); this.checkScheduler.scheduleAtFixedRate(() -> { try { long now = System.currentTimeMillis(); for (Map.Entry<ManagedInterpreterGroup, Long> entry : interpreterGroups.entrySet()) { ManagedInterpreterGroup interpreterGroup = entry.getKey(); Long lastTimeUsing = entry.getValue(); if ((now - lastTimeUsing) > timeoutThreshold) { LOGGER.info("InterpreterGroup is timeout.", interpreterGroup.getId()); interpreterGroup.close(); interpreterGroups.remove(entry.getKey()); } } } catch (Exception e) { LOGGER.warn("Fail to run periodical checking task", e); } }, checkInterval, checkInterval, MILLISECONDS); LOGGER.info("TimeoutLifecycleManager is started with checkinterval: " + checkInterval + ", timeoutThreshold: " + timeoutThreshold); }

Target:
public TimeoutLifecycleManager(ZeppelinConfiguration zConf) { this.checkInterval = zConf.getLong(ZeppelinConfiguration.ConfVars .ZEPPELIN_INTERPRETER_LIFECYCLE_MANAGER_TIMEOUT_CHECK_INTERVAL); this.timeoutThreshold = zConf.getLong( ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_LIFECYCLE_MANAGER_TIMEOUT_THRESHOLD); this.checkScheduler = Executors.newScheduledThreadPool(1); this.checkScheduler.scheduleAtFixedRate(() -> { long now = System.currentTimeMillis(); for (Map.Entry<ManagedInterpreterGroup, Long> entry : interpreterGroups.entrySet()) { ManagedInterpreterGroup interpreterGroup = entry.getKey(); Long lastTimeUsing = entry.getValue(); if ((now - lastTimeUsing) > timeoutThreshold) { LOGGER.info("InterpreterGroup is timeout.", interpreterGroup.getId()); try { interpreterGroup.close(); } catch (Exception e) { LOGGER.warn("Fail to close interpreterGroup: " + interpreterGroup.getId(), e); } interpreterGroups.remove(entry.getKey()); } } }, checkInterval, checkInterval, MILLISECONDS); LOGGER.info("TimeoutLifecycleManager is started with checkinterval: " + checkInterval + ", timeoutThreshold: " + timeoutThreshold); }
Source:
protected void runNow(String ruleUID, boolean considerConditions, Map<String, Object> context) { RuntimeRule rule = getRuntimeRule(ruleUID); if (rule == null) { logger.warn("Failed to execute rule '{}': Invalid Rule UID", ruleUID); return; } synchronized (this) { final RuleStatus ruleStatus = getRuleStatus(ruleUID); if (ruleStatus != RuleStatus.IDLE) { logger.error("Failed to execute rule ‘{}' with status '{}'", ruleUID, ruleStatus.name()); return; } setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.RUNNING), true); } try { clearContext(rule); if (context != null && !context.isEmpty()) { getContext(ruleUID).putAll(context); } if (considerConditions) { if (calculateConditions(rule)) { executeActions(rule, false); } } else { executeActions(rule, false); } logger.debug("The rule '{}' is executed.", ruleUID); } catch (Throwable t) { logger.error("Fail to execute rule '{}': ", new Object[] { ruleUID, t.getMessage() }, t); } synchronized (this) { if (getRuleStatus(ruleUID) == RuleStatus.RUNNING) { setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.IDLE), true); } } }

Target:
protected void runNow(String ruleUID, boolean considerConditions, Map<String, Object> context) { RuntimeRule rule = getRuntimeRule(ruleUID); if (rule == null) { logger.warn("Failed to execute rule '{}': Invalid Rule UID", ruleUID); return; } synchronized (this) { final RuleStatus ruleStatus = getRuleStatus(ruleUID); if (ruleStatus != RuleStatus.IDLE) { logger.error("Failed to execute rule ‘{}' with status '{}'", ruleUID, ruleStatus.name()); return; } setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.RUNNING), true); } try { clearContext(rule); if (context != null && !context.isEmpty()) { getContext(ruleUID).putAll(context); } if (considerConditions) { if (calculateConditions(rule)) { executeActions(rule, false); } } else { executeActions(rule, false); } logger.debug("The rule '{}' is executed.", ruleUID); } catch (Throwable t) { logger.error("Failed to execute rule '{}': ", ruleUID, t); } synchronized (this) { if (getRuleStatus(ruleUID) == RuleStatus.RUNNING) { setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.IDLE), true); } } }
Source:
public void run() { try { ServersInfo serversInfo = ServersInfoExtractor.getInfo(objectEnablers); if (!serversInfo.deviceMangements.isEmpty()) { if (!register()) { if (!bootstrap()) { scheduleRegistration(); } else { if (!register()) { scheduleRegistration(); } } } } else { if (!bootstrap()) { scheduleRegistration(); } else { if (!register()) { scheduleRegistration(); } } } } catch (InterruptedException e) { LOG.info("Registration task interrupted."); } catch (RuntimeException e) { LOG.error("Unexpected exception pending update registration task", e); } }

Target:
public void run() { try { ServersInfo serversInfo = ServersInfoExtractor.getInfo(objectEnablers); if (!serversInfo.deviceMangements.isEmpty()) { if (!register()) { if (!bootstrap()) { scheduleRegistration(); } else { if (!register()) { scheduleRegistration(); } } } } else { if (!bootstrap()) { scheduleRegistration(); } else { if (!register()) { scheduleRegistration(); } } } } catch (InterruptedException e) { LOG.info("Registration task interrupted."); } catch (RuntimeException e) { LOG.error("Unexpected exception during update registration task", e); } }
Source:
public List<GeoFence> getExitAlerts() throws GeoLocationBasedServiceException { Registry registry = getGovernanceRegistry(); String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS + GeoServices.ALERT_TYPE_EXIT + "/"; Resource resource; try { resource = registry.get(registryPath); } catch (RegistryException e) { log.error("Error while reading the registry path: " + registryPath); return null; } try { List<GeoFence> fences = new ArrayList<>(); if (resource != null) { Object contentObj = resource.getContent(); if (contentObj instanceof String[]) { String[] content = (String[]) contentObj; for (String res : content) { Resource childRes = registry.get(res); Properties props = childRes.getProperties(); GeoFence geoFence = new GeoFence(); InputStream inputStream = childRes.getContentStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); geoFence.setGeoJson(writer.toString()); List queryNameObj = (List) props.get(GeoServices.QUERY_NAME); geoFence.setQueryName(queryNameObj != null ? queryNameObj.get(0).toString() : null); List areaNameObj = (List) props.get(GeoServices.AREA_NAME); geoFence.setAreaName(areaNameObj != null ? areaNameObj.get(0).toString() : null); geoFence.setCreatedTime(childRes.getCreatedTime().getTime()); fences.add(geoFence); } } } return fences; } catch (RegistryException | IOException e) { throw new GeoLocationBasedServiceException( "Error occurred while getting the geo alerts", e); } }

Target:
public List<GeoFence> getExitAlerts() throws GeoLocationBasedServiceException { Registry registry = getGovernanceRegistry(); String registryPath = GeoServices.REGISTRY_PATH_FOR_ALERTS + GeoServices.ALERT_TYPE_EXIT + "/"; Resource resource; try { resource = registry.get(registryPath); } catch (RegistryException e) { log.error("Error while reading the registry path: " + registryPath); return Collections.emptyList(); } try { List<GeoFence> fences = new ArrayList<>(); if (resource != null) { Object contentObj = resource.getContent(); if (contentObj instanceof String[]) { String[] content = (String[]) contentObj; for (String res : content) { Resource childRes = registry.get(res); Properties props = childRes.getProperties(); GeoFence geoFence = new GeoFence(); InputStream inputStream = childRes.getContentStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); geoFence.setGeoJson(writer.toString()); List queryNameObj = (List) props.get(GeoServices.QUERY_NAME); geoFence.setQueryName(queryNameObj != null ? queryNameObj.get(0).toString() : null); List areaNameObj = (List) props.get(GeoServices.AREA_NAME); geoFence.setAreaName(areaNameObj != null ? areaNameObj.get(0).toString() : null); geoFence.setCreatedTime(childRes.getCreatedTime().getTime()); fences.add(geoFence); } } } return fences; } catch (RegistryException | IOException e) { throw new GeoLocationBasedServiceException( "Error occurred while getting the geo alerts", e); } }
Source:
BundleContext getBundleContext() { return Optional.ofNullable(FrameworkUtil.getBundle(getClass())) .map(Bundle::getBundleContext) .orElseThrow( () -> new IllegalStateException("Could not get the bundle for " + getClass().getName())); }

Target:
private BundleContext getBundleContext() { return Optional.ofNullable(bundleLookup.apply(getClass())) .map(Bundle::getBundleContext) .orElseThrow( () -> new IllegalStateException("Could not get the bundle for " + getClass().getName())); }
Source:
private static QueryRunner createQueryRunner() throws Exception { DistributedQueryRunner queryRunner = HiveQueryRunner.createQueryRunner(getTables(), ImmutableMap.of(), "sql-standard", ImmutableMap.of("hive.pushdown-filter-enabled", "true"), Optional.empty()); queryRunner.execute(noPushdownFilter(queryRunner.getDefaultSession()), "CREATE TABLE lineitem_ex (linenumber, orderkey, partkey, suppkey, ship_by_air, is_returned, ship_day, ship_month, ship_timestamp, commit_timestamp, keys, nested_keys, flags) AS " + "SELECT linenumber, orderkey, partkey, suppkey, " + " IF (linenumber % 5 = 0, null, shipmode = 'AIR') AS ship_by_air, " + " IF (linenumber % 7 = 0, null, returnflag = 'R') AS is_returned, " + " IF (linenumber % 4 = 0, null, CAST(day(shipdate) AS TINYINT)) AS ship_day, " + " IF (linenumber % 6 = 0, null, CAST(month(shipdate) AS TINYINT)) AS ship_month, " + " IF (linenumber % 3 = 0, null, CAST(shipdate AS TIMESTAMP)) AS ship_timestamp, " + " IF (orderkey % 3 = 0, null, CAST(commitdate AS TIMESTAMP)) AS commit_timestamp, " + " IF (orderkey % 11 = 0, null, ARRAY[orderkey, partkey, suppkey]), " + " IF (orderkey % 13 = 0, null, ARRAY[ARRAY[orderkey, partkey], ARRAY[suppkey], IF (orderkey % 17 = 0, null, ARRAY[orderkey, partkey])]), " + " IF (orderkey % 17 = 0, null, ARRAY[shipmode = 'AIR', returnflag = 'R']) " + "FROM lineitem l"); return queryRunner; }

Target:
private static QueryRunner createQueryRunner() throws Exception { DistributedQueryRunner queryRunner = HiveQueryRunner.createQueryRunner(getTables(), ImmutableMap.of(), "sql-standard", ImmutableMap.of("hive.pushdown-filter-enabled", "true"), Optional.empty()); queryRunner.execute(noPushdownFilter(queryRunner.getDefaultSession()), "CREATE TABLE lineitem_ex (linenumber, orderkey, partkey, suppkey, ship_by_air, is_returned, ship_day, ship_month, ship_timestamp, commit_timestamp, keys, nested_keys, flags) AS " + "SELECT linenumber, orderkey, partkey, suppkey, " + " IF (linenumber % 5 = 0, null, shipmode = 'AIR') AS ship_by_air, " + " IF (linenumber % 7 = 0, null, returnflag = 'R') AS is_returned, " + " IF (linenumber % 4 = 0, null, CAST(day(shipdate) AS TINYINT)) AS ship_day, " + " IF (linenumber % 6 = 0, null, CAST(month(shipdate) AS TINYINT)) AS ship_month, " + " IF (linenumber % 3 = 0, null, CAST(shipdate AS TIMESTAMP)) AS ship_timestamp, " + " IF (orderkey % 3 = 0, null, CAST(commitdate AS TIMESTAMP)) AS commit_timestamp, " + " IF (orderkey % 11 = 0, null, ARRAY[orderkey, partkey, suppkey]), " + " IF (orderkey % 13 = 0, null, ARRAY[ARRAY[orderkey, partkey], ARRAY[suppkey], IF (orderkey % 17 = 0, null, ARRAY[orderkey, partkey])]), " + " IF (orderkey % 17 = 0, null, ARRAY[shipmode = 'AIR', returnflag = 'R']) " + "FROM lineitem"); return queryRunner; }