auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public InputStream getObject(String bucketName, String objectName, long offset, Long length) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new InvalidArgumentException("bucket name cannot be empty"); } if ((objectName == null) || (objectName.isEmpty())) { throw new InvalidArgumentException("object name cannot be empty"); } if (offset < 0) { throw new InvalidArgumentException("offset should be zero or greater"); } if (length != null && length <= 0) { throw new InvalidArgumentException("length should be greater than zero"); } Map<String,String> headerMap = new HashMap<>(); if (offset >= 0) { if (length != null) { headerMap.put("Range", "bytes=" + offset + "-" + (offset + length - 1)); } else { headerMap.put("Range", "bytes=" + offset + "-"); } } HttpResponse response = executeGet(bucketName, objectName, headerMap, null); return response.body().byteStream(); }

Target:
public InputStream getObject(String bucketName, String objectName, long offset, Long length) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new InvalidArgumentException("bucket name cannot be empty"); } if ((objectName == null) || (objectName.isEmpty())) { throw new InvalidArgumentException("object name cannot be empty"); } if (offset < 0) { throw new InvalidArgumentException("offset should be zero or greater"); } if (length != null && length <= 0) { throw new InvalidArgumentException("length should be greater than zero"); } Map<String,String> headerMap = new HashMap<>(); if (length != null) { headerMap.put("Range", "bytes=" + offset + "-" + (offset + length - 1)); } else if (offset > 0) { headerMap.put("Range", "bytes=" + offset + "-"); } HttpResponse response = executeGet(bucketName, objectName, headerMap, null); return response.body().byteStream(); }
Source:
private static String getValue(Method getter, Object instance, String defaultValue) { if (getter == null || instance == null) { return defaultValue; } try { Object value = getter.invoke(instance); if (value == null) { return "null"; } if (value instanceof Optional) { return ((Optional<Object>) value).map(Object::toString).orElse("null"); } return value.toString(); } catch (Throwable e) { return "-- ERROR --"; } }

Target:
private static String getValue(Method getter, Object instance, String defaultValue) { if (getter == null || instance == null) { return defaultValue; } try { Object value = getter.invoke(instance); if (value == null) { return "----"; } if (value instanceof Optional) { return ((Optional<?>) value).map(Object::toString).orElse("----"); } return value.toString(); } catch (Throwable e) { return "-- ERROR --"; } }
Source:
public void loadTaskLogs() { taskService.call((final List<TaskEventSummary> events) -> allLogs = events) .getTaskEvents(getServerTemplateId(), getContainerId(), getTaskId()); }

Target:
public void loadTaskLogs() { taskService.call((final List<TaskEventSummary> events) -> { if (currentPage == 0) { visibleLogs = new ArrayList(); } visibleLogs.addAll(events); view.hideLoadButton(events.size() < PAGE_SIZE); view.setLogs(visibleLogs.stream().collect(Collectors.toList())); }).getTaskEvents(getServerTemplateId(), getContainerId(), getTaskId(), currentPage, getPageSize()); }
Source:
private DataSource createPatientDataSource() { List<Lookup> lookupList = new ArrayList<>(); lookupList.add(new Lookup("openMRS.uuid", createdPatient.getUuid())); DataSource dataSource = new DataSource(OPENMRS_MODULE_NAME, new Long(4), new Long(0), "Patient-" + DEFAULT_CONFIG_NAME, "openMRS.lookup.uuid", lookupList, false); dataSource.setOrder(0); return dataSource; }

Target:
private DataSource createPatientDataSource() { List<Lookup> lookupList = new ArrayList<>(); lookupList.add(new Lookup("openMRS.uuid", createdPatient.getUuid())); DataSource dataSource = new DataSource(OPENMRS_MODULE_NAME, 4L, 0L, "Patient-" + DEFAULT_CONFIG_NAME, "openMRS.lookup.uuid", lookupList, false); dataSource.setOrder(0); return dataSource; }
Source:
public void allTests() { CourseAttributes course1 = dataBundle.courses.get("typicalCourse1"); InstructorAttributes receiver = dataBundle.instructors.get("instructor1OfCourse1"); InstructorAttributes sender = dataBundle.instructors.get("instructor2OfCourse1"); String[] submissionParams = new String[] { ParamsNames.COURSE_ID, course1.getId(), ParamsNames.EMAIL_RECEIVER, receiver.email, ParamsNames.SENDER_ID, sender.googleId }; InstructorCourseJoinEmailWorkerAction action = getAction(submissionParams); action.execute(); verifyNumberOfEmailsSent(action, 1); EmailWrapper email = action.getEmailSender().getEmailsSent().get(0); assertEquals(String.format(EmailType.INSTRUCTOR_COURSE_JOIN.getSubject(), course1.getName(), course1.getId()), email.getSubject()); assertEquals(receiver.email, email.getRecipient()); }

Target:
public void allTests() { CourseAttributes course1 = dataBundle.courses.get("typicalCourse1"); InstructorAttributes instr1InCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); AccountAttributes inviter = AccountsLogic.inst().getAccount("idOfInstructor2OfCourse1"); String[] submissionParams = new String[] { ParamsNames.COURSE_ID, course1.getId(), ParamsNames.INSTRUCTOR_EMAIL, instr1InCourse1.email, ParamsNames.INVITER_ID, inviter.googleId }; InstructorCourseJoinEmailWorkerAction action = getAction(submissionParams); action.execute(); verifyNumberOfEmailsSent(action, 1); EmailWrapper email = action.getEmailSender().getEmailsSent().get(0); assertEquals(String.format(EmailType.INSTRUCTOR_COURSE_JOIN.getSubject(), course1.getName(), course1.getId()), email.getSubject()); assertEquals(instr1InCourse1.email, email.getRecipient()); }
Source:
public ServiceHandler(Looper looper) { super(looper); for (int i = 1; i <= 20; i++) { String cpuset = getCgroupCpuset(); if (cpuset == null || !cpuset.equals("/top")) { break; } try { Thread.sleep(1000); } catch (InterruptedException e) { } } Log.i("SimpleIOService", "cgroup:" + getCgroupCpuset()); }

Target:
public ServiceHandler(Looper looper) { super(looper); for (int i = 1; i <= 200; i++) { String cpuset = getCgroupCpuset(); if (cpuset == null || !cpuset.equals("/top")) { break; } try { Thread.sleep(100); } catch (InterruptedException e) { } } Log.i("SimpleIOService", "cgroup:" + getCgroupCpuset()); }
Source:
public boolean equals(@Nullable Object obj) { if (!(obj instanceof DataDrivenValueSelf)) { return false; } return true; }

Target:
public boolean equals(@Nullable Object obj) { if (!(obj instanceof DataDrivenValueSelf)) { return false; } return super.equals(obj); }
Source:
public void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws IOException { EntryLogBufferedReadChannel bc = null; ByteBuf data = null; try { ByteBuf headerBuffer = Unpooled.buffer(4 + 8); bc = getChannelForLogId(entryLogId); long pos = LOGFILE_HEADER_SIZE; data = PooledByteBufAllocator.DEFAULT.directBuffer(1024 * 1024); while (true) { if (pos >= bc.size()) { break; } if (readFromLogChannel(entryLogId, bc, headerBuffer, pos) != headerBuffer.capacity()) { LOG.warn("Short read for entry size from entrylog {}", entryLogId); return; } long offset = pos; pos += 4; int entrySize = headerBuffer.readInt(); long ledgerId = headerBuffer.readLong(); headerBuffer.clear(); if (ledgerId == INVALID_LID || !scanner.accept(ledgerId)) { pos += entrySize; continue; } data.clear(); data.capacity(entrySize); int rc = readFromLogChannel(entryLogId, bc, data, pos); if (rc != entrySize) { LOG.warn("Short read for ledger entry from entryLog {}@{} ({} != {})", entryLogId, pos, rc, entrySize); return; } scanner.process(ledgerId, offset, data); pos += entrySize; } } catch (IOException e) { LOG.warn("Failed to get channel to scan entry log: " + entryLogId + ".log"); throw e; } finally { if (data != null) { data.release(); } if (null != bc) { bc.release(); } } }

Target:
public void scanEntryLog(long entryLogId, EntryLogScanner scanner) throws IOException { ByteBuf data = null; try (EntryLogBufferedReadChannel bc = getChannelForLogId(entryLogId)) { ByteBuf headerBuffer = Unpooled.buffer(4 + 8); long pos = LOGFILE_HEADER_SIZE; data = PooledByteBufAllocator.DEFAULT.directBuffer(1024 * 1024); while (true) { if (pos >= bc.size()) { break; } if (readFromLogChannel(entryLogId, bc, headerBuffer, pos) != headerBuffer.capacity()) { LOG.warn("Short read for entry size from entrylog {}", entryLogId); return; } long offset = pos; pos += 4; int entrySize = headerBuffer.readInt(); long ledgerId = headerBuffer.readLong(); headerBuffer.clear(); if (ledgerId == INVALID_LID || !scanner.accept(ledgerId)) { pos += entrySize; continue; } data.clear(); data.capacity(entrySize); int rc = readFromLogChannel(entryLogId, bc, data, pos); if (rc != entrySize) { LOG.warn("Short read for ledger entry from entryLog {}@{} ({} != {})", entryLogId, pos, rc, entrySize); return; } scanner.process(ledgerId, offset, data); pos += entrySize; } } catch (IOException e) { LOG.warn("Failed to get channel to scan entry log: " + entryLogId + ".log"); throw e; } finally { if (data != null) { data.release(); } } }
Source:
public void testNormalOperation() throws Exception { int conns = 5; int reqs = 500; InetSocketAddress addr = new InetSocketAddress("localhost", server.port); for (int i = 0; i < conns; i++) { selector.connect("" + i, addr, BUFFER_SIZE, BUFFER_SIZE); } int[] requests = new int[conns]; int[] responses = new int[conns]; int responseCount = 0; List<NetworkSend> sends = new ArrayList<NetworkSend>(); for (int i = 0; i < conns; i++) { sends.add(createSend("" + i, i + "-" + 0)); } while (responseCount < conns * reqs) { selector.poll(0L, sends); assertEquals("No disconnects should have occurred.", 0, selector.disconnected().size()); for (NetworkReceive receive : selector.completedReceives()) { String[] pieces = asString(receive).split("-"); assertEquals("Should be in the form 'conn-counter'", 2, pieces.length); assertEquals("Check the source", receive.getConnectionId(), pieces[0]); assertEquals("Check that the receive has kindly been rewound", 0, receive.getReceivedBytes().getPayload().position()); assertEquals("Check the request counter", responses[Integer.parseInt(receive.getConnectionId())], Integer.parseInt(pieces[1])); responses[Integer.parseInt(receive.getConnectionId())]++; responseCount++; } sends.clear(); for (NetworkSend send : selector.completedSends()) { String dest = send.getConnectionId(); requests[Integer.parseInt(dest)]++; if (requests[Integer.parseInt(dest)] < reqs) { sends.add(createSend(dest, dest + "-" + requests[Integer.parseInt(dest)])); } } } }

Target:
public void testNormalOperation() throws Exception { int conns = 5; int reqs = 500; InetSocketAddress addr = new InetSocketAddress("localhost", server.port); ArrayList<String> connectionIds = new ArrayList<String>(); for (int i = 0; i < conns; i++) { String connectionId = selector.connect(addr, BUFFER_SIZE, BUFFER_SIZE); connectionIds.add(connectionId); } int[] requests = new int[conns]; int[] responses = new int[conns]; int responseCount = 0; List<NetworkSend> sends = new ArrayList<NetworkSend>(); for (int i = 0; i < conns; i++) { String connectionId = connectionIds.get(i); sends.add(createSend(connectionId, connectionId + "&" + 0)); } while (responseCount < conns * reqs) { selector.poll(0L, sends); assertEquals("No disconnects should have occurred.", 0, selector.disconnected().size()); for (NetworkReceive receive : selector.completedReceives()) { String[] pieces = asString(receive).split("&"); assertEquals("Should be in the form 'conn-counter'", 2, pieces.length); assertEquals("Check the source", receive.getConnectionId(), pieces[0]); assertEquals("Check that the receive has kindly been rewound", 0, receive.getReceivedBytes().getPayload().position()); int index = Integer.parseInt(receive.getConnectionId().split("_")[1]); assertEquals("Check the request counter", responses[index], Integer.parseInt(pieces[1])); responses[index]++; responseCount++; } sends.clear(); for (NetworkSend send : selector.completedSends()) { String dest = send.getConnectionId(); String[] pieces = dest.split("_"); int index = Integer.parseInt(pieces[1]); requests[index]++; if (requests[index] < reqs) { sends.add(createSend(dest, dest + "&" + requests[index])); } } } }
Source:
private void writeStrictMaxPoolConfig(final XMLExtendedStreamWriter writer, final Property strictMaxPoolModel) throws XMLStreamException { final ModelNode strictMaxPoolModelNode = strictMaxPoolModel.getValue(); writer.writeAttribute(EJB3SubsystemXMLAttribute.NAME.getLocalName(), strictMaxPoolModel.getName()); if (strictMaxPoolModelNode.hasDefined(MAX_POOL_SIZE)) StrictMaxPoolResourceDefinition.MAX_POOL_SIZE.marshallAsAttribute(strictMaxPoolModelNode, writer); if (strictMaxPoolModelNode.hasDefined(DERIVE_SIZE)) StrictMaxPoolResourceDefinition.DERIVE_SIZE.marshallAsAttribute(strictMaxPoolModelNode, writer); StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT.marshallAsAttribute(strictMaxPoolModelNode, writer); StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT_UNIT.marshallAsAttribute(strictMaxPoolModelNode, writer); }

Target:
private void writeStrictMaxPoolConfig(final XMLExtendedStreamWriter writer, final Property strictMaxPoolModel) throws XMLStreamException { final ModelNode strictMaxPoolModelNode = strictMaxPoolModel.getValue(); writer.writeAttribute(EJB3SubsystemXMLAttribute.NAME.getLocalName(), strictMaxPoolModel.getName()); StrictMaxPoolResourceDefinition.MAX_POOL_SIZE.marshallAsAttribute(strictMaxPoolModelNode, writer); StrictMaxPoolResourceDefinition.DERIVE_SIZE.marshallAsAttribute(strictMaxPoolModelNode, writer); StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT.marshallAsAttribute(strictMaxPoolModelNode, writer); StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT_UNIT.marshallAsAttribute(strictMaxPoolModelNode, writer); }
Source:
private static String getNewId(Entry container) { if (container instanceof io.dockstore.webservice.core.Tool) { return ((io.dockstore.webservice.core.Tool)container).getToolPath(); } else if (container instanceof Workflow) { Workflow workflow = (Workflow)container; DescriptorLanguage descriptorType = workflow.getDescriptorType(); String workflowPath = workflow.getWorkflowPath(); if (descriptorType.equals(DescriptorLanguage.SERVICE)) { return SERVICE_PREFIX + "/" + workflowPath; } else { return WORKFLOW_PREFIX + "/" + workflowPath; } } else { LOG.error("Could not construct URL for our container with id: " + container.getId()); return null; } }

Target:
private static String getNewId(Entry container) { if (container instanceof io.dockstore.webservice.core.Tool) { return ((io.dockstore.webservice.core.Tool)container).getToolPath(); } else if (container instanceof Workflow) { Workflow workflow = (Workflow)container; DescriptorLanguage descriptorType = workflow.getDescriptorType(); String workflowPath = workflow.getWorkflowPath(); if (descriptorType == DescriptorLanguage.SERVICE) { return SERVICE_PREFIX + "/" + workflowPath; } else { return WORKFLOW_PREFIX + "/" + workflowPath; } } else { LOG.error("Could not construct URL for our container with id: " + container.getId()); return null; } }
Source:
public static boolean isOrc(StorageDescriptor sd) { return sd.getSerdeInfo().getSerializationLib() .toLowerCase().contains("parquet"); }

Target:
public static boolean isOrc(StorageDescriptor sd) { return sd.getSerdeInfo().getSerializationLib() .toLowerCase().contains("orc"); }
Source:
private void updateParents() throws OrmException, UnloggedFailure { final StringBuilder err = new StringBuilder(); final Set<Project.NameKey> grandParents = new HashSet<Project.NameKey>(); Project.NameKey newParentKey; grandParents.add(wildProject); if (newParent != null) { newParentKey = newParent.getProject().getNameKey(); Project.NameKey gp = newParent.getProject().getParent(); while (gp != null && grandParents.add(gp)) { final ProjectState s = projectCache.get(gp); if (s != null) { gp = s.getProject().getParent(); } else { break; } } } else { newParentKey = null; } for (final ProjectControl pc : children) { final Project.NameKey key = pc.getProject().getNameKey(); final String name = pc.getProject().getName(); if (wildProject.equals(key)) { err.append("error: Cannot set parent of '" + name + "'\n"); continue; } if (grandParents.contains(key) || pc.getProject().getNameKey().equals(newParentKey)) { err.append("error: Cycle exists between '" + name + "' and '" + (newParentKey != null ? newParentKey.get() : wildProject.get()) + "'\n"); continue; } final Project child = db.projects().get(key); if (child == null) { err.append("error: Project '" + name + "' not found\n"); continue; } child.setParent(newParentKey); db.projects().update(Collections.singleton(child)); } projectCache.evictAll(); if (err.length() > 0) { while (err.charAt(err.length() - 1) == '\n') { err.setLength(err.length() - 1); } throw new UnloggedFailure(1, err.toString()); } }

Target:
private void updateParents() throws OrmException, UnloggedFailure { final StringBuilder err = new StringBuilder(); final Set<Project.NameKey> grandParents = new HashSet<Project.NameKey>(); Project.NameKey newParentKey; grandParents.add(wildProject); if (newParent != null) { newParentKey = newParent.getProject().getNameKey(); Project.NameKey gp = newParent.getProject().getParent(); while (gp != null && grandParents.add(gp)) { final ProjectState s = projectCache.get(gp); if (s != null) { gp = s.getProject().getParent(); } else { break; } } } else { newParentKey = null; } for (final ProjectControl pc : children) { final Project.NameKey key = pc.getProject().getNameKey(); final String name = pc.getProject().getName(); if (wildProject.equals(key)) { err.append("error: Cannot set parent of '" + name + "'\n"); continue; } if (grandParents.contains(key) || key.equals(newParentKey)) { err.append("error: Cycle exists between '" + name + "' and '" + (newParentKey != null ? newParentKey.get() : wildProject.get()) + "'\n"); continue; } final Project child = db.projects().get(key); if (child == null) { err.append("error: Project '" + name + "' not found\n"); continue; } child.setParent(newParentKey); db.projects().update(Collections.singleton(child)); } projectCache.evictAll(); if (err.length() > 0) { while (err.charAt(err.length() - 1) == '\n') { err.setLength(err.length() - 1); } throw new UnloggedFailure(1, err.toString()); } }
Source:
public RangeCondition<E> subCondition(E from, E to) { if (from.compareTo(to) > 0) { throw new IllegalArgumentException(from.toString() + " is greater than " + to.toString()); } return new ContinuousRangeCondition<>(max(fMin, from), min(fMax, to)); }

Target:
public RangeCondition<E> subCondition(E from, E to) { return new ContinuousRangeCondition<>(from, to); }
Source:
private double predictByTree(final GBTData instance, final GBTree thisTree) { final Vector feature = instance.getFeature(); int nodeIdx = 0; for (;;) { final Pair<Integer, Double> node = thisTree.get(nodeIdx); final int nodeFeature = node.getLeft(); if (nodeFeature == NodeState.LEAF.getValue()) { return node.getRight(); } if (featureTypes.get(nodeFeature) == FeatureType.CONTINUOUS) { final double splitValue = node.getRight(); if (feature.get(nodeFeature) <= splitValue) { nodeIdx = 2 * nodeIdx + 1; } else { nodeIdx = 2 * nodeIdx + 2; } } else { final double getSplitValue = node.getRight(); int splitValue = (int)getSplitValue; for (int i = 0; i < feature.get(nodeFeature); i++) { splitValue /= 2; } if (splitValue % 2 == 0) { nodeIdx = 2 * nodeIdx + 1; } else { nodeIdx = 2 * nodeIdx + 2; } } } }

Target:
private double predictByTree(final GBTData instance, final GBTree thisTree) { final Vector feature = instance.getFeature(); int nodeIdx = 0; while (true) { final Pair<Integer, Double> node = thisTree.get(nodeIdx); final int nodeFeature = node.getLeft(); if (nodeFeature == NodeState.LEAF.getValue()) { return node.getRight(); } if (featureTypes.get(nodeFeature) == FeatureType.CONTINUOUS) { final double splitValue = node.getRight(); if (feature.get(nodeFeature) <= splitValue) { nodeIdx = 2 * nodeIdx + 1; } else { nodeIdx = 2 * nodeIdx + 2; } } else { final double getSplitValue = node.getRight(); int splitValue = (int)getSplitValue; for (int i = 0; i < feature.get(nodeFeature); i++) { splitValue /= 2; } if (splitValue % 2 == 0) { nodeIdx = 2 * nodeIdx + 1; } else { nodeIdx = 2 * nodeIdx + 2; } } } }
Source:
private String buildSqoopCommand(Cluster cluster, Feed feed) throws FalconException { Map<String, String> extraArgs = getArguments(cluster); StringBuilder sqoopArgs = new StringBuilder(); StringBuilder sqoopOptions = new StringBuilder(); org.apache.falcon.entity.v0.feed.Cluster feedCluster = FeedHelper.getCluster(entity, cluster.getName()); Datasource datasource = DatasourceHelper.getDatasource(FeedHelper.getExportDatasourceName(feedCluster)); ImportExportCommon.buildDriverArgs(sqoopArgs, datasource).append(ImportExportCommon.ARG_SEPARATOR); ImportExportCommon.buildConnectArg(sqoopArgs, DatasourceHelper.getWriteEndpoint(datasource)) .append(ImportExportCommon.ARG_SEPARATOR); ImportExportCommon.buildTableArg(sqoopArgs, FeedHelper.getExportDataSourceTableName(feedCluster)) .append(ImportExportCommon.ARG_SEPARATOR); ImportExportCommon.buildUserPasswordArg(sqoopArgs, sqoopOptions, DatasourceHelper.getWritePasswordInfo(datasource)).append(ImportExportCommon.ARG_SEPARATOR); buildNumMappers(sqoopArgs, extraArgs).append(ImportExportCommon.ARG_SEPARATOR); buildArguments(sqoopArgs, extraArgs, feed, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildLoadType(sqoopArgs, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildExportArg(sqoopArgs, feed, cluster).append(ImportExportCommon.ARG_SEPARATOR); StringBuilder sqoopCmd = new StringBuilder(); return sqoopCmd.append("export").append(ImportExportCommon.ARG_SEPARATOR) .append(sqoopOptions).append(ImportExportCommon.ARG_SEPARATOR) .append(sqoopArgs).toString(); }

Target:
private String buildSqoopCommand(Cluster cluster, Feed feed) throws FalconException { Map<String, String> extraArgs = getArguments(cluster); StringBuilder sqoopArgs = new StringBuilder(); StringBuilder sqoopOptions = new StringBuilder(); buildConnectArg(sqoopArgs, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildTableArg(sqoopArgs, cluster).append(ImportExportCommon.ARG_SEPARATOR); Datasource datasource = DatasourceHelper.getDatasource(FeedHelper.getExportDatasourceName( FeedHelper.getCluster(entity, cluster.getName()))); ImportExportCommon.buildUserPasswordArg(sqoopArgs, sqoopOptions, datasource) .append(ImportExportCommon.ARG_SEPARATOR); buildNumMappers(sqoopArgs, extraArgs).append(ImportExportCommon.ARG_SEPARATOR); buildArguments(sqoopArgs, extraArgs, feed, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildLoadType(sqoopArgs, cluster).append(ImportExportCommon.ARG_SEPARATOR); buildExportArg(sqoopArgs, feed, cluster).append(ImportExportCommon.ARG_SEPARATOR); StringBuilder sqoopCmd = new StringBuilder(); return sqoopCmd.append("export").append(ImportExportCommon.ARG_SEPARATOR) .append(sqoopOptions).append(ImportExportCommon.ARG_SEPARATOR) .append(sqoopArgs).toString(); }
Source:
public static final InputRow fromBytes(byte[] data, AggregatorFactory[] aggs) { try { DataInput in = ByteStreams.newDataInput(data); long timestamp = in.readLong(); Map<String, Object> event = Maps.newHashMap(); List<String> dimensions = Lists.newArrayList(); int dimNum = WritableUtils.readVInt(in); for (int i = 0; i < dimNum; i++) { String dimension = readString(in); dimensions.add(dimension); List<String> dimensionValues = readStringArray(in); if (dimensionValues == null) { continue; } if (dimensionValues.size() == 1) { event.put(dimension, dimensionValues.get(0)); } else { event.put(dimension, dimensionValues); } } int metricSize = WritableUtils.readVInt(in); for (int i = 0; i < metricSize; i++) { String metric = readString(in); String type = getType(metric, aggs, i); byte metricNullability = in.readByte(); if(metricNullability == (byte)1){ continue; } if (type.equals("float")) { event.put(metric, in.readFloat()); } else if (type.equals("long")) { event.put(metric, WritableUtils.readVLong(in)); } else if (type.equals("double")) { event.put(metric, in.readDouble()); } else { ComplexMetricSerde serde = getComplexMetricSerde(type); byte[] value = readBytes(in); event.put(metric, serde.fromBytes(value, 0, value.length)); } } return new MapBasedInputRow(timestamp, dimensions, event); } catch (IOException ex) { throw new RuntimeException(ex); } }

Target:
public static final InputRow fromBytes(byte[] data, AggregatorFactory[] aggs) { try { DataInput in = ByteStreams.newDataInput(data); long timestamp = in.readLong(); Map<String, Object> event = Maps.newHashMap(); List<String> dimensions = Lists.newArrayList(); int dimNum = WritableUtils.readVInt(in); for (int i = 0; i < dimNum; i++) { String dimension = readString(in); dimensions.add(dimension); List<String> dimensionValues = readStringArray(in); if (dimensionValues == null) { continue; } if (dimensionValues.size() == 1) { event.put(dimension, dimensionValues.get(0)); } else { event.put(dimension, dimensionValues); } } int metricSize = WritableUtils.readVInt(in); for (int i = 0; i < metricSize; i++) { String metric = readString(in); String type = getType(metric, aggs, i); byte metricNullability = in.readByte(); if (metricNullability == NULL_BYTE) { continue; } if (type.equals("float")) { event.put(metric, in.readFloat()); } else if (type.equals("long")) { event.put(metric, WritableUtils.readVLong(in)); } else if (type.equals("double")) { event.put(metric, in.readDouble()); } else { ComplexMetricSerde serde = getComplexMetricSerde(type); byte[] value = readBytes(in); event.put(metric, serde.fromBytes(value, 0, value.length)); } } return new MapBasedInputRow(timestamp, dimensions, event); } catch (IOException ex) { throw new RuntimeException(ex); } }
Source:
public ByteArrayOutputStream executeRequest(String urlString, ParamsMap params, ApiDefinition apiDefinition) throws MambuApiException { Method method = apiDefinition.getMethod(); ContentType contentTypeFormat = apiDefinition.getContentType(); urlString = urlHelper.addJsonPaginationParams(urlString, method, contentTypeFormat, params); logApiRequestDetails(urlString, params, method, contentTypeFormat); logCurlRequestDetails(urlString, params, method, contentTypeFormat); params = addAppKeyToParams(params); HttpClient httpClient = new DefaultHttpClient(); ByteArrayOutputStream byteArrayOutputStreamResponse = null; HttpResponse httpResponse = null; try { httpResponse = executeRequestByMethod(urlString, params, method, contentTypeFormat, httpClient, httpResponse); byteArrayOutputStreamResponse = processInputStreamResponse(httpResponse, method, contentTypeFormat, urlString, params); } catch (MalformedURLException e) { LOGGER.severe("MalformedURLException: " + e.getMessage()); throw new MambuApiException(e); } catch (IOException e) { LOGGER.warning("IOException: message= " + e.getMessage()); throw new MambuApiException(e); } finally { httpClient.getConnectionManager().shutdown(); } return byteArrayOutputStreamResponse; }

Target:
public ByteArrayOutputStream executeRequest(String urlString, ParamsMap params, ApiDefinition apiDefinition) throws MambuApiException { Method method = apiDefinition.getMethod(); ContentType contentTypeFormat = apiDefinition.getContentType(); logApiRequestDetails(urlString, params, method, contentTypeFormat); logCurlRequestDetails(urlString, params, method, contentTypeFormat); params = addAppKeyToParams(params); HttpClient httpClient = new DefaultHttpClient(); ByteArrayOutputStream byteArrayOutputStreamResponse = null; HttpResponse httpResponse = null; try { httpResponse = executeRequestByMethod(urlString, params, method, contentTypeFormat, httpClient, httpResponse); byteArrayOutputStreamResponse = processInputStreamResponse(httpResponse, method, contentTypeFormat, urlString, params); } catch (MalformedURLException e) { LOGGER.severe("MalformedURLException: " + e.getMessage()); throw new MambuApiException(e); } catch (IOException e) { LOGGER.warning("IOException: message= " + e.getMessage()); throw new MambuApiException(e); } finally { httpClient.getConnectionManager().shutdown(); } return byteArrayOutputStreamResponse; }
Source:
public HttpBasicAuthRequest(HttpServletRequest req) throws IOException { this.httpClientRequest = req; final String hdr = req.getHeader(AUTHORIZATION); if (hdr == null) { username = password = null; return; } String usernamePassword = new String(Base64.decodeBase64(hdr.substring(LIT_BASIC.length())), Objects.firstNonNull(req.getCharacterEncoding(), "UTF-8")); int splitPos = usernamePassword.indexOf(':'); if (splitPos < 1) { username = usernamePassword; password = null; } else { username = usernamePassword.substring(0, splitPos); password = usernamePassword.substring(splitPos + 1); } }

Target:
public HttpBasicAuthRequest(HttpServletRequest req) throws IOException { this.httpClientRequest = req; final String hdr = req.getHeader(AUTHORIZATION); if (hdr == null) { username = password = null; return; } if (!hdr.startsWith(BASIC_AUTH_PREFIX)) { throw new IllegalArgumentException("Cannot parse an " + hdr + " authentication as Basic Auth"); } String usernamePassword = new String( Base64.decodeBase64(hdr.substring(BASIC_AUTH_PREFIX.length())), Objects.firstNonNull(req.getCharacterEncoding(), "UTF-8")); int splitPos = usernamePassword.indexOf(':'); if (splitPos < 0) { username = usernamePassword; password = null; } else { username = usernamePassword.substring(0, splitPos); password = usernamePassword.substring(splitPos + 1); } }
Source:
public Projection[] getProjections() { if (projections != null) { List<Projection> list = new ArrayList<Projection>(); list.addAll(Arrays.asList(projections)); return list.toArray(new Projection[projections.length]); } return null; }

Target:
public List<Projection> getProjections() { return projections != null ? new ArrayList<Projection>(projections) : null; }
Source:
public View getViewForHighlighting(Object element) { if (getHost() instanceof AndroidDescriptorHost) { final AndroidDescriptorHost host = (AndroidDescriptorHost) getHost(); Dialog dialog = mAccessor.getDialog(element); return host.getHighlightingView(dialog); } return null; }

Target:
public View getViewForHighlighting(Object element) { final Descriptor.Host host = getHost(); if (host instanceof AndroidDescriptorHost) { Dialog dialog = mAccessor.getDialog(element); return ((AndroidDescriptorHost) host).getHighlightingView(dialog); } return null; }
Source:
public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) { if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) { return null; } FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); if (stack == null) { return null; } stack.amount = Math.min(stack.amount, maxDrain); if (doDrain) { if (maxDrain >= stack.amount) { container.stackTagCompound.removeTag("Fluid"); if (container.stackTagCompound.hasNoTags()) { container.stackTagCompound = null; } return stack; } NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); fluidTag.setInteger("Amount", fluidTag.getInteger("Amount") - stack.amount); container.stackTagCompound.setTag("Fluid", fluidTag); } return stack; }

Target:
public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) { if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) { return null; } FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); if (stack == null) { return null; } int currentAmount = stack.amount; stack.amount = Math.min(stack.amount, maxDrain); if (doDrain) { if (currentAmount == stack.amount) { container.stackTagCompound.removeTag("Fluid"); if (container.stackTagCompound.hasNoTags()) { container.stackTagCompound = null; } return stack; } NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); fluidTag.setInteger("Amount", currentAmount - stack.amount); container.stackTagCompound.setTag("Fluid", fluidTag); } return stack; }
Source:
public void setDefaultExceptionHandler(final ExceptionHandler<? super T> exceptionHandler) { checkNotStarted(); if (!(this.exceptionHandler instanceof ExceptionHandlerWrapper)) { throw new IllegalStateException("Mixing calls to handleExceptionsWith and setDefaultExceptionHandler is not supported."); } ((ExceptionHandlerWrapper<T>)this.exceptionHandler).switchTo(exceptionHandler); }

Target:
public void setDefaultExceptionHandler(final ExceptionHandler<? super T> exceptionHandler) { checkNotStarted(); if (!(this.exceptionHandler instanceof ExceptionHandlerWrapper)) { throw new IllegalStateException("setDefaultExceptionHandler can not be used after handleExceptionsWith"); } ((ExceptionHandlerWrapper<T>)this.exceptionHandler).switchTo(exceptionHandler); }
Source:
public void testNoWorkDirMigration() throws Exception { Computer computer = j.jenkins.getComputer("Foo"); Assert.assertThat(computer, instanceOf(SlaveComputer.class)); SlaveComputer c = (SlaveComputer)computer; ComputerLauncher launcher = c.getLauncher(); Assert.assertThat(launcher, instanceOf(JNLPLauncher.class)); JNLPLauncher jnlpLauncher = (JNLPLauncher)launcher; assertNotNull("Work Dir Settings should be defined", jnlpLauncher.getWorkDirSettings()); assertTrue("Work directory should be disabled for the migrated agebt", jnlpLauncher.getWorkDirSettings().isDisabled()); }

Target:
public void testNoWorkDirMigration() throws Exception { Computer computer = j.jenkins.getComputer("Foo"); assertThat(computer, instanceOf(SlaveComputer.class)); SlaveComputer c = (SlaveComputer)computer; ComputerLauncher launcher = c.getLauncher(); assertThat(launcher, instanceOf(JNLPLauncher.class)); JNLPLauncher jnlpLauncher = (JNLPLauncher)launcher; assertNotNull("Work Dir Settings should be defined", jnlpLauncher.getWorkDirSettings()); assertTrue("Work directory should be disabled for the migrated agent", jnlpLauncher.getWorkDirSettings().isDisabled()); }
Source:
private void maybeDownloadServerLogs(ExecuteResponse resp, ActionKey actionKey) throws InterruptedException { ActionResult result = resp.getResult(); if (resp.getServerLogsCount() > 0 && (result.getExitCode() != 0 || resp.getStatus().getCode() != Code.OK.value())) { Path parent = logDir.getRelative(actionKey.getDigest().getHash()); Path logPath = null; int logCount = 0; for (Map.Entry<String, LogFile> e : resp.getServerLogsMap().entrySet()) { if (e.getValue().getHumanReadable()) { String key = e.getKey(); logPath = parent.getRelative(key); logCount++; try { getFromFuture(remoteCache.downloadFile(logPath, e.getValue().getDigest())); if (printServerLogOnFailure.contains(key)) { report(Event.info(new String(Files.readAllBytes(Paths.get(logPath.getPathString())), UTF_8))); } } catch (IOException ex) { reportOnce(Event.warn("Failed downloading server logs from the remote cache.")); } } } if (logCount > 0 && verboseFailures) { report( Event.info("Server logs of failing action:\n " + (logCount > 1 ? parent : logPath))); } } }

Target:
private void maybeDownloadServerLogs(ExecuteResponse resp, ActionKey actionKey) throws InterruptedException { ActionResult result = resp.getResult(); if (resp.getServerLogsCount() > 0 && (result.getExitCode() != 0 || resp.getStatus().getCode() != Code.OK.value())) { Path parent = logDir.getRelative(actionKey.getDigest().getHash()); Path logPath = null; int logCount = 0; for (Map.Entry<String, LogFile> e : resp.getServerLogsMap().entrySet()) { if (e.getValue().getHumanReadable()) { logPath = parent.getRelative(e.getKey()); logCount++; try { getFromFuture(remoteCache.downloadFile(logPath, e.getValue().getDigest())); } catch (IOException ex) { reportOnce(Event.warn("Failed downloading server logs from the remote cache.")); } } } if (logCount > 0 && verboseFailures) { report( Event.info("Server logs of failing action:\n " + (logCount > 1 ? parent : logPath))); } } }
Source:
public List<Class<?>> traverseBundlesForOsgiServices() { List<Class<?>> osgiClasses = new ArrayList<Class<?>>(); for (Bundle bundle : bundles) { BundleContext context = bundle.getBundleContext(); ServiceReference ref = context.getServiceReference(PackageAdmin.class.getName()); PackageAdmin packageAdmin = (PackageAdmin) context.getService(ref); ExportedPackage[] exportedPackages = packageAdmin.getExportedPackages(bundle); for (ExportedPackage ePackage : exportedPackages) { String packageName = ePackage.getName(); String packagePath = "/" + packageName.replace('.', '/'); Enumeration clazzes = bundle.findEntries(packagePath, "*.class", false); while (clazzes.hasMoreElements()) { URL url = (URL) clazzes.nextElement(); String className = getClassNameFromUrl(url); String fullClassName = packageName + "." + className; try { Class clazz = bundle.loadClass(fullClassName); Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { if (field.isAnnotationPresent(OsgiService.class)) { Class fieldClass = field.getType(); if (!osgiClasses.contains(fieldClass)) { osgiClasses.add(fieldClass); } break; } } } catch (ClassNotFoundException e) { e.printStackTrace(); LOG.error("Class not found in the bundle!", e); } } } } return osgiClasses; }

Target:
public Collection<Class<?>> traverseBundlesForOsgiServices() { Collection<Class<?>> allClasses = getClasses(); Set<Class<?>> osgiClasses = new HashSet<Class<?>>(); for (Class<?> clazz : allClasses) { Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { if (field.isAnnotationPresent(OsgiService.class)) { Class<?> fieldClass = field.getType(); osgiClasses.add(fieldClass); } } Constructor<?>[] constructors = clazz.getConstructors(); for (Constructor<?> constructor : constructors) { Class<?>[] parameterTypes = constructor.getParameterTypes(); Annotation[][] annotations = constructor.getParameterAnnotations(); for (int i = 0; i < parameterTypes.length; i++) { for (Annotation annotation : annotations[i]) { if (annotation.annotationType().equals(OsgiService.class)) { osgiClasses.add(parameterTypes[i]); } break; } } } } return osgiClasses; }
Source:
public CraftingRecipeRegistry getCraftingRecipeRegistry() { return new SpongeCraftingRecipeRegistry(); }

Target:
public CraftingRecipeRegistry getCraftingRecipeRegistry() { return SpongeCraftingRecipeRegistry.getInstance(); }
Source:
public void getUserShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUser(new RetrofitPromise<User>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }

Target:
public void getUserShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUser(new RetrofitPromise<User>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me", MOCK_URL)); }
Source:
public Crn.Service eventSource(StructuredRestCallEvent structuredEvent) { return Crn.Service.DATAHUB; }

Target:
public Crn.Service eventSource(StructuredRestCallEvent structuredEvent) { String resourceType = structuredEvent.getOperation().getResourceType(); if (resourceType != null) { RestResourceAuditEventConverter restResourceAuditEventConverter = getConverter(resourceType); if (restResourceAuditEventConverter != null) { return restResourceAuditEventConverter.eventSource(structuredEvent); } } return null; }
Source:
private List<Step> getAlignmentsSteps(String gappedSequenceString){ List<Step> returnList = new ArrayList(); for (char c: gappedSequenceString.toCharArray()){ if (c=='-') returnList.add(Step.GAP); else returnList.add(Step.COMPOUND); } return returnList; }

Target:
private List<Step> getAlignmentsSteps(String gappedSequenceString){ List<Step> returnList = new ArrayList<Step>(); for (char c: gappedSequenceString.toCharArray()){ if (c=='-') returnList.add(Step.GAP); else returnList.add(Step.COMPOUND); } return returnList; }
Source:
public synchronized int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { SqlArguments args = new SqlArguments(uri, selection, selectionArgs); synchronized (mLock) { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); int count = db.update(args.table, values, args.where, args.args); if (count > 0) sendNotify(uri); return count; } }

Target:
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { SqlArguments args = new SqlArguments(uri, selection, selectionArgs); synchronized (mLock) { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); int count = db.update(args.table, values, args.where, args.args); if (count > 0) sendNotify(uri); return count; } }
Source:
private Runnable createPollTaskForStartOrder(long startOrder, PeriodicDatabasePoll periodicPollUpdate) { return () -> { ReentrantReadWriteLock.ReadLock lock = startStopPollLock.readLock(); lock.lock(); try { if (startOrder == currentStartPollingOrder) { poll(); periodicPollUpdate.firstPollCompletionFuture.complete(null); } else { log.debug("startOrder = currentStartPollingOrder = %d, skipping poll()", startOrder); } } catch (Throwable t) { log.makeAlert(t, "Uncaught exception in " + getClass().getName() + "'s polling thread").emit(); if (!(t instanceof Exception)) { periodicPollUpdate.firstPollCompletionFuture.completeExceptionally(t); throw t; } } finally { lock.unlock(); } }; }

Target:
private Runnable createPollTaskForStartOrder(long startOrder, PeriodicDatabasePoll periodicPollUpdate) { return () -> { ReentrantReadWriteLock.ReadLock lock = startStopPollLock.readLock(); lock.lock(); try { if (startOrder == currentStartPollingOrder) { poll(); periodicPollUpdate.firstPollCompletionFuture.complete(null); } else { log.debug("startOrder = currentStartPollingOrder = %d, skipping poll()", startOrder); } } catch (Throwable t) { log.makeAlert(t, "Uncaught exception in %s's polling thread", SQLMetadataSegmentManager.class).emit(); if (!(t instanceof Exception)) { periodicPollUpdate.firstPollCompletionFuture.completeExceptionally(t); throw t; } } finally { lock.unlock(); } }; }
Source:
private void assertCoded() { Assert.assertNotEquals(allergen.getCodedAllergen().getUuid(), otherNonCodedConceptUuid); Assert.assertNull(allergen.getNonCodedAllergen()); Assert.assertTrue(allergen.isCoded()); }

Target:
private void assertCoded() { Assert.assertNotEquals(allergen.getCodedAllergen().getUuid(), Allergen.getOtherNonCodedConceptUuid()); Assert.assertNull(allergen.getNonCodedAllergen()); Assert.assertTrue(allergen.isCoded()); }
Source:
private List<LogrotateAdditionalFile> getAllExtraFiles() { final List<SingularityExecutorLogrotateAdditionalFile> original = configuration.getLogrotateAdditionalFiles(); final List<LogrotateAdditionalFile> transformed = new ArrayList<>(original.size()); for (SingularityExecutorLogrotateAdditionalFile additionalFile : original) { String dateformat; if (additionalFile.getDateformat().isPresent()) { dateformat = additionalFile.getDateformat().get().startsWith("-") ? additionalFile.getDateformat().get().substring(1) : additionalFile.getDateformat().get(); } else { dateformat = configuration.getLogrotateExtrasDateformat().startsWith("-") ? configuration.getLogrotateExtrasDateformat().substring(1) : configuration.getLogrotateExtrasDateformat(); } if (additionalFile.getLogrotateFrequencyOverride().isPresent() && additionalFile.getLogrotateFrequencyOverride().get() == SingularityExecutorLogrotateFrequency.HOURLY) { transformed.add( new LogrotateAdditionalFile( taskDefinition.getTaskDirectoryPath().resolve(additionalFile.getFilename()).toString(), additionalFile.getExtension().or(Strings.emptyToNull(Files.getFileExtension(additionalFile.getFilename()))), dateformat, additionalFile.getLogrotateFrequencyOverride() )); } } return transformed; }

Target:
private List<LogrotateAdditionalFile> getAllExtraFiles() { final List<SingularityExecutorLogrotateAdditionalFile> original = configuration.getLogrotateAdditionalFiles(); final List<LogrotateAdditionalFile> transformed = new ArrayList<>(original.size()); for (SingularityExecutorLogrotateAdditionalFile additionalFile : original) { String dateformat; if (additionalFile.getDateformat().isPresent()) { dateformat = additionalFile.getDateformat().get().startsWith("-") ? additionalFile.getDateformat().get().substring(1) : additionalFile.getDateformat().get(); } else { dateformat = configuration.getLogrotateExtrasDateformat().startsWith("-") ? configuration.getLogrotateExtrasDateformat().substring(1) : configuration.getLogrotateExtrasDateformat(); } transformed.add( new LogrotateAdditionalFile( taskDefinition.getTaskDirectoryPath().resolve(additionalFile.getFilename()).toString(), additionalFile.getExtension().or(Strings.emptyToNull(Files.getFileExtension(additionalFile.getFilename()))), dateformat, additionalFile.getLogrotateFrequencyOverride() )); } return transformed; }
Source:
public @NonNull InetAddress getAddress() { try { return InetAddress.getByAddress(address); } catch (UnknownHostException e) { return null; } }

Target:
public @NonNull InetAddress getAddress() { try { return InetAddress.getByAddress(address); } catch (UnknownHostException e) { throw new IllegalArgumentException("Address is invalid"); } }
Source:
private static void checkComparability(ParseNode node, PDataType lhsDataType, PDataType rhsDataType) throws TypeMismatchException { if(lhsDataType != null && rhsDataType != null) { if(lhsDataType.isArrayType()) { if (!rhsDataType.isArrayType()) { PDataType baseType = PDataType.fromTypeId(lhsDataType .getSqlType() - Types.ARRAY); if (!(baseType.isComparableTo(rhsDataType))) { throw new TypeMismatchException(lhsDataType, rhsDataType, node.toString()); } } } else if(!lhsDataType.isComparableTo(rhsDataType)) throw new TypeMismatchException(lhsDataType, rhsDataType, node.toString()); } }

Target:
private static void checkComparability(ParseNode node, PDataType lhsDataType, PDataType rhsDataType) throws TypeMismatchException { if(lhsDataType != null && rhsDataType != null && !lhsDataType.isComparableTo(rhsDataType)) { throw new TypeMismatchException(lhsDataType, rhsDataType, node.toString()); } }