auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private SymbolStatsEstimate normalizeSymbolStats(Symbol symbol, SymbolStatsEstimate symbolStats, PlanNodeStatsEstimate stats, TypeProvider types) { if (symbolStats.isUnknown()) { return SymbolStatsEstimate.unknown(); } double outputRowCount = stats.getOutputRowCount(); double distinctValuesCount = symbolStats.getDistinctValuesCount(); double nullsFraction = symbolStats.getNullsFraction(); double averageRowSize = symbolStats.getAverageRowSize(); double lowValue = symbolStats.getLowValue(); double highValue = symbolStats.getHighValue(); if (!isNaN(distinctValuesCount)) { Type type = requireNonNull(types.get(symbol), () -> "No stats for symbol " + symbol); double maxDistinctValuesByLowHigh = maxDistinctValuesByLowHigh(symbolStats, type); if (distinctValuesCount > maxDistinctValuesByLowHigh) { distinctValuesCount = maxDistinctValuesByLowHigh; } if (distinctValuesCount > outputRowCount) { distinctValuesCount = outputRowCount; } double nonNullValues = outputRowCount * (1 - nullsFraction); if (distinctValuesCount > nonNullValues) { double difference = distinctValuesCount - nonNullValues; distinctValuesCount -= difference / 2; nonNullValues += difference / 2; nullsFraction = 1 - nonNullValues / outputRowCount; } } if (distinctValuesCount == 0.0) { nullsFraction = 1.0; averageRowSize = 0.0; lowValue = NaN; highValue = NaN; } return new SymbolStatsEstimate(lowValue, highValue, nullsFraction, averageRowSize, distinctValuesCount); }

Target:
private SymbolStatsEstimate normalizeSymbolStats(Symbol symbol, SymbolStatsEstimate symbolStats, PlanNodeStatsEstimate stats, TypeProvider types) { if (symbolStats.isUnknown()) { return SymbolStatsEstimate.unknown(); } double outputRowCount = stats.getOutputRowCount(); double distinctValuesCount = symbolStats.getDistinctValuesCount(); double nullsFraction = symbolStats.getNullsFraction(); if (!isNaN(distinctValuesCount)) { Type type = requireNonNull(types.get(symbol), () -> "No stats for symbol " + symbol); double maxDistinctValuesByLowHigh = maxDistinctValuesByLowHigh(symbolStats, type); if (distinctValuesCount > maxDistinctValuesByLowHigh) { distinctValuesCount = maxDistinctValuesByLowHigh; } if (distinctValuesCount > outputRowCount) { distinctValuesCount = outputRowCount; } double nonNullValues = outputRowCount * (1 - nullsFraction); if (distinctValuesCount > nonNullValues) { double difference = distinctValuesCount - nonNullValues; distinctValuesCount -= difference / 2; nonNullValues += difference / 2; nullsFraction = 1 - nonNullValues / outputRowCount; } } if (distinctValuesCount == 0.0) { return SymbolStatsEstimate.zero(); } return SymbolStatsEstimate.buildFrom(symbolStats) .setDistinctValuesCount(distinctValuesCount) .setNullsFraction(nullsFraction) .build(); }
Source:
public boolean handles(final Table table, final Object axisElement) { final String id = AxisUtils.getPropertyId(axisElement); return (null != id && id.equals(SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID)); }

Target:
public boolean handles(final Table table, final Object axisElement) { return (SYSML_REQUIREMENTS_REQUIREMENT_TEXT_ID.equals(AxisUtils.getPropertyId(axisElement))); }
Source:
protected void handleUpstream1(ChannelHandlerContext ctx, ChannelEvent evt) throws Exception { ChannelEventKind eventAsKind = asEventKind(evt); ChannelFuture handlerFuture = getHandlerFuture(); assert handlerFuture != null; if (handlerFuture.isDone() || !interestEvents.contains(eventAsKind)) { ctx.sendUpstream(evt); } else if (!expectedEvents.contains(eventAsKind)) { handleUnexpectedEvent(ctx, evt); } else { ChannelFuture pipelineFuture = getPipelineFuture(); if (!pipelineFuture.isSuccess()) { Exception exception = new ScriptProgressException(getRegionInfo(), format("%s", this)); handlerFuture.setFailure(exception.fillInStackTrace()); } else { super.handleUpstream1(ctx, evt); } } }

Target:
protected void handleUpstream1(ChannelHandlerContext ctx, ChannelEvent evt) throws Exception { ChannelEventKind eventAsKind = asEventKind(evt); ChannelFuture handlerFuture = getHandlerFuture(); assert handlerFuture != null; if (handlerFuture.isDone() || !interestEvents.contains(eventAsKind)) { ctx.sendUpstream(evt); } else if (!expectedEvents.contains(eventAsKind)) { handleUnexpectedEvent(ctx, evt); } else { ChannelFuture pipelineFuture = getPipelineFuture(); if (!pipelineFuture.isSuccess()) { assert pipelineFuture.isDone(); Exception exception = new ScriptProgressException(getRegionInfo(), format("%s", this)); handlerFuture.setFailure(exception.fillInStackTrace()); } else { super.handleUpstream1(ctx, evt); } } }
Source:
static void runScript(String filename, Connection cx) throws SQLException { try { SqlUtil.runScript(new GeoPackage().getClass().getResourceAsStream(filename), cx); } catch (IOException e) { } }

Target:
static void runScript(String filename, Connection cx) throws SQLException { try { SqlUtil.runScript(new GeoPackage().getClass().getResourceAsStream(filename), cx); } catch (IOException e) { throw new SQLException(e); } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } StorageWrapper other = (StorageWrapper)obj; if (fullPath == null) { if (other.fullPath != null) { return false; } } else if (!fullPath.equals(other.fullPath)) { return false; } if (storage == null) { if (other.storage != null) { return false; } } else if (!storage.equals(other.storage)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StorageWrapper) { StorageWrapper other = (StorageWrapper)obj; return Objects.equal(fullPath, other.fullPath) && Objects.equal(storage, other.storage); } return false; }
Source:
public void modifyJobPriority() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "test_modify_job_priority"; try { client.putBucket(new PutBucketRequest(bucketName)); final List<Ds3Object> objects = new ArrayList<>(); final Ds3Object obj = new Ds3Object("test", 2); objects.add(obj); final WriteJobOptions jobOptions = WriteJobOptions.create().withPriority(Priority.LOW); final Ds3ClientHelpers.Job job = wrap(client).startWriteJob(bucketName, objects, jobOptions); client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId()) .withPriority(Priority.HIGH)); final GetJobSpectraS3Response response = client .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId())); assertThat(response.getMasterObjectListResult().getPriority(), is(Priority.HIGH)); } finally { deleteAllContents(client, bucketName); } }

Target:
public void modifyJobPriority() throws IOException, SignatureException, XmlProcessingException { try { final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList( new Ds3Object("test", 2)), WriteJobOptions.create().withPriority(Priority.LOW)); client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId()) .withPriority(Priority.HIGH)); final GetJobSpectraS3Response response = client .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId())); assertThat(response.getMasterObjectListResult().getPriority(), is(Priority.HIGH)); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
public DynamicJaxbContextManager() { if( ! instanceCreated.compareAndSet(0, 1) ) { logger.debug("Instance of the created!", instanceCreated.incrementAndGet(), DynamicJaxbContext.class.getSimpleName() ); } }

Target:
public DynamicJaxbContextManager() { if( ! instanceCreated.compareAndSet(0, 1) ) { logger.error("Instance of the created!", instanceCreated.incrementAndGet(), DynamicJaxbContext.class.getSimpleName() ); } }
Source:
public static void terminatePantsProcess(Project project) { Process process = runningPantsProcesses.get(project); if (process != null) { process.destroy(); } runningPantsProcesses.remove(project); }

Target:
public static void terminatePantsProcess(Project project) { Process process = runningPantsProcesses.get(project); if (process != null) { process.destroy(); runningPantsProcesses.remove(project, process); } }
Source:
public List<Entitlement> entitleByProducts(AutobindData data) throws EntitlementRefusedException { Consumer consumer = data.getConsumer(); String[] productIds = data.getProductIds(); Collection<String> fromPools = data.getPossiblePools(); Date entitleDate = data.getOnDate(); Owner owner = consumer.getOwner(); int retries = MAX_ENTITLE_RETRIES; while (true) { try { List<Entitlement> entitlements = new LinkedList<Entitlement>(); List<PoolQuantity> bestPools = getBestPools(consumer, productIds, entitleDate, owner, null, fromPools); if (bestPools == null) { List<String> fullList = new ArrayList<String>(); fullList.addAll(Arrays.asList(productIds)); for (ConsumerInstalledProduct cip : consumer.getInstalledProducts()) { fullList.add(cip.getId()); } log.info("No entitlements available for products: {}", fullList); return null; } for (PoolQuantity entry : bestPools) { entitlements.add(addOrUpdateEntitlement(consumer, entry.getPool(), null, entry.getQuantity(), false, CallerType.BIND)); } return entitlements; } catch (EntitlementRefusedException e) { String key = e.getResult().getErrors().get(0).getResourceKey(); if (key.equals("rulefailed.no.entitlements.available") && retries-- > 0) { log.info("No entitlements available while attempting to entitle; retrying"); continue; } throw e; } } }

Target:
public List<Entitlement> entitleByProducts(AutobindData data) throws EntitlementRefusedException { Consumer consumer = data.getConsumer(); String[] productIds = data.getProductIds(); Collection<String> fromPools = data.getPossiblePools(); Date entitleDate = data.getOnDate(); Owner owner = consumer.getOwner(); int retries = MAX_ENTITLE_RETRIES; while (true) { try { List<Entitlement> entitlements = new LinkedList<Entitlement>(); List<PoolQuantity> bestPools = getBestPools(consumer, productIds, entitleDate, owner, null, fromPools); if (bestPools == null) { List<String> fullList = new ArrayList<String>(); fullList.addAll(Arrays.asList(productIds)); for (ConsumerInstalledProduct cip : consumer.getInstalledProducts()) { fullList.add(cip.getId()); } log.info("No entitlements available for products: {}", fullList); return null; } for (PoolQuantity entry : bestPools) { entitlements.add(addOrUpdateEntitlement(consumer, entry.getPool(), null, entry.getQuantity(), false, CallerType.BIND)); } return entitlements; } catch (EntitlementRefusedException e) { String key = e.getResult().getErrors().get(0).getResourceKey(); if (key.equals("rulefailed.no.entitlements.available") && retries-- > 0) { log.info( "Entitlements exhausted between select best pools and bind operations; retrying" ); continue; } throw e; } } }
Source:
private void refreshPreview() { server_.previewDataImport(fileChooserTextBox_.getTextBoxText(), maxRows_, new ServerRequestCallback<JsObject>() { @Override public void onResponseReceived(JsObject response) { gridViewer_.setOption("nullsAsNAs", "true"); gridViewer_.setOption("status", "Previewing first " + toLocaleString(maxRows_) + " entries"); gridViewer_.setData(response); } @Override public void onError(ServerError error) { } }); }

Target:
private void refreshPreview() { progressIndicator_.onProgress("Retrieving preview data"); server_.previewDataImport(fileOrUrlChooserTextBox_.getText(), maxRows_, new ServerRequestCallback<JsObject>() { @Override public void onResponseReceived(JsObject response) { JsObject error = response.getObject("error"); if (error != null) { progressIndicator_.onError(getErrorMessage(error)); return; } gridViewer_.setOption("nullsAsNAs", "true"); gridViewer_.setOption("status", "Previewing first " + toLocaleString(maxRows_) + " entries"); gridViewer_.setData(response); progressIndicator_.onCompleted(); } @Override public void onError(ServerError error) { progressIndicator_.onError(error.getMessage()); } }); }
Source:
public Broadcast transform(org.atlasapi.media.entity.simple.Broadcast simple) { if (Strings.isNullOrEmpty(simple.getBroadcastOn()) && !hasChannelId(simple)) { throw new IllegalArgumentException( "Must specify a channel either through a channel object or broadcastOn channel URI"); } if (!Strings.isNullOrEmpty(simple.getBroadcastOn()) && hasChannelId(simple)) { throw new IllegalArgumentException( "Must not specify a channel ID and a channel URI. Supply only one."); } String broadcastOn = null; if (hasChannelId(simple)) { String channelId = simple.getChannel().getId(); Iterable<Channel> channels = channelResolver.forIds(ImmutableSet.of(codec.decode(channelId) .longValue())); if (Iterables.size(channels) != 1) { throw new IllegalArgumentException("Could not resolve channel ID " + channelId); } broadcastOn = Iterables.getOnlyElement(channels).getCanonicalUri(); } else { broadcastOn = simple.getBroadcastOn(); } Broadcast complex = new Broadcast(broadcastOn, new DateTime(simple.getTransmissionTime()), new DateTime(simple.getTransmissionEndTime())) .withId(simple.getId()); if (simple.getActualTransmissionTime() != null) { complex.setActualTransmissionTime(new DateTime(simple.getActualTransmissionTime())); } if (simple.getActualTransmissionEndTime() != null) { complex.setActualTransmissionEndTime(new DateTime(simple.getActualTransmissionEndTime())); } complex.setScheduleDate(simple.getScheduleDate()); complex.setRepeat(simple.getRepeat()); complex.setSubtitled(simple.getSubtitled()); complex.setSigned(simple.getSigned()); complex.setAudioDescribed(simple.getAudioDescribed()); complex.setHighDefinition(simple.getHighDefinition()); complex.setWidescreen(simple.getWidescreen()); complex.setSurround(simple.getSurround()); complex.setLive(simple.getLive()); complex.setAliasUrls(simple.getAliases()); return complex; }

Target:
public Broadcast transform(org.atlasapi.media.entity.simple.Broadcast simple) { Broadcast complex = new Broadcast(resolveChannel(simple), new DateTime(simple.getTransmissionTime()), new DateTime(simple.getTransmissionEndTime())) .withId(simple.getId()); if (simple.getActualTransmissionTime() != null) { complex.setActualTransmissionTime(new DateTime(simple.getActualTransmissionTime())); } if (simple.getActualTransmissionEndTime() != null) { complex.setActualTransmissionEndTime(new DateTime(simple.getActualTransmissionEndTime())); } complex.setScheduleDate(simple.getScheduleDate()); complex.setRepeat(simple.getRepeat()); complex.setSubtitled(simple.getSubtitled()); complex.setSigned(simple.getSigned()); complex.setAudioDescribed(simple.getAudioDescribed()); complex.setHighDefinition(simple.getHighDefinition()); complex.setWidescreen(simple.getWidescreen()); complex.setSurround(simple.getSurround()); complex.setLive(simple.getLive()); complex.setAliasUrls(simple.getAliases()); return complex; }
Source:
public boolean isSameTime(Date d1, Date d2) { Calendar c1 = Calendar.getInstance(tz); c1.setTime(d1); Calendar c2 = Calendar.getInstance(tz); c2.setTime(d2); return isSameTime(c1, c2); }

Target:
public boolean isSameTime(Date d1, Date d2) { return d1.getTime() == d2.getTime(); }
Source:
public JcrPropertySampleModel(int i) { if( StringUtils.isBlank(name) ) modName = surname + i; }

Target:
public JcrPropertySampleModel(int i) { if (StringUtils.isBlank(name)) { modName = surname + i; } }
Source:
private ZooKeeper getExpectedZookeeper(final String expectedSessionId) { ZooKeeper zk = ((ZkConnection) getConnection()).getZookeeper(); if (expectedSessionId == null || expectedSessionId.isEmpty()) { return zk; } acquireEventLock(); try { final String actualSessionId = Long.toHexString(zk.getSessionId()); if (!actualSessionId.equals(expectedSessionId)) { throw new ZkSessionMismatchedException( "Failed to get expected zookeeper instance! There is a session id mismatch. Expected: " + expectedSessionId + ". Actual: " + actualSessionId); } return ((ZkConnection) getConnection()).getZookeeper(); } finally { getEventLock().unlock(); } }

Target:
private ZooKeeper getExpectedZookeeper(final String expectedSessionId) { ZooKeeper zk = ((ZkConnection) getConnection()).getZookeeper(); if (expectedSessionId == null || expectedSessionId.isEmpty()) { return zk; } final String actualSessionId = Long.toHexString(zk.getSessionId()); if (!actualSessionId.equals(expectedSessionId)) { throw new ZkSessionMismatchedException( "Failed to get expected zookeeper instance! There is a session id mismatch. Expected: " + expectedSessionId + ". Actual: " + actualSessionId); } return zk; }
Source:
public Response<Void> downloadWithResponse(OutputStream stream, FileRange range, Boolean rangeGetContentMD5, Duration timeout, Context context) { Objects.requireNonNull(stream, "'stream' cannot be null."); Mono<Response<Void>> download = fileAsyncClient.downloadWithResponse(range, rangeGetContentMD5, context) .flatMapMany(response -> response.getValue().doOnNext(buffer -> { try { stream.write(FluxUtil.byteBufferToArray(buffer)); } catch (IOException ex) { throw logger.logExceptionAsError(new UncheckedIOException(ex)); } }).map(buffer -> response)) .last() .map(response -> new SimpleResponse<>(response, null)); return Utility.blockWithOptionalTimeout(download, timeout); }

Target:
public Response<Void> downloadWithResponse(OutputStream stream, FileRange range, Boolean rangeGetContentMD5, Duration timeout, Context context) { Objects.requireNonNull(stream, "'stream' cannot be null."); Mono<Response<Void>> download = fileAsyncClient.downloadWithResponse(range, rangeGetContentMD5, context) .flatMap(response -> response.getValue().reduce(stream, (outputStream, buffer) -> { try { outputStream.write(FluxUtil.byteBufferToArray(buffer)); return outputStream; } catch (IOException ex) { throw logger.logExceptionAsError(Exceptions.propagate(new UncheckedIOException(ex))); } }).thenReturn(new SimpleResponse<>(response, null))); return Utility.blockWithOptionalTimeout(download, timeout); }
Source:
public static String convertNewlines(String input){ return input.replace("%n", System.getProperty("line.separator")); }

Target:
public static String convertNewlines(String input){ return input.replace("\\n", System.getProperty("line.separator")); }
Source:
public void showBadImagePopup(Integer errorCode) { String errorMessageForResult = getErrorMessageForResult(getContext(), errorCode); if (!StringUtils.isBlank(errorMessageForResult)) { DialogUtil.showAlertDialog(getActivity(), getString(R.string.duplicate_image_found), errorMessageForResult, getString(R.string.cancel), getString(R.string.upload_proceed), () -> deleteThisPicture(), () -> { uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP); onNextButtonClicked(); }); } }

Target:
public void showBadImagePopup(Integer errorCode) { String errorMessageForResult = getErrorMessageForResult(getContext(), errorCode); if (!StringUtils.isBlank(errorMessageForResult)) { DialogUtil.showAlertDialog(getActivity(), getString(R.string.upload_problem_image), errorMessageForResult, getString(R.string.upload), getString(R.string.cancel), () -> { uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP); onNextButtonClicked(); }, () -> deleteThisPicture() ); } }
Source:
void testWithNullRegex() { final String regex = null; final String type = "String"; final GelfDynamicMdcFieldType fieldType = GelfDynamicMdcFieldType.createField(null, regex, type); assertThat(fieldType).isNull(); }

Target:
public void testWithNullRegex() { String regex = null; String type = "String"; expectedException.expect(IllegalArgumentException.class); GelfDynamicMdcFieldType.createField(null, regex, type); }
Source:
private void log(String accessLog, AccessLogData accessLogData) { Set<AccessLogData> logSet = LOG_ENTRIES.computeIfAbsent(accessLog, k -> new ConcurrentHashSet<>()); if (logSet.size() >= LOG_MAX_BUFFER) { logSet.add(accessLogData); } else { logger.warn("AccessLog buffer is full. Do a force writing to file to clear buffer."); writeLogSetToFile(accessLog, logSet); logSet.add(accessLogData); } }

Target:
private void log(String accessLog, AccessLogData accessLogData) { Set<AccessLogData> logSet = LOG_ENTRIES.computeIfAbsent(accessLog, k -> new ConcurrentHashSet<>()); if (logSet.size() < LOG_MAX_BUFFER) { logSet.add(accessLogData); } else { logger.warn("AccessLog buffer is full. Do a force writing to file to clear buffer."); writeLogSetToFile(accessLog, logSet); logSet.add(accessLogData); } }
Source:
private void showNotification(ItineraryDescription description, int title, int message, Class<? extends Activity> notificationTarget, Bundle params, List<Itinerary> itineraries) { String titleText = getResources().getString(title); String messageText = getResources().getString(message); Intent openIntent = new Intent(getApplicationContext(), notificationTarget); openIntent.putExtras(params); openIntent.putExtra(OTPConstants.INTENT_SOURCE, OTPConstants.Source.NOTIFICATION); openIntent.putExtra(OTPConstants.ITINERARIES, (ArrayList<Itinerary>) itineraries); openIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent openPendingIntent = PendingIntent .getActivity(getApplicationContext(), 0, openIntent, PendingIntent.FLAG_CANCEL_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext(),Application.CHANNEL_REALTIME_ID) .setSmallIcon(R.drawable.ic_stat_notification) .setContentTitle(titleText) .setStyle(new NotificationCompat.BigTextStyle().bigText(messageText)) .setContentText(messageText) .setPriority(NotificationCompat.PRIORITY_MAX) .setContentIntent(openPendingIntent); NotificationManager notificationManager = (NotificationManager) getApplicationContext() .getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = mBuilder.build(); notification.defaults = Notification.DEFAULT_ALL; notification.flags |= Notification.FLAG_AUTO_CANCEL | Notification.FLAG_SHOW_LIGHTS; Integer notificationId = description.getId(); notificationManager.notify(notificationId, notification); }

Target:
private void showNotification(ItineraryDescription description, int title, int message, Class<? extends Activity> notificationTarget, Bundle params, List<Itinerary> itineraries) { String titleText = getResources().getString(title); String messageText = getResources().getString(message); Intent openIntent = new Intent(getApplicationContext(), notificationTarget); openIntent.putExtras(params); openIntent.putExtra(OTPConstants.INTENT_SOURCE, OTPConstants.Source.NOTIFICATION); openIntent.putExtra(OTPConstants.ITINERARIES, (ArrayList<Itinerary>) itineraries); openIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent openPendingIntent = PendingIntent .getActivity(getApplicationContext(), 0, openIntent, PendingIntent.FLAG_CANCEL_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext(), Application.CHANNEL_TRIP_PLAN_UPDATES_ID) .setSmallIcon(R.drawable.ic_stat_notification) .setContentTitle(titleText) .setStyle(new NotificationCompat.BigTextStyle().bigText(messageText)) .setContentText(messageText) .setPriority(NotificationCompat.PRIORITY_MAX) .setContentIntent(openPendingIntent); NotificationManager notificationManager = (NotificationManager) getApplicationContext() .getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = mBuilder.build(); notification.defaults = Notification.DEFAULT_ALL; notification.flags |= Notification.FLAG_AUTO_CANCEL | Notification.FLAG_SHOW_LIGHTS; Integer notificationId = description.getId(); notificationManager.notify(notificationId, notification); }
Source:
public DataFetchingEnvironmentImpl(Object source, Map<String, Object> arguments, Object context, Object root, GraphQLFieldDefinition fieldDefinition, List<Field> fields, GraphQLOutputType fieldType, GraphQLType parentType, GraphQLSchema graphQLSchema, Map<String, FragmentDefinition> fragmentsByName, ExecutionId executionId, DataFetchingFieldSelectionSet selectionSet, ExecutionTypeInfo fieldTypeInfo, ExecutionContext executionContext) { this.source = source; this.arguments = arguments == null ? Collections.emptyMap() : unmodifiableMap(arguments); this.fragmentsByName = fragmentsByName == null ? Collections.emptyMap() : unmodifiableMap(fragmentsByName); this.context = context; this.root = root; this.fieldDefinition = fieldDefinition; this.fields = fields; this.fieldType = fieldType; this.parentType = parentType; this.graphQLSchema = graphQLSchema; this.executionId = executionId; this.selectionSet = selectionSet; this.fieldTypeInfo = fieldTypeInfo; this.executionContext = assertNotNull(executionContext); }

Target:
public DataFetchingEnvironmentImpl(Object source, Map<String, Object> arguments, Object context, Object root, GraphQLFieldDefinition fieldDefinition, List<Field> fields, GraphQLOutputType fieldType, GraphQLType parentType, GraphQLSchema graphQLSchema, Map<String, FragmentDefinition> fragmentsByName, ExecutionId executionId, DataFetchingFieldSelectionSet selectionSet, ExecutionTypeInfo fieldTypeInfo, ExecutionContext executionContext) { this.source = source; this.arguments = arguments == null ? Collections.emptyMap() : arguments; this.fragmentsByName = fragmentsByName == null ? Collections.emptyMap() : fragmentsByName; this.context = context; this.root = root; this.fieldDefinition = fieldDefinition; this.fields = fields; this.fieldType = fieldType; this.parentType = parentType; this.graphQLSchema = graphQLSchema; this.executionId = executionId; this.selectionSet = selectionSet; this.fieldTypeInfo = fieldTypeInfo; this.executionContext = assertNotNull(executionContext); }
Source:
protected void init(ExplorerManager tableExplorerManager) { this.accountsTableEM = tableExplorerManager; tableExplorerManager.addPropertyChangeListener(evt -> { if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } else if (ExplorerManager.PROP_EXPLORED_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } }); jSplitPane1.setRightComponent(new MessageBrowser(tableExplorerManager, messageBrowserEM)); proxyLookup = new ProxyLookup( ExplorerUtils.createLookup(messageBrowserEM, getActionMap()), ExplorerUtils.createLookup(accountsTableEM, getActionMap())); }

Target:
void init(ExplorerManager tableExplorerManager) { this.accountsTableEM = tableExplorerManager; tableExplorerManager.addPropertyChangeListener(evt -> { if (ExplorerManager.PROP_ROOT_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } else if (ExplorerManager.PROP_EXPLORED_CONTEXT.equals(evt.getPropertyName())) { SwingUtilities.invokeLater(this::setColumnWidths); } }); jSplitPane1.setRightComponent(new MessageBrowser(tableExplorerManager, messageBrowserEM)); proxyLookup = new ProxyLookup( ExplorerUtils.createLookup(messageBrowserEM, getActionMap()), ExplorerUtils.createLookup(accountsTableEM, getActionMap())); }
Source:
public List<IndexEntry> getValidEntry(IndexSegment indexSegment, FileSpan duplicateSearchSpan, boolean checkAlreadyCopied) throws StoreException { List<IndexEntry> allIndexEntries = new ArrayList<>(); indexSegment.getIndexEntriesSince(null, new FindEntriesCondition(Long.MAX_VALUE), allIndexEntries, new AtomicLong(0), true); StoreFindToken safeToken = new StoreFindToken(allIndexEntries.get(0).getKey(), indexSegment.getStartOffset(), sessionId, incarnationId); compactionLog.setSafeToken(safeToken); logger.debug("Set safe token for compaction in to {}", storeId, safeToken); List<IndexEntry> copyCandidates = getValidIndexEntries(indexSegment, allIndexEntries); int validEntriesSize = copyCandidates.size(); copyCandidates.removeIf( copyCandidate -> isDuplicate(copyCandidate, duplicateSearchSpan, indexSegment.getStartOffset(), checkAlreadyCopied)); copyCandidates.removeIf( copyCandidate -> isDeleteRequested(copyCandidate, selectedContainers)); copyCandidates.sort(PersistentIndex.INDEX_ENTRIES_OFFSET_COMPARATOR); logger.debug("Out of entries, are valid and will be copied in this round", allIndexEntries.size(), validEntriesSize, copyCandidates.size()); logger.trace("For index segment with start offset in - Total index entries: {}. Entries to copy: {}", indexSegment.getStartOffset(), storeId, allIndexEntries, copyCandidates); return copyCandidates; }

Target:
public List<IndexEntry> getValidEntry(IndexSegment indexSegment, FileSpan duplicateSearchSpan, boolean checkAlreadyCopied) throws StoreException { List<IndexEntry> allIndexEntries = new ArrayList<>(); indexSegment.getIndexEntriesSince(null, new FindEntriesCondition(Long.MAX_VALUE), allIndexEntries, new AtomicLong(0), true); StoreFindToken safeToken = new StoreFindToken(allIndexEntries.get(0).getKey(), indexSegment.getStartOffset(), sessionId, incarnationId); compactionLog.setSafeToken(safeToken); logger.debug("Set safe token for compaction in to {}", storeId, safeToken); List<IndexEntry> copyCandidates = getValidIndexEntries(indexSegment, allIndexEntries); int validEntriesSize = copyCandidates.size(); copyCandidates.removeIf( copyCandidate -> isDuplicate(copyCandidate, duplicateSearchSpan, indexSegment.getStartOffset(), checkAlreadyCopied) || (config.storeContainerDeletionEnabled && isFromDeprecatedContainer(copyCandidate))); copyCandidates.sort(PersistentIndex.INDEX_ENTRIES_OFFSET_COMPARATOR); logger.debug("Out of entries, are valid and will be copied in this round", allIndexEntries.size(), validEntriesSize, copyCandidates.size()); logger.trace("For index segment with start offset in - Total index entries: {}. Entries to copy: {}", indexSegment.getStartOffset(), storeId, allIndexEntries, copyCandidates); return copyCandidates; }
Source:
private void updateActionAvailability() { GlusterVolumeEntity volumeEntity = getEntity(); boolean allowRemove = true; boolean allowReplace = true; boolean allowAdvanced = true; boolean allowAdd = true; if (volumeEntity != null && volumeEntity.getVolumeType().isDispersedType()) { allowRemove = false; allowAdd = false; } if (volumeEntity == null || getSelectedItems() == null || getSelectedItems().size() == 0) { allowRemove = false; allowReplace = false; allowAdvanced = false; } else { GlusterAsyncTask volumeTask = volumeEntity.getAsyncTask(); if (volumeTask != null && (volumeTask.getStatus() == JobExecutionStatus.STARTED || volumeTask.getType() == GlusterTaskType.REMOVE_BRICK && volumeTask.getStatus() == JobExecutionStatus.FINISHED)) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.STRIPE || getSelectedItems().size() == volumeEntity.getBricks().size()) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.REPLICATE && (volumeEntity.getBricks().size() == VolumeListModel.REPLICATE_COUNT_DEFAULT || getSelectedItems().size() > 1)) { allowRemove = false; } if (getSelectedItems().size() == 1) { allowReplace = true; allowAdvanced = volumeEntity.isOnline() && getSelectedItems().get(0).isOnline(); } else { allowReplace = false; allowAdvanced = false; } } getRemoveBricksCommand().setIsExecutionAllowed(allowRemove); getReplaceBrickCommand().setIsExecutionAllowed(allowReplace); getBrickAdvancedDetailsCommand().setIsExecutionAllowed(allowAdvanced); getAddBricksCommand().setIsExecutionAllowed(allowAdd); }

Target:
private void updateActionAvailability() { GlusterVolumeEntity volumeEntity = getEntity(); boolean allowRemove = true; boolean allowReplace = true; boolean allowAdvanced = true; boolean allowAdd = true; if (volumeEntity == null || volumeEntity.getVolumeType().isDispersedType()) { allowRemove = false; allowAdd = false; } if (volumeEntity == null || getSelectedItems() == null || getSelectedItems().size() == 0) { allowRemove = false; allowReplace = false; allowAdvanced = false; } else { GlusterAsyncTask volumeTask = volumeEntity.getAsyncTask(); if (volumeTask != null && (volumeTask.getStatus() == JobExecutionStatus.STARTED || volumeTask.getType() == GlusterTaskType.REMOVE_BRICK && volumeTask.getStatus() == JobExecutionStatus.FINISHED)) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.STRIPE || getSelectedItems().size() == volumeEntity.getBricks().size()) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.REPLICATE && (volumeEntity.getBricks().size() == VolumeListModel.REPLICATE_COUNT_DEFAULT || getSelectedItems().size() > 1)) { allowRemove = false; } if (getSelectedItems().size() == 1) { allowReplace = true; allowAdvanced = volumeEntity.isOnline() && getSelectedItems().get(0).isOnline(); } else { allowReplace = false; allowAdvanced = false; } } getRemoveBricksCommand().setIsExecutionAllowed(allowRemove); getReplaceBrickCommand().setIsExecutionAllowed(allowReplace); getBrickAdvancedDetailsCommand().setIsExecutionAllowed(allowAdvanced); getAddBricksCommand().setIsExecutionAllowed(allowAdd); }
Source:
private boolean isTree(World world, BlockPos initialPos) { int logs = 0; boolean leafTop = false; BlockPos pos = initialPos; int y = 0; while(y++ < 32) { pos = pos.up(); BlockState state = world.getBlockState(pos); if(state.isIn(BlockTags.LOGS)) logs++; else { if(state.isIn(BlockTags.LEAVES)) leafTop = true; boolean foundLog = false; if(!leafTop) { for(int z = -1; z <= 1; z++) for(int x = -1; x <= 1; x++) { state = world.getBlockState(pos.add(x, 0, z)); if(state.isIn(BlockTags.LOGS)) { pos = pos.add(x, 0, z); foundLog = true; logs++; break; } } } if(!foundLog) break; } } return logs >= 3&&leafTop; }

Target:
private boolean isTree(World world, BlockPos initialPos) { int logs = 0; boolean leafTop = false; BlockPos pos = initialPos; for(int y = 0; y < 32; y++) { pos = pos.up(); BlockState state = world.getBlockState(pos); if(state.isIn(BlockTags.LOGS)) logs++; else { if(state.isIn(BlockTags.LEAVES)) leafTop = true; boolean foundLog = false; if(!leafTop) { boolean loop = true; for(int z = -1; z <= 1&&loop; z++) for(int x = -1; x <= 1&&loop; x++) { state = world.getBlockState(pos.add(x, 0, z)); if(state.isIn(BlockTags.LOGS)) { pos = pos.add(x, 0, z); foundLog = true; logs++; loop = false; } } } if(!foundLog) break; } } return logs >= 3&&leafTop; }
Source:
public void setElytraFlying(boolean value) { setFlag(7, value); }

Target:
public void setElytraFlying(boolean value) { setFlag(DataConstants.ELYTRA_FLYING_FLAG, value); }
Source:
public String execute(String container, Blob blob) { String key = blob.getMetadata().getName(); Payload payload = blob.getPayload(); algorithm .calculateChunkSize(checkNotNull( payload.getContentMetadata().getContentLength(), "contentLength required on all uploads to swift; please invoke payload.getContentMetadata().setContentLength(length) first")); int parts = algorithm.getParts(); long chunkSize = algorithm.getChunkSize(); if (parts > 0) { int part; while ((part = algorithm.getNextPart()) <= parts) { Payload chunkedPart = slicer.slice(payload, algorithm.getNextChunkOffset(), chunkSize); Blob blobPart = blobBuilders.get() .name(key + PART_SEPARATOR + part) .payload(chunkedPart) .contentDisposition(key + PART_SEPARATOR + part).build(); client.putObject(container, blob2Object.apply(blobPart)); } long remaining = algorithm.getRemaining(); if (remaining > 0) { Payload chunkedPart = slicer.slice(payload, algorithm.getNextChunkOffset(), remaining); Blob blobPart = blobBuilders.get() .name(key + PART_SEPARATOR + part) .payload(chunkedPart) .contentDisposition(key + PART_SEPARATOR + part).build(); client.putObject(container, blob2Object.apply(blobPart)); } return client.putObjectManifest(container, key); } else { return client.putObject(container, blob2Object.apply(blob)); } }

Target:
public String execute(String container, Blob blob) { String key = blob.getMetadata().getName(); Payload payload = blob.getPayload(); Long length = payload.getContentMetadata().getContentLength(); checkNotNull(length, "please invoke payload.getContentMetadata().setContentLength(length) prior to multipart upload"); long chunkSize = algorithm.calculateChunkSize(length); int partCount = algorithm.getParts(); if (partCount > 0) { int part; while ((part = algorithm.getNextPart()) <= partCount) { Payload chunkedPart = slicer.slice(payload, algorithm.getNextChunkOffset(), chunkSize); Blob blobPart = blobBuilders.get() .name(key + PART_SEPARATOR + part) .payload(chunkedPart) .contentDisposition(key + PART_SEPARATOR + part).build(); client.putObject(container, blob2Object.apply(blobPart)); } long remaining = algorithm.getRemaining(); if (remaining > 0) { Payload chunkedPart = slicer.slice(payload, algorithm.getNextChunkOffset(), remaining); Blob blobPart = blobBuilders.get() .name(key + PART_SEPARATOR + part) .payload(chunkedPart) .contentDisposition(key + PART_SEPARATOR + part).build(); client.putObject(container, blob2Object.apply(blobPart)); } return client.putObjectManifest(container, key); } else { return client.putObject(container, blob2Object.apply(blob)); } }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(fBinaryFilePath); if (!fSymbolName.equals("")) { sb.append(", symbol = " + fSymbolName); } sb.append(", offset = " + fOffset); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(fBinaryFilePath); if (!fSymbolName.equals("")) { sb.append(", "); sb.append(Messages.UstDebugInfoAnalysis_Symbol); sb.append('='); sb.append(fSymbolName); } sb.append(", "); sb.append(Messages.UstDebugInfoAnalysis_Offset); sb.append('='); sb.append(fOffset); return sb.toString(); }
Source:
protected void setUp() throws Exception { super.setUp(); git = new Git(db); git.commit().setMessage("initial commit").call(); writeTrashFile("Test.txt", "Hello world"); git.add().addFilepattern("Test.txt").call(); initialCommit = git.commit().setMessage("Initial commit").call(); git.branchCreate().setForce(true).setName("master").call(); RefUpdate rup = db.updateRef("refs/heads/master"); rup.setNewObjectId(initialCommit.getId()); rup.setForceUpdate(true); rup.update(); writeTrashFile("Test.txt", "Some change"); git.add().addFilepattern("Test.txt").call(); secondCommit = git.commit().setMessage("Second commit").call(); git.branchCreate().setForce(true).setName("test").call(); }

Target:
protected void setUp() throws Exception { super.setUp(); git = new Git(db); writeTrashFile("Test.txt", "Hello world"); git.add().addFilepattern("Test.txt").call(); initialCommit = git.commit().setMessage("Initial commit").call(); git.branchCreate().setName("test").call(); RefUpdate rup = db.updateRef(Constants.HEAD); rup.link("refs/heads/test"); writeTrashFile("Test.txt", "Some change"); git.add().addFilepattern("Test.txt").call(); secondCommit = git.commit().setMessage("Second commit").call(); }
Source:
public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters()); Guid currentChildId = getCurrentChildId(getParameters()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } log.info("Executing Command with id '{}', step '{}'", getCommandId(), getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; } persistCommandIfNeeded(); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }

Target:
public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters()); Guid currentChildId = getCurrentChildId(getParameters()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } log.info("Command id: '{}' is executing step: '{}'", getCommandId(), getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; } persistCommandIfNeeded(); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }
Source:
public Beacon createNewBlock(Input in, byte[] pubKey) { Beacon block = new Beacon(in.parent.getHash(), randaoReveal(in.state, pubKey), in.mainChainRef, HashUtil.EMPTY_DATA_HASH, in.slotNumber, new AttestationRecord[0]); BeaconState newState = stateTransition.applyBlock(block, in.state); block.setStateHash(newState.getHash()); AttestationRecord[] attestationRecords = new AttestationRecord[1]; byte[] emptyBitfield = Bitfield.createEmpty(in.index.getCommitteeSize()); long lastJustified = in.state.getCrystallizedState().getFinality().getLastJustifiedSlot(); attestationRecords[0] = new AttestationRecord( in.slotNumber, in.index.getShardId(), new byte[0][0], new byte[32], Bitfield.markVote(emptyBitfield, in.index.getValidatorIdx()), lastJustified, store.getCanonicalByNumber(lastJustified) == null ? new byte[32] : store.getCanonicalByNumber(lastJustified).getHash(), Sign.aggSigns(new byte[][] {Sign.sign(block.getEncoded(), pubKey)}) ); block.setAttestations(attestationRecords); logger.info("New block created {}", block); return block; }

Target:
public Beacon createNewBlock(Input in, byte[] pubKey) { Beacon block = new Beacon(in.parent.getHash(), randaoReveal(in.state, pubKey), in.mainChainRef, HashUtil.EMPTY_DATA_HASH, in.slotNumber, Collections.emptyList()); BeaconState newState = stateTransition.applyBlock(block, in.state); block.setStateHash(newState.getHash()); logger.info("New block created {}", block); return block; }
Source:
private void printCollectedOutput() { if (outputCollector == null) { return; } try { String line = outputCollector.toString(); if (line.isEmpty()) { return; } String[] lines = line.split("\\R", 0); int max = connection.size().getHeight(); int currentLines = 0; int allLines = 0; while (allLines < lines.length) { if (currentLines > max - 2) { try { connection.write(ANSI.CURSOR_SAVE); int percentage = (allLines * 100) / lines.length; connection.write("--More(" + percentage + "%)--"); Key k = readKey(); connection.write(ANSI.CURSOR_RESTORE); connection.stdoutHandler().accept(ANSI.ERASE_LINE_FROM_CURSOR); if (k == null) { allLines = lines.length; } else { switch (k) { case SPACE: { currentLines = 0; break; } case DOWN: case ENTER: case CTRL_M: { currentLines -= 1; break; } case Q: case q: { allLines = lines.length; resetPrompt(); break; } } } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new RuntimeException(ex); } catch (IOException ex) { throw new RuntimeException(ex); } } else { String l = lines[allLines]; currentLines += 1; allLines += 1; if (allLines == lines.length) { if (l.isEmpty()) { continue; } } connection.write(l + Config.getLineSeparator()); } } } finally { outputCollector = null; } }

Target:
private void printCollectedOutput() { if (outputCollector == null) { return; } try { String line = outputCollector.toString(); if (line.isEmpty()) { return; } String[] lines = line.split("\\R", -1); int max = connection.size().getHeight(); int currentLines = 0; int allLines = 0; while (allLines < lines.length) { if (currentLines > max - 2) { try { connection.write(ANSI.CURSOR_SAVE); int percentage = (allLines * 100) / lines.length; connection.write("--More(" + percentage + "%)--"); Key k = readKey(); connection.write(ANSI.CURSOR_RESTORE); connection.stdoutHandler().accept(ANSI.ERASE_LINE_FROM_CURSOR); if (k == null) { allLines = lines.length; } else { switch (k) { case SPACE: { currentLines = 0; break; } case DOWN: case ENTER: case CTRL_M: { currentLines -= 1; break; } case Q: case q: { allLines = lines.length; break; } } } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new RuntimeException(ex); } catch (IOException ex) { throw new RuntimeException(ex); } } else { String l = lines[allLines]; currentLines += 1; allLines += 1; if (allLines == lines.length) { if (l.isEmpty()) { continue; } } connection.write(l + Config.getLineSeparator()); } } } finally { outputCollector = null; } }
Source:
public String getEmbedMapID(){ String mapID = mapFrame.getAttribute("data-mapid"); return mapID; }

Target:
public String getEmbedMapID() { return mapFrame.getAttribute("data-mapid"); }
Source:
public static void updateDatabase() throws SQLException { DataSource dataSource = getDataSource(); try(Connection connection = dataSource.getConnection()) { updateDatabase(dataSource, connection); } }

Target:
public static synchronized void updateDatabase() throws SQLException { DataSource dataSource = getDataSource(); try(Connection connection = dataSource.getConnection()) { updateDatabase(dataSource, connection); } }
Source:
private Query readTextQuery(BinaryRawReader reader) { boolean loc = reader.readBoolean(); String txt = reader.readString(); String typ = reader.readString(); final int limit = reader.readInt(); final int pageSize = reader.readInt(); return new TextQuery(typ, txt, limit).setPageSize(pageSize).setLocal(loc); }

Target:
private Query readTextQuery(BinaryRawReader reader) { boolean loc = reader.readBoolean(); String txt = reader.readString(); String typ = reader.readString(); final int pageSize = reader.readInt(); return new TextQuery(typ, txt).setPageSize(pageSize).setLocal(loc); }
Source:
protected VarDeclaration parseVarDeclaration() throws TypeImportException, XMLStreamException { VarDeclaration v = LibraryElementFactory.eINSTANCE.createVarDeclaration(); readNameCommentAttributes(v); String typeName = getAttributeValue(LibraryElementTags.TYPE_ATTRIBUTE); if (typeName != null) { DataType dataType = DataTypeLibrary.getInstance().getType(typeName); v.setTypeName(typeName); if (dataType != null) { v.setType(dataType); } } else { throw new TypeImportException(Messages.Import_ERROR_InputVariableTypeNotDefined); } String arraySize = getAttributeValue(LibraryElementTags.ARRAYSIZE_ATTRIBUTE); if (arraySize != null) { try { v.setArraySize(Integer.parseInt(arraySize)); } catch (NumberFormatException nfe) { throw new TypeImportException(Messages.Import_ERROR_Arraysize_NumberFormat); } } else { v.setArraySize(-1); } String initialValue = getAttributeValue(LibraryElementTags.INITIALVALUE_ATTRIBUTE); if (initialValue != null) { Value varInitialization = LibraryElementFactory.eINSTANCE.createValue(); varInitialization.setValue(initialValue); v.setValue(varInitialization); } proceedToEndElementNamed(LibraryElementTags.VAR_DECLARATION_ELEMENT); return v; }

Target:
protected VarDeclaration parseVarDeclaration() throws TypeImportException, XMLStreamException { VarDeclaration v = LibraryElementFactory.eINSTANCE.createVarDeclaration(); readNameCommentAttributes(v); String typeName = getAttributeValue(LibraryElementTags.TYPE_ATTRIBUTE); if (null != typeName) { DataType dataType = DataTypeLibrary.getInstance().getType(typeName); v.setTypeName(typeName); if (dataType != null) { v.setType(dataType); } } else { throw new TypeImportException(Messages.Import_ERROR_InputVariableTypeNotDefined); } String arraySize = getAttributeValue(LibraryElementTags.ARRAYSIZE_ATTRIBUTE); if (null != arraySize) { try { v.setArraySize(Integer.parseInt(arraySize)); } catch (NumberFormatException nfe) { throw new TypeImportException(Messages.Import_ERROR_ArraySize_NumberFormat); } } else { v.setArraySize(-1); } String initialValue = getAttributeValue(LibraryElementTags.INITIALVALUE_ATTRIBUTE); if (null != initialValue) { Value varInitialization = LibraryElementFactory.eINSTANCE.createValue(); varInitialization.setValue(initialValue); v.setValue(varInitialization); } proceedToEndElementNamed(LibraryElementTags.VAR_DECLARATION_ELEMENT); return v; }