auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private KubernetesClient create(Config config) throws InfrastructureException { OkHttpClient clientHttpClient = httpClient.newBuilder().authenticator(Authenticator.NONE).build(); OkHttpClient.Builder builder = clientHttpClient.newBuilder(); builder.interceptors().clear(); clientHttpClient = builder .addInterceptor( new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); if (isNotNullOrEmpty(config.getUsername()) && isNotNullOrEmpty(config.getPassword())) { Request authReq = chain .request() .newBuilder() .addHeader( "Authorization", Credentials.basic(config.getUsername(), config.getPassword())) .build(); return chain.proceed(authReq); } else if (isNotNullOrEmpty(config.getOauthToken())) { Request authReq = chain .request() .newBuilder() .addHeader("Authorization", "Bearer " + config.getOauthToken()) .build(); return chain.proceed(authReq); } return chain.proceed(request); } }) .build(); return new UnclosableKubernetesClient(clientHttpClient, config); }

Target:
private KubernetesClient create(Config config) throws InfrastructureException { OkHttpClient clientHttpClient = httpClient.newBuilder().authenticator(Authenticator.NONE).build(); OkHttpClient.Builder builder = clientHttpClient.newBuilder(); builder.interceptors().clear(); clientHttpClient = builder.addInterceptor(buildKubernetesInterceptor(config)).build(); return new UnclosableKubernetesClient(clientHttpClient, config); }
Source:
private void rSyntaxTextAreaKeyReleased(java.awt.event.KeyEvent evt) { getEditorState().setDirty(true); getEditorState().setModified(true); }

Target:
private void rSyntaxTextAreaKeyReleased(java.awt.event.KeyEvent evt) { editorState.setDirty(true); editorState.setModified(true); }
Source:
public Optional<ColumnMapper<?>> build(QualifiedType<?> type, ConfigRegistry config) { return maps(mapper, config).equals(type) ? Optional.of(mapper) : Optional.empty(); }

Target:
public Optional<ColumnMapper<?>> build(QualifiedType<?> type, ConfigRegistry config) { return maps.equals(type) ? Optional.of(mapper) : Optional.empty(); }
Source:
public ColorPickerEditor(Composite parent, int style, int defaultColor) { this(parent, style); doSetColor(defaultColor); }

Target:
public ColorPickerEditor(Composite parent, int style, int defaultColor) { this(parent, style); this.defaultColor = defaultColor; doSetColor(defaultColor); }
Source:
private Filter<?>[] getIncludeAndExcludeFilters() { List<Filter<?>> filters = new ArrayList<>(); Optional<List<String>> includes = getGroupOrTags(getPropertiesList(INCLUDE_GROUPS), getPropertiesList(INCLUDE_TAGS)); if (includes.isPresent()) { filters.add(TagFilter.includeTags(includes.get())); } Optional<List<String>> excludes = getGroupOrTags(getPropertiesList(EXCLUDE_GROUPS), getPropertiesList(EXCLUDE_TAGS)); if (excludes.isPresent()) { filters.add(TagFilter.excludeTags(excludes.get())); } return filters.toArray(new Filter<?>[0]); }

Target:
private Filter<?>[] getIncludeAndExcludeFilters() { List<Filter<?>> filters = new ArrayList<>(); Optional<List<String>> includes = getGroupsOrTags(getPropertiesList(INCLUDE_GROUPS), getPropertiesList(INCLUDE_TAGS)); if (includes.isPresent()) { filters.add(TagFilter.includeTags(includes.get())); } Optional<List<String>> excludes = getGroupsOrTags(getPropertiesList(EXCLUDE_GROUPS), getPropertiesList(EXCLUDE_TAGS)); if (excludes.isPresent()) { filters.add(TagFilter.excludeTags(excludes.get())); } return filters.toArray(new Filter<?>[filters.size()]); }
Source:
public static String publicBodyLink(String publicBodyId){ return UriBuilder.fromPath("<LINK_0>").path(publicBodyId).build().toString(); }

Target:
public static String publicBodyLink(String publicBodyId){ return new LinkValue("public-body", publicBodyId).link(); }
Source:
Map<String, FixedLengthAudioStream> getMultiTimeStreams() { return multiTimeStreams; }

Target:
Map<String, FixedLengthAudioStream> getMultiTimeStreams() { return Collections.unmodifiableMap(multiTimeStreams); }
Source:
public UnsupportedFilterException(List<FilterSupportStatus> filterSupportStatuses) { super(String.format( "Unsupported filters encountered: %s", STATUS_JOINER.join(filterSupportStatuses))); this.filterSupportStatuses = filterSupportStatuses; }

Target:
public UnsupportedFilterException(List<FilterSupportStatus> filterSupportStatuses) { super(String.format( "Unsupported filters encountered: %s", STATUS_JOINER.join(filterSupportStatuses))); Preconditions.checkArgument( !filterSupportStatuses.isEmpty(), "Unsupported statuses should not be empty."); this.filterSupportStatuses = filterSupportStatuses; }
Source:
private ExtMap processAuthnResult(ExtMap outMap, String operation) { if (outMap.<Integer> get(Base.InvokeKeys.RESULT) != Base.InvokeResult.SUCCESS) { throw new RuntimeException( String.format( "Base.InvokeResult code is: %1$s. Invocation of %2$s failed.", outMap.<Integer> get(Base.InvokeKeys.RESULT), operation ) ); } logger.info(String.format("Successful invocation of %1$s", operation)); if (outMap.<Integer> get(Authn.InvokeKeys.RESULT) != Authn.AuthResult.SUCCESS) { throw new RuntimeException( String.format( "Authn.Result code is: %1$s", outMap.<Integer> get(Authn.InvokeKeys.RESULT) ) ); } logger.info("AuthnRecord: {}", outMap.get(Authn.InvokeKeys.AUTH_RECORD)); return outMap.get(Authn.InvokeKeys.AUTH_RECORD); }

Target:
private ExtMap processAuthnResult(ExtMap outMap, String operation) { if (outMap.<Integer> get(Base.InvokeKeys.RESULT) != Base.InvokeResult.SUCCESS) { throw new RuntimeException( String.format( "Base.InvokeResult code is: %1$s. Invocation of %2$s failed.", outMap.<Integer> get(Base.InvokeKeys.RESULT), operation ) ); } log.info("Successful invocation of {}", operation); if (outMap.<Integer> get(Authn.InvokeKeys.RESULT) != Authn.AuthResult.SUCCESS) { throw new RuntimeException( String.format( "Authn.Result code is: %1$s", outMap.<Integer> get(Authn.InvokeKeys.RESULT) ) ); } log.info("AuthnRecord: {}", outMap.get(Authn.InvokeKeys.AUTH_RECORD)); return outMap.get(Authn.InvokeKeys.AUTH_RECORD); }
Source:
private int generateNumOfChoicesForStudentsExcludingSelf(String courseId) { List<StudentAttributes> copyOfStudentList = StudentsLogic.inst().getStudentsForCourse(courseId); return copyOfStudentList.size() - 1; }

Target:
private int generateNumOfChoicesForStudentsExcludingSelf(String courseId) { List<StudentAttributes> studentList = StudentsLogic.inst().getStudentsForCourse(courseId); return studentList.size() - 1; }
Source:
public EList<IBuildPlan> getPlanAndAllChildren() { return new BasicEList<IBuildPlan>( Stream.concat(Stream.of(this), getChildren().stream().flatMap(IBuildPlan::flattened)) .collect(Collectors.toList())); }

Target:
public List<IBuildPlan> getPlanAndAllChildren() { return Stream.concat(Stream.of(this), getChildren().stream().flatMap(IBuildPlan::flattened)) .collect(Collectors.toList()); }
Source:
private SingularityLoadBalancerUpdate sendRequestWrapper(LoadBalancerRequestId loadBalancerRequestId, LoadBalancerMethod method, Request request, BaragonRequestState onFailure) { final long start = System.currentTimeMillis(); final LoadBalancerUpdateHolder result = sendRequest(loadBalancerRequestId, request, onFailure); if ((method != LoadBalancerMethod.CHECK_STATE && method != LoadBalancerMethod.PRE_ENQUEUE) && result.state == BaragonRequestState.FAILED && result.message.orElse("").contains("is already enqueued with different parameters")) { LOG.info("Baragon request already in the queue, will fetch current state instead", loadBalancerRequestId.getId()); return sendRequestWrapper(loadBalancerRequestId, LoadBalancerMethod.CHECK_STATE, request, onFailure); } LOG.debug("LB request had result after {}", request.getMethod(), loadBalancerRequestId, result, JavaUtils.duration(start)); return new SingularityLoadBalancerUpdate(result.state, loadBalancerRequestId, result.message, start, method, Optional.of(request.getUrl())); }

Target:
private SingularityLoadBalancerUpdate sendRequestWrapper(LoadBalancerRequestId loadBalancerRequestId, LoadBalancerMethod method, Request request, BaragonRequestState onFailure) { final long start = System.currentTimeMillis(); final LoadBalancerUpdateHolder result = sendRequest(loadBalancerRequestId, request, onFailure); if ((method != LoadBalancerMethod.CHECK_STATE && method != LoadBalancerMethod.PRE_ENQUEUE) && result.state == BaragonRequestState.FAILED && result.message.orElse("").contains(ALREADY_ENQUEUED_ERROR)) { LOG.info("Baragon request already in the queue, will fetch current state instead", loadBalancerRequestId.getId()); return sendRequestWrapper(loadBalancerRequestId, LoadBalancerMethod.CHECK_STATE, request, onFailure); } LOG.debug("LB request had result after {}", request.getMethod(), loadBalancerRequestId, result, JavaUtils.duration(start)); return new SingularityLoadBalancerUpdate(result.state, loadBalancerRequestId, result.message, start, method, Optional.of(request.getUrl())); }
Source:
public Response totpKeyGenLocal(@Context HttpServletRequest request) { TOTPManager totpManager = (TOTPManager) PrivilegedCarbonContext.getThreadLocalCarbonContext().getOSGiService (TOTPManager.class); if (totpManager != null) { String username = request.getParameter("username"); TOTPDTO totpdto = null; try { totpdto = totpManager.generateTOTPKeyLocal(username); String json = createJsonPayload(totpdto.getSecretkey(), totpdto.getQRCodeURL()); return Response.ok(json, MediaType.APPLICATION_JSON_TYPE).build(); } catch (TOTPException e) { log.error("TOTPKeyGenerator endpoint could not generate keys for local user", e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Error when generating the key") .type(MediaType.APPLICATION_JSON_TYPE).build(); } } else { log.error("TOTPKeyGenerator endpoint could not generate keys for local user"); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Error when generating the key") .type(MediaType.APPLICATION_JSON_TYPE).build(); } }

Target:
public Response totpKeyGenLocal(@Context HttpServletRequest request) { TOTPManager totpManager = (TOTPManager) PrivilegedCarbonContext.getThreadLocalCarbonContext().getOSGiService (TOTPManager.class); if (totpManager != null) { String username = CharacterEncoder.getSafeText(request.getParameter("username")); TOTPDTO totpdto = null; try { totpdto = totpManager.generateTOTPKeyLocal(username); String json = createJsonPayload(totpdto.getSecretkey(), totpdto.getQRCodeURL()); return Response.ok(json, MediaType.APPLICATION_JSON_TYPE).build(); } catch (TOTPException e) { log.error("TOTPKeyGenerator endpoint could not generate keys for local user", e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Error when generating the key") .type(MediaType.APPLICATION_JSON_TYPE).build(); } } else { log.error("TOTPKeyGenerator endpoint could not generate keys for local user"); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Error when generating the key") .type(MediaType.APPLICATION_JSON_TYPE).build(); } }
Source:
public static String getRateLimiterImpl() { return rateLimiterImpl; }

Target:
public String getRateLimiterImpl() { if (rateLimiterImpl == null) { return System.getProperty("zookeeper." + RateLimiter.RATE_LIMITER_IMPL); } return rateLimiterImpl; }
Source:
public void validate() { if (reaperWakeUpInterval < 0) throw new CacheConfigurationException("reaperWakeUpInterval must be > 0, we got " + reaperWakeUpInterval); if (completedTxTimeout < 0) throw new CacheConfigurationException("completedTxTimeout must be > 0, we got " + reaperWakeUpInterval); if(transactionProtocol == TransactionProtocol.TOTAL_ORDER) { if(transactionMode == TransactionMode.NON_TRANSACTIONAL) { throw new ConfigurationException("Total Order based protocol needs a transactional cache"); } if(!clustering().cacheMode().isReplicated() && !clustering().cacheMode().isDistributed()) { throw new ConfigurationException(clustering().cacheMode().friendlyCacheModeString() + " is not supported by Total Order based protocol"); } if (recovery.create().enabled()) { throw new ConfigurationException("Total Order based protocol not available with recovery"); } } }

Target:
public void validate() { if (reaperWakeUpInterval < 0) throw new CacheConfigurationException("reaperWakeUpInterval must be > 0, we got " + reaperWakeUpInterval); if (completedTxTimeout < 0) throw new CacheConfigurationException("completedTxTimeout must be > 0, we got " + reaperWakeUpInterval); if(transactionProtocol == TransactionProtocol.TOTAL_ORDER) { if(transactionMode != TransactionMode.TRANSACTIONAL) { throw new ConfigurationException("Total Order based protocol not available in " + transactionMode +" cache"); } if(!clustering().cacheMode().isReplicated() && !clustering().cacheMode().isDistributed()) { throw new ConfigurationException(clustering().cacheMode().friendlyCacheModeString() + " is not supported by Total Order based protocol"); } if (recovery.create().enabled()) { throw new ConfigurationException("Total Order based protocol not available with recovery"); } if (lockingMode != LockingMode.OPTIMISTIC) { throw new ConfigurationException("Total Order based protocol not available with " + lockingMode); } } }
Source:
public OvirtBreadCrumbsView(MainModelProvider<T, M> listModelProvider, MenuDetailsProvider menuDetailsProvider) { this.menuDetailsProvider = menuDetailsProvider; initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); this.listModelProvider = listModelProvider; }

Target:
public OvirtBreadCrumbsView(MainModelProvider<T, M> listModelProvider, MenuDetailsProvider menuDetailsProvider) { this.menuDetailsProvider = menuDetailsProvider; this.listModelProvider = listModelProvider; initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); }
Source:
public MzDBRawDataFile execute() throws MSDKException { Iterator<Spectrum> spectrumIterator; Spectrum eachSpectrum; SpectrumHeader eachSpectrumHeader; List<MsScan> msScanList = new ArrayList<>(); List<String> msFunctions = new ArrayList<>(); List<Chromatogram> chromatograms = new ArrayList<>(); SpectrumData eachSpectrumData; int scanNumber = 1; float eachSpectrumTime; try { MzDbReader currentFile = new MzDbReader(mzDBFile, cacheEntities); try { spectrumIterator = currentFile.getSpectrumIterator(); while (spectrumIterator.hasNext()) { eachSpectrum = spectrumIterator.next(); eachSpectrumHeader = eachSpectrum.getHeader(); eachSpectrumData = eachSpectrum.getData(); double mzList[] = eachSpectrumData.getMzList(); float intensityList[] = eachSpectrumData.getIntensityList(); SimpleMsScan eachSimpleMsScan = new SimpleMsScan(scanNumber); eachSimpleMsScan.setDataPoints(mzList, intensityList, mzList.length); msScanList.add(eachSimpleMsScan); scanNumber++; } } catch (StreamCorruptedException e) { throw new MSDKException("Stream corrupted, detected by mzDB"); } } catch (ClassNotFoundException e) { throw new MSDKException("Class can't be found by mzDB"); } catch (FileNotFoundException e) { throw new MSDKException("File Not Found / File present but inaccessible by mzDB"); } catch (SQLiteException e) { throw new MSDKException("SQLite Exception in mzDB"); } msFunctions.add("ms"); MzDBRawDataFile newRawFile = new MzDBRawDataFile(mzDBFile, msFunctions, msScanList, chromatograms); return newRawFile; }

Target:
public MzDBRawDataFile execute() throws MSDKException { Iterator<Spectrum> spectrumIterator; Spectrum eachSpectrum; SpectrumHeader eachSpectrumHeader; List<MsScan> msScanList = new ArrayList<>(); List<String> msFunctions = new ArrayList<>(); List<Chromatogram> chromatograms = new ArrayList<>(); SpectrumData eachSpectrumData; int scanNumber = 1; float eachSpectrumTime; try { MzDbReader currentFile = new MzDbReader(mzDBFile, cacheEntities); try { spectrumIterator = currentFile.getSpectrumIterator(); while (spectrumIterator.hasNext()) { eachSpectrum = spectrumIterator.next(); eachSpectrumHeader = eachSpectrum.getHeader(); eachSpectrumData = eachSpectrum.getData(); double mzList[] = eachSpectrumData.getMzList(); float intensityList[] = eachSpectrumData.getIntensityList(); SimpleMsScan eachSimpleMsScan = new SimpleMsScan(scanNumber); eachSimpleMsScan.setDataPoints(mzList, intensityList, mzList.length); msScanList.add(eachSimpleMsScan); scanNumber++; } } catch (StreamCorruptedException e) { throw new MSDKException("Stream corrupted, detected by mzDB", e); } } catch (ClassNotFoundException e) { throw new MSDKException("Class can't be found by mzDB", e); } catch (FileNotFoundException e) { throw new MSDKException("File Not Found / File present but inaccessible by mzDB", e); } catch (SQLiteException e) { throw new MSDKException("SQLite Exception in mzDB", e); } msFunctions.add("ms"); MzDBRawDataFile newRawFile = new MzDBRawDataFile(mzDBFile, msFunctions, msScanList, chromatograms); return newRawFile; }
Source:
public void goToCorrectStart(RandomAccessFile rafile) throws IOException { if (rafile.readLine().startsWith("{\"data\":")) { rafile.seek(0); int data = 0; for (int nbBracket = 0; nbBracket < 2; nbBracket++) { data = rafile.read(); while (data != '[') { data = rafile.read(); if (data == -1) { return; } } } } else { rafile.seek(0); } }

Target:
public void goToCorrectStart(RandomAccessFile rafile) throws IOException { StringBuilder sb = new StringBuilder(); int val = rafile.read(); Set<Integer> skipList = new HashSet<>(); skipList.add((int) ':'); skipList.add((int) '\t'); skipList.add((int) '\n'); skipList.add((int) '\r'); skipList.add((int) ' '); skipList.add((int) '\b'); skipList.add((int) '\f'); while (val != -1 && val != ':' && sb.length() < 46) { if (!skipList.contains(val)) { sb.append((char) val); } val = rafile.read(); } if (sb.toString().startsWith("{\"data\"")) { int data = 0; for (int nbBracket = 0; nbBracket < 2 && data != -1; nbBracket++) { data = rafile.read(); while (data != '[' && data != -1) { data = rafile.read(); } } } else { rafile.seek(0); } }
Source:
public int execute() throws HiveException { List<String> databases = null; if (ddlDesc.getPattern() != null) { LOG.debug("pattern: {}", ddlDesc.getPattern()); databases = db.getDatabasesByPattern(ddlDesc.getPattern()); } else { databases = db.getAllDatabases(); } LOG.info("Found database(s) matching the SHOW DATABASES statement.", databases.size()); DataOutputStream outStream = getOutputStream(ddlDesc.getResFile()); try { formatter.showDatabases(outStream, databases); } catch (Exception e) { throw new HiveException(e, ErrorMsg.GENERIC_ERROR, "show databases"); } finally { IOUtils.closeStream(outStream); } return 0; }

Target:
public int execute() throws HiveException { List<String> databases = null; if (desc.getPattern() != null) { LOG.debug("pattern: {}", desc.getPattern()); databases = context.getDb().getDatabasesByPattern(desc.getPattern()); } else { databases = context.getDb().getAllDatabases(); } LOG.info("Found database(s) matching the SHOW DATABASES statement.", databases.size()); DataOutputStream outStream = getOutputStream(new Path(desc.getResFile())); try { context.getFormatter().showDatabases(outStream, databases); } catch (Exception e) { throw new HiveException(e, ErrorMsg.GENERIC_ERROR, "show databases"); } finally { IOUtils.closeStream(outStream); } return 0; }
Source:
public void visit(ModuleBuild moduleBuild) { SortedMap<String, Meter> meters = metricRegistry.getMeters(); meters.get(moduleBuild.getClass().getName() + "." + moduleBuild.getState().toString().toLowerCase()).mark(); }

Target:
public void visit(ModuleBuild moduleBuild) { SortedMap<String, Meter> meters = metricRegistry.getMeters(); meters.get(makeMetricName(ModuleBuild.class, moduleBuild.getState())).mark(); }
Source:
private boolean isNetworkUp(long accountId) { Service networkDriverService = null; List<Service> networkDriverServices = objectManager.find(Service.class, SERVICE.ACCOUNT_ID, accountId, SERVICE.REMOVED, null, SERVICE.KIND, ServiceConstants.KIND_NETWORK_DRIVER_SERVICE); for(Service service : networkDriverServices) { if(invalidStates.contains(service.getState())) { continue; } else { networkDriverService = service; } } if (networkDriverService == null) { return true; } List<Service> services = objectManager.find(Service.class, SERVICE.ACCOUNT_ID, accountId, SERVICE.REMOVED, null, SERVICE.STACK_ID, networkDriverService.getStackId()); for (Service service : services) { if (!(service.getState().equals(CommonStatesConstants.ACTIVE) && service.getHealthState().equals(HealthcheckConstants.HEALTH_STATE_HEALTHY))) { return false; } } return true; }

Target:
private boolean isNetworkUp(long accountId) { Service networkDriverService = null; List<Service> networkDriverServices = objectManager.find(Service.class, SERVICE.ACCOUNT_ID, accountId, SERVICE.REMOVED, null, SERVICE.KIND, ServiceConstants.KIND_NETWORK_DRIVER_SERVICE); for(Service service : networkDriverServices) { if(invalidStates.contains(service.getState())) { continue; } networkDriverService = service; } if (networkDriverService == null) { return true; } List<Service> services = objectManager.find(Service.class, SERVICE.ACCOUNT_ID, accountId, SERVICE.REMOVED, null, SERVICE.STACK_ID, networkDriverService.getStackId()); for (Service service : services) { if (!(service.getState().equals(CommonStatesConstants.ACTIVE) && service.getHealthState().equals(HealthcheckConstants.HEALTH_STATE_HEALTHY))) { return false; } } return true; }
Source:
public Observable<String> getTextForBadge(EvaluationContext ec) { if (display.getBadgeText() == null) { return Observable.just(""); } return Observable.just(display.getBadgeText().evaluate(ec)) .subscribeOn(Schedulers.computation()); }

Target:
public Observable<String> getTextForBadge(EvaluationContext ec) { if (display.getBadgeText() == null) { return Observable.just(""); } return Observable.just(display.getBadgeText().evaluate(ec)); }
Source:
private BlobServiceVersion fromClientVersion(String version) { return Arrays.stream(BlobServiceVersion.values()) .filter(en -> Objects.equals(en.getVersion(), version)) .findFirst() .orElseGet(BlobServiceVersion::getLatest); }

Target:
private static BlobServiceVersion fromClientVersion(String version) { return Arrays.stream(BlobServiceVersion.values()) .filter(en -> Objects.equals(en.getVersion(), version)) .findFirst() .orElseGet(BlobServiceVersion::getLatest); }
Source:
public static AnyValue convert( Iterable<Notification> notifications ) { List<AnyValue> out = new ArrayList<>(); for ( Notification notification : notifications ) { MapValueBuilder builder = new MapValueBuilder(); builder.add( "code", stringValue( notification.getCode() ) ); builder.add( "title", stringValue( notification.getTitle() ) ); builder.add( "description", stringValue( notification.getDescription() ) ); builder.add( "severity", stringValue( notification.getSeverity().toString() ) ); InputPosition pos = notification.getPosition(); boolean includePosition = !pos.equals( InputPosition.empty ); if ( includePosition ) { builder.add( "position", VirtualValues.map( new String[]{"offset", "line", "column"}, new AnyValue[]{ intValue( pos.getOffset() ), intValue( pos.getLine() ), intValue( pos.getColumn() ) } ) ); } out.add( builder.build() ); } return VirtualValues.fromList( out ); }

Target:
public static AnyValue convert( Iterable<Notification> notifications ) { List<AnyValue> out = new ArrayList<>(); for ( Notification notification : notifications ) { InputPosition pos = notification.getPosition(); boolean includePosition = !pos.equals( InputPosition.empty ); int size = includePosition ? 5 : 4; MapValueBuilder builder = new MapValueBuilder( size ); builder.add( "code", stringValue( notification.getCode() ) ); builder.add( "title", stringValue( notification.getTitle() ) ); builder.add( "description", stringValue( notification.getDescription() ) ); builder.add( "severity", stringValue( notification.getSeverity().toString() ) ); if ( includePosition ) { builder.add( "position", VirtualValues.map( new String[]{"offset", "line", "column"}, new AnyValue[]{ intValue( pos.getOffset() ), intValue( pos.getLine() ), intValue( pos.getColumn() ) } ) ); } out.add( builder.build() ); } return VirtualValues.fromList( out ); }
Source:
public boolean createNewFile(File lock) throws IOException { if (!lock.createNewFile()) { return false; } if (supportsAtomicCreateNewFile() || !supportsUnixNLink) { return true; } Path lockPath = lock.toPath(); Path link = null; try { link = Files.createLink( Paths.get(lock.getAbsolutePath() + ".lnk"), lockPath); Integer nlink = (Integer) (Files.getAttribute(lockPath, "unix:nlink")); if (nlink > 2) { LOG.warn("nlink of link to lock file was not 2 but {}", lock.getPath(), nlink); return false; } else if (nlink < 2) { supportsUnixNLink = false; } return true; } catch (UnsupportedOperationException | IllegalArgumentException e) { supportsUnixNLink = false; return true; } finally { if (link != null) Files.delete(link); } }

Target:
public boolean createNewFile(File lock) throws IOException { if (!lock.createNewFile()) { return false; } if (supportsAtomicCreateNewFile() || !supportsUnixNLink) { return true; } Path lockPath = lock.toPath(); Path link = null; try { link = Files.createLink( Paths.get(lock.getAbsolutePath() + ".lnk"), lockPath); Integer nlink = (Integer) (Files.getAttribute(lockPath, "unix:nlink")); if (nlink > 2) { LOG.warn("nlink of link to lock file was not 2 but {}", lock.getPath(), nlink); return false; } else if (nlink < 2) { supportsUnixNLink = false; } return true; } catch (UnsupportedOperationException | IllegalArgumentException e) { supportsUnixNLink = false; return true; } finally { if (link != null) { Files.delete(link); } } }
Source:
private void interpolateBoundaryRange(long x1, long x2, Record record) { for (int i = 0; i < groupByTwoPointFunctionCount; i++) { GroupByFunction function = groupByTwoPointFunctions.getQuick(i); MapValue startValue = findDataMapValue2(record, x1); MapValue endValue = findDataMapValue3(record, x2); InterpolationUtil.INTERPOLATE_BOUNDARY.interpolateBoundaryAndStore(function, sampler.nextTimestamp(x1), startValue, endValue, true); InterpolationUtil.INTERPOLATE_BOUNDARY.interpolateBoundaryAndStore(function, x2, startValue, endValue, false); } }

Target:
private void interpolateBoundaryRange(long x1, long x2, Record record) { for (int i = 0; i < groupByTwoPointFunctionCount; i++) { GroupByFunction function = groupByTwoPointFunctions.getQuick(i); MapValue startValue = findDataMapValue2(record, x1); MapValue endValue = findDataMapValue3(record, x2); InterpolationUtil.interpolateBoundary(function, sampler.nextTimestamp(x1), startValue, endValue, true); InterpolationUtil.interpolateBoundary(function, x2, startValue, endValue, false); } }
Source:
protected ArtifactStore removeArtifactStoreInternal( StoreKey key ) { String json = stores.getCache().remove( key.toString() ); return readValueByJson( json, key ); }

Target:
protected ArtifactStore removeArtifactStoreInternal( StoreKey key ) { String json = stores.executeCache( ( c ) -> c.remove( key ) ); return readValueByJson( json, key ); }
Source:
private void onRemove() { ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } model.startProgress(); AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery<>(StoragePools -> { if (StoragePools != null && !StoragePools.isEmpty()) { StoragePool StoragePool = StoragePools.get(0); List<ActionParametersBase> prms = getSelectedItems() .stream() .map(item -> new VmTemplateImportExportParameters(item.getId(), getEntity().getId(), StoragePool.getId())) .collect(Collectors.toList()); Frontend.getInstance().runMultipleAction(ActionType.RemoveUnregisteredVmTemplate, prms, result -> { ConfirmationModel localModel = (ConfirmationModel) result.getState(); localModel.stopProgress(); cancel(); }, model); } }), getEntity().getId()); }

Target:
private void onRemove() { ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } model.startProgress(); AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery<>(storagePools -> { if (storagePools != null && !storagePools.isEmpty()) { StoragePool storagePool = storagePools.get(0); List<ActionParametersBase> prms = getSelectedItems() .stream() .map(item -> new VmTemplateImportExportParameters(item.getId(), getEntity().getId(), storagePool.getId())) .collect(Collectors.toList()); Frontend.getInstance().runMultipleAction(ActionType.RemoveUnregisteredVmTemplate, prms, result -> { ConfirmationModel localModel = (ConfirmationModel) result.getState(); localModel.stopProgress(); cancel(); }, model); } }), getEntity().getId()); }
Source:
public static List<Object[]> data() { return Arrays.asList( new Object[][]{{SimpleOperationTracker.class.getSimpleName(), false}, {SimpleOperationTracker.class.getSimpleName(), true}, {AdaptiveOperationTracker.class.getSimpleName(), false}, {AdaptiveOperationTracker.class.getSimpleName(), true}}); }

Target:
public static List<Object[]> data() { return Arrays.asList( new Object[][]{{SimpleOperationTracker.class.getSimpleName(), false}, {AdaptiveOperationTracker.class.getSimpleName(), false}, {AdaptiveOperationTracker.class.getSimpleName(), true}}); }
Source:
public Match(Column<String> column, String prefix, String suffix) { super(String.format("LIKE CONCAT('%s', %s, '%s')", prefix, column.getSqlKeyword(), suffix)); Preconditions.checkNotNull(column); }

Target:
public Match(Column<String> column, String prefix, String suffix) { super(String.format("LIKE CONCAT(CONCAT('%s', %s), '%s')", prefix, Preconditions.checkNotNull(column).getSqlKeyword(), suffix)); }
Source:
public void refreshPeerLeadersForAllPartitions() { rwLock.readLock().lock(); try { for (Map.Entry<String, Set<ReplicaId>> entry : peerLeaderReplicasByPartition.entrySet()) { String partitionName = entry.getKey(); ReplicaId localLeaderReplica = storeManager.getReplica(partitionName); PartitionId partition = localLeaderReplica.getPartitionId(); Set<ReplicaId> previousRemoteLeaderReplicas = entry.getValue(); Set<ReplicaId> currentRemoteLeaderReplicas = new HashSet<>(partition.getReplicaIdsByState(ReplicaState.LEADER, null)); currentRemoteLeaderReplicas.remove(localLeaderReplica); if (!previousRemoteLeaderReplicas.equals(currentRemoteLeaderReplicas)) { peerLeaderReplicasByPartition.put(partitionName, currentRemoteLeaderReplicas); } } } finally { rwLock.readLock().unlock(); } }

Target:
public void refreshPeerLeadersForAllPartitions() { rwLock.writeLock().lock(); try { for (Map.Entry<String, Set<ReplicaId>> entry : peerLeaderReplicasByPartition.entrySet()) { String partitionName = entry.getKey(); ReplicaId localLeaderReplica = storeManager.getReplica(partitionName); PartitionId partition = localLeaderReplica.getPartitionId(); Set<ReplicaId> previousRemoteLeaderReplicas = entry.getValue(); Set<ReplicaId> currentRemoteLeaderReplicas = new HashSet<>(partition.getReplicaIdsByState(ReplicaState.LEADER, null)); currentRemoteLeaderReplicas.remove(localLeaderReplica); if (!previousRemoteLeaderReplicas.equals(currentRemoteLeaderReplicas)) { peerLeaderReplicasByPartition.put(partitionName, currentRemoteLeaderReplicas); } } } finally { rwLock.writeLock().unlock(); } }
Source:
public void schedule_command_if_delay_is_set() { final CommandContext context = createCommandContext(DELAY); final Command cmd = Commands.create(createProject(newUuid()), context); scheduler.schedule(cmd); assertNull(postedCommand); sleep(DELAY_MS + CHECK_OFFSET_MS); assertEquals(cmd, postedCommand); }

Target:
public void schedule_command_if_delay_is_set() { final Command cmd = Commands.create(createProject(newUuid()), context); scheduler.schedule(cmd); verify(scheduler, never()).post(cmd); verify(scheduler, after(DELAY_MS).times(1)).post(cmd); }
Source:
private void poisonTable(Connection connection) throws SQLException { try (Statement statement = connection.createStatement()) { if (ConnectionDbTypes.getDbType(connection).equals(DBType.ORACLE)) { poisonOracleTable(connection, statement); } else { poisonPostgresTable(connection, statement); } } }

Target:
private void poisonTable(Connection connection) throws SQLException { try (Statement statement = connection.createStatement()) { if (ConnectionDbTypes.getDbType(connection) == DBType.ORACLE) { poisonOracleTable(connection, statement); } else { poisonPostgresTable(connection, statement); } } }
Source:
public Integer toValue(String string, INode node) throws ValueConverterException { if ("*".equals(string)) { return -1; } else { return Integer.valueOf(string); } }

Target:
public Integer toValue(String string, INode node) throws ValueConverterException { if (Ecl.ANY.equals(string)) { return -1; } else { return Integer.valueOf(string); } }
Source:
protected ConfigToolExecutionResult configToolInvocation(String... cli) { ConfigTool configTool = angela.tsa().configTool(getNode(1, 1)); if (!Arrays.asList(cli).contains("-t")) { String[] enhancedCli = new String[cli.length + 2]; enhancedCli[0] = "-t"; enhancedCli[1] = Measure.of(OPERATION_TIMEOUT.getSeconds(), TimeUnit.SECONDS).toString(); System.arraycopy(cli, 0, enhancedCli, 2, cli.length); return configTool.executeCommand(enhancedCli); } return configTool.executeCommand(cli); }

Target:
protected ConfigToolExecutionResult configToolInvocation(String... cli) { List<String> enhancedCli = new ArrayList<>(cli.length); List<String> configToolOptions = getConfigToolOptions(cli); boolean addedOptions = false; String timeout = Measure.of(getConnectionTimeout().getSeconds(), TimeUnit.SECONDS).toString(); if (!configToolOptions.contains("-t")) { enhancedCli.add("-t"); enhancedCli.add(timeout); addedOptions = true; } if (!configToolOptions.contains("-r")) { enhancedCli.add("-r"); enhancedCli.add(timeout); addedOptions = true; } String[] cmd; if (addedOptions) { enhancedCli.addAll(Arrays.asList(cli)); cmd = enhancedCli.toArray(new String[0]); } else { cmd = cli; } return angela.tsa().configTool(getNode(1, 1)).executeCommand(cmd); }
Source:
public void setUp() { this.collisionArea = Mockito.mock(CollisionMask.class); this.drawable = new EnemyFish(collisionArea, null, 0, 0); this.graphicsContext = PowerMockito.mock(GraphicsContext.class); Mockito.when(collisionArea.getRotation()).thenReturn(42D); Mockito.when(collisionArea.getCenterX()).thenReturn(69D); Mockito.when(collisionArea.getCenterY()).thenReturn(1024D); Mockito.when(collisionArea.getHeight()).thenReturn(22D); Mockito.when(collisionArea.getSize()).thenReturn(33D); Mockito.when(collisionArea.getBottomLeft()).thenReturn(new Vec2d(1, 1)); Mockito.when(collisionArea.getBottomRight()).thenReturn(new Vec2d(2, 2)); Mockito.when(collisionArea.getTopLeft()).thenReturn(new Vec2d(3, 3)); Mockito.when(collisionArea.getTopRight()).thenReturn(new Vec2d(4, 4)); HashSet<Vec2d> set = new HashSet<>(); set.add(new Vec2d()); set.add(new Vec2d(100,100)); set.add(new Vec2d(200,200)); Mockito.when(collisionArea.getMask()).thenReturn(set); }

Target:
public void setUp() { this.collisionArea = Mockito.mock(CollisionMask.class); this.drawable = new EnemyFish(collisionArea, null, 0, 0); this.graphicsContext = mock(GraphicsContext.class); when(collisionArea.getRotation()).thenReturn(42D); when(collisionArea.getCenterX()).thenReturn(69D); when(collisionArea.getCenterY()).thenReturn(1024D); when(collisionArea.getHeight()).thenReturn(22D); when(collisionArea.getSize()).thenReturn(33D); when(collisionArea.getBottomLeft()).thenReturn(new Vec2d(1, 1)); when(collisionArea.getBottomRight()).thenReturn(new Vec2d(2, 2)); when(collisionArea.getTopLeft()).thenReturn(new Vec2d(3, 3)); when(collisionArea.getTopRight()).thenReturn(new Vec2d(4, 4)); HashSet<Vec2d> set = new HashSet<>(); set.add(new Vec2d()); set.add(new Vec2d(100, 100)); set.add(new Vec2d(200, 200)); when(collisionArea.getMask()).thenReturn(set); }
Source:
public Map<String, String> getJobMessageProperties() { DiskImage diskImage = diskImageDao.getSnapshotById(getParameters().getSubchainInfo().getTopImageId()); DiskImage destDiskImage = diskImageDao.getSnapshotById(getParameters().getSubchainInfo().getBaseImageId()); if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put(VdcObjectType.Disk.name().toLowerCase(), diskImage.getDiskAlias()); jobProperties.put("sourcesnapshot", Optional.ofNullable(snapshotDao.get(diskImage.getVmSnapshotId()).getDescription()).orElse(StringUtils.EMPTY)); jobProperties.put("destinationsnapshot", Optional.ofNullable(snapshotDao.get(destDiskImage.getVmSnapshotId()).getDescription()).orElse(StringUtils.EMPTY)); } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { DiskImage diskImage = diskImageDao.getSnapshotById(getParameters().getSubchainInfo().getTopImageId()); DiskImage destDiskImage = diskImageDao.getSnapshotById(getParameters().getSubchainInfo().getBaseImageId()); if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put(VdcObjectType.Disk.name().toLowerCase(), diskImage.getDiskAlias()); jobProperties.put("sourcesnapshot", Optional.ofNullable(snapshotDao.get(diskImage.getVmSnapshotId()).getDescription()).orElse("")); jobProperties.put("destinationsnapshot", Optional.ofNullable(snapshotDao.get(destDiskImage.getVmSnapshotId()).getDescription()).orElse("")); } return jobProperties; }
Source:
public static UrisScheme forHost(String host) { try { if (host == null) { return WIKIDATA; } return new WikibaseUris(new URI("http://" + host), WIKIBASE_ENTITY_PREFIX, WIKIBASE_ENTITY_DATA_PREFIX, WIKIBASE_INITIALS); } catch (URISyntaxException e) { throw new RuntimeException("Bad URI host: " + host, e); } }

Target:
public static UrisScheme forHost(String host) { try { if (host == null) { return WIKIDATA; } return new WikibaseUris(new URI("http://" + host), WIKIBASE_ENTITY_PREFIX, WIKIBASE_ENTITY_DATA_PREFIX, WIKIBASE_INITIALS); } catch (URISyntaxException e) { throw new IllegalArgumentException("Bad URI host: " + host, e); } }
Source:
public Optional<Response> handle(HandlerInput input) { String speechText = "Welcome to the Alexa Skills Kit sample. Please tell me your favorite color by saying, my favorite color is red. " + "Your options are green, blue, purple, red, orange and yellow."; String repromptText = "Please tell me your favorite color by saying, my favorite color is red"; return input.getResponseBuilder() .withSimpleCard("ColorSession", speechText) .withSpeech(speechText) .withReprompt(repromptText) .build(); }

Target:
public Optional<Response> handle(HandlerInput input) { String speechText = "Welcome to the Alexa Skills Kit sample. Please tell me your favorite color by saying, my favorite color is red."; String repromptText = "Please tell me your favorite color by saying, my favorite color is red"; return input.getResponseBuilder() .withSimpleCard("ColorSession", speechText) .withSpeech(speechText) .withReprompt(repromptText) .build(); }
Source:
public void onXWalkReady()

Target:
protected void onXWalkReady() { }
Source:
List<Dataset> getDatasetsInCollection(CollectionReader reader) throws ZebedeeException, IOException { List<Dataset> datasets = new ArrayList<>(); for (String uri : reader.getReviewed().listUris()) { if (isDataJson(uri) && !isVersionedURI(uri)) { Path parent = Paths.get(uri).getParent(); Page page = reader.getReviewed().getContent(parent.toString()); if (PageType.dataset.equals(page.getType())) { datasets.add((Dataset) page); } } } return datasets; }

Target:
List<Dataset> getDatasetsInCollection(CollectionReader reader) throws ZebedeeException, IOException { List<String> filtered = reader.getReviewed() .listUris() .stream() .filter(uri -> StringUtils.isNotEmpty(uri) && uri.contains("/datasets/") && isDataJson(uri) && !isVersionedURI(uri)) .collect(Collectors.toList()); List<Dataset> datasets = new ArrayList<>(); for (String uri : filtered) { Path parent = Paths.get(uri).getParent(); Page page = reader.getReviewed().getContent(parent.toString()); if (PageType.dataset.equals(page.getType())) { datasets.add((Dataset) page); } } return datasets; }
Source:
public boolean isImmuneToBombs(){ return immuneToBombs; }

Target:
public boolean isImmuneToBombs(){ return (System.currentTimeMillis() < immuneToBombsTill || isInvulnerable()); }
Source:
public void testSaveCreate() throws SQLException{ String name = "TEST_RETROSPECTIVE_NAME"; String description = "TEST_RETROSPECTIVE_DESCRIPTION"; long sprintId = mCS.getSprintsId().get(0); long projectId = mCP.getAllProjects().get(0).getId(); int type = RetrospectiveObject.TYPE_GOOD; RetrospectiveObject retrospective = new RetrospectiveObject(projectId); retrospective.setName(name) .setSprintId(sprintId) .setDescription(description) .setType(type) .save(); IQueryValueSet valueSet = new MySQLQuerySet(); valueSet.addTableName(RetrospectiveEnum.TABLE_NAME); valueSet.addEqualCondition(RetrospectiveEnum.ID, retrospective.getId()); String query = valueSet.getSelectQuery(); ResultSet result = mControl.executeQuery(query); RetrospectiveObject retrospectiveCreated = null; if (result.next()) { retrospectiveCreated = RetrospectiveDAO.convert(result); } closeResultSet(result); assertEquals(name, retrospectiveCreated.getName()); assertEquals(description, retrospectiveCreated.getDescription()); assertEquals(type, retrospectiveCreated.getType()); assertEquals(projectId, retrospectiveCreated.getProjectId()); assertEquals(sprintId, retrospectiveCreated.getSprintId()); assertEquals(RetrospectiveObject.STATUS_NEW, retrospectiveCreated.getStatus()); }

Target:
public void testSaveCreate() { String name = "TEST_RETROSPECTIVE_NAME"; String description = "TEST_RETROSPECTIVE_DESCRIPTION"; long sprintId = mCS.getSprintsId().get(0); long projectId = mCP.getAllProjects().get(0).getId(); int type = RetrospectiveObject.TYPE_GOOD; RetrospectiveObject retrospective = new RetrospectiveObject(projectId); retrospective.setName(name) .setSprintId(sprintId) .setDescription(description) .setType(type) .save(); RetrospectiveObject retrospectiveCreated = RetrospectiveDAO.getInstance().get(retrospective.getId()); assertEquals(name, retrospectiveCreated.getName()); assertEquals(description, retrospectiveCreated.getDescription()); assertEquals(type, retrospectiveCreated.getType()); assertEquals(projectId, retrospectiveCreated.getProjectId()); assertEquals(sprintId, retrospectiveCreated.getSprintId()); assertEquals(RetrospectiveObject.STATUS_NEW, retrospectiveCreated.getStatus()); }
Source:
public List<BrandingTheme> getBrandingThemes() { if (themes == null && brandingRootPath.exists() && brandingRootPath.isDirectory() && brandingRootPath.canRead()) { themes = new ArrayList<BrandingTheme>(); List<File> directories = Arrays.asList( brandingRootPath.listFiles(new FileFilter() { @Override public boolean accept(final File file) { return file.isDirectory(); } })); for (File directory : directories) { BrandingTheme theme = new BrandingTheme( directory.getAbsolutePath(), brandingRootPath); if (theme.isAvailable()) { themes.add(theme); } } Collections.sort(themes); Collections.reverse(themes); } return themes; }

Target:
public List<BrandingTheme> getBrandingThemes() { if (themes == null && brandingRootPath.exists() && brandingRootPath.isDirectory() && brandingRootPath.canRead()) { themes = new ArrayList<BrandingTheme>(); List<File> directories = Arrays.asList( brandingRootPath.listFiles(new FileFilter() { @Override public boolean accept(final File file) { return file.isDirectory() && DIRECTORY_PATTERN.matcher(file.getName()).matches(); } })); Collections.sort(directories); for (File directory : directories) { BrandingTheme theme = new BrandingTheme( directory.getAbsolutePath(), brandingRootPath); if (theme.isAvailable()) { themes.add(theme); } } Collections.reverse(themes); } return themes; }
Source:
public void onWorkspaceStarted(WorkspaceStartedEvent event) { List<MachineEntity> machines = getMachines(event.getWorkspace()); if (machines.isEmpty()) { return; } ProcessTreeNode machineToSelect = null; MachineEntity devMachine = appContext.getDevMachine(); if (devMachine != null) { machineToSelect = addMachineNode(devMachine); machines.remove(devMachine); } for (MachineEntity machine : machines) { addMachineNode(machine); } if (machineToSelect == null) { machineToSelect = machineNodes.entrySet().iterator().next().getValue(); } view.selectNode(machineToSelect); workspaceAgent.setActivePart(ProcessesPanelPresenter.this); }

Target:
public void onWorkspaceStarted(WorkspaceStartedEvent event) { List<MachineEntity> machines = getMachines(event.getWorkspace()); if (machines.isEmpty()) { return; } ProcessTreeNode machineToSelect = null; MachineEntity devMachine = appContext.getDevMachine(); if (devMachine != null) { machineToSelect = addMachineNode(devMachine); machines.remove(devMachine); } for (MachineEntity machine : machines) { addMachineNode(machine); } if (machineToSelect != null) { view.selectNode(machineToSelect); } else if (!machineNodes.isEmpty()) { machineToSelect = machineNodes.entrySet().iterator().next().getValue(); view.selectNode(machineToSelect); } workspaceAgent.setActivePart(ProcessesPanelPresenter.this); }
Source:
private void validate(FailureCollector collector) { boolean hasOneSplit = false; if (!containsMacro(NUM_SPLITS) && numSplits != null) { if (numSplits < 1) { collector.addFailure("Invalid value for Number of Splits", "Must be at least 1"). withConfigProperty(NUM_SPLITS); } if (numSplits == 1) { hasOneSplit = true; } } if (!containsMacro(TRANSACTION_ISOLATION_LEVEL) && transactionIsolationLevel != null) { TransactionIsolationLevel.validate(transactionIsolationLevel, collector); } if (query != null) { return; } if (!containsMacro(IMPORT_QUERY) && (query == null || query.isEmpty()) && (importQuery == null || importQuery.isEmpty())) { collector.addFailure("Invalid import query specified", null).withConfigProperty(IMPORT_QUERY); } if (!hasOneSplit && !containsMacro(IMPORT_QUERY) && !getImportQuery().contains("$CONDITIONS")) { collector.addFailure("Invalid Import Query specified", String.format("Import Query %s must contain " + "the string '$CONDITIONS'.", importQuery)).withConfigProperty(IMPORT_QUERY); } if (!hasOneSplit && !containsMacro(SPLIT_BY) && (splitBy == null || splitBy.isEmpty())) { collector.addFailure("Split-By Field Name must be specified if Number of Splits is not set to 1.", null).withConfigProperty(SPLIT_BY); } if (!hasOneSplit && !containsMacro(BOUNDING_QUERY) && (boundingQuery == null || boundingQuery.isEmpty())) { collector.addFailure("Bounding Query must be specified if Number of Splits is not set to 1.", null) .withConfigProperty(BOUNDING_QUERY); } }

Target:
private void validate(FailureCollector collector) { boolean hasOneSplit = false; if (!containsMacro(NUM_SPLITS) && numSplits != null) { if (numSplits < 1) { collector.addFailure("Number of Splits must be a positive number.", null).withConfigProperty(NUM_SPLITS); } if (numSplits == 1) { hasOneSplit = true; } } if (!containsMacro(TRANSACTION_ISOLATION_LEVEL) && transactionIsolationLevel != null) { TransactionIsolationLevel.validate(transactionIsolationLevel, collector); } if (!containsMacro(IMPORT_QUERY) && Strings.isNullOrEmpty(importQuery)) { collector.addFailure("Import Query must be specified.", null).withConfigProperty(IMPORT_QUERY); } if (!hasOneSplit && !containsMacro(IMPORT_QUERY) && !Strings.isNullOrEmpty(importQuery) && !getImportQuery().contains("$CONDITIONS")) { collector.addFailure("Invalid Import Query.", String.format("Import Query %s must contain the " + "string '$CONDITIONS'.", importQuery)) .withConfigProperty(IMPORT_QUERY); } if (!hasOneSplit && !containsMacro(SPLIT_BY) && Strings.isNullOrEmpty(splitBy)) { collector.addFailure("Split-By Field Name must be specified if Number of Splits is not set to 1.", null).withConfigProperty(SPLIT_BY).withConfigProperty(NUM_SPLITS); } if (!hasOneSplit && !containsMacro(BOUNDING_QUERY) && Strings.isNullOrEmpty(boundingQuery)) { collector.addFailure("Bounding Query must be specified if Number of Splits is not set to 1.", null) .withConfigProperty(BOUNDING_QUERY).withConfigProperty(NUM_SPLITS); } }
Source:
public StringType() { type = NativeTypeEnum.STRING; }

Target:
public StringType() { super(NativeTypeEnum.STRING); }