auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void stop() { stopped = false; exec.shutdown(); for (ThreadPoolTaskRunnerWorkItem item : runningItems) { final Task task = item.getTask(); if (task.canRestore()) { final long start = System.currentTimeMillis(); log.info("Starting graceful shutdown of task[%s].", task.getId()); try { task.stopGracefully(); final TaskStatus taskStatus = item.getResult().get( new Interval(new DateTime(start), taskConfig.getGracefulShutdownTimeout()).toDurationMillis(), TimeUnit.MILLISECONDS ); log.info( "Graceful shutdown of task[%s] finished in %,dms with status[%s].", task.getId(), System.currentTimeMillis() - start, taskStatus.getStatusCode() ); } catch (Exception e) { log.warn(e, "Graceful shutdown of task[%s] aborted with exception."); } } } exec.shutdownNow(); }

Target:
public void stop() { exec.shutdown(); for (ThreadPoolTaskRunnerWorkItem item : runningItems) { final Task task = item.getTask(); final long start = System.currentTimeMillis(); final boolean graceful; final long elapsed; boolean error = false; if (task.canRestore()) { graceful = true; log.info("Starting graceful shutdown of task[%s].", task.getId()); try { task.stopGracefully(); final TaskStatus taskStatus = item.getResult().get( new Interval(new DateTime(start), taskConfig.getGracefulShutdownTimeout()).toDurationMillis(), TimeUnit.MILLISECONDS ); log.info( "Graceful shutdown of task[%s] finished in %,dms with status[%s].", task.getId(), System.currentTimeMillis() - start, taskStatus.getStatusCode() ); } catch (Exception e) { log.makeAlert(e, "Graceful task shutdown failed: %s", task.getDataSource()) .addData("taskId", task.getId()) .addData("dataSource", task.getDataSource()) .emit(); log.warn(e, "Graceful shutdown of task[%s] aborted with exception."); error = true; } } else { graceful = false; } elapsed = System.currentTimeMillis() - start; final ServiceMetricEvent.Builder metricBuilder = ServiceMetricEvent .builder() .setDimension("task", task.getId()) .setDimension("dataSource", task.getDataSource()) .setDimension("graceful", String.valueOf(graceful)) .setDimension("error", String.valueOf(error)); emitter.emit(metricBuilder.build("task/interrupt/count", 1L)); emitter.emit(metricBuilder.build("task/interrupt/elapsed", elapsed)); } exec.shutdownNow(); }
Source:
boolean computeIsJarBatchArchive(File jarFile) { try { Indexer indexer = new Indexer(); Index index = JandexUtil.createJarIndex(jarFile, indexer); for (BatchArtifactType t: BatchArtifactType.values()) { String className = t.getClassName(); if(className != null && !index.getAllKnownSubclasses(JandexUtil.toDotName(className)).isEmpty()) { return true; } className = t.getInterfaceName(); if(className != null && !index.getAllKnownImplementors(JandexUtil.toDotName(className)).isEmpty()) { return true; } } } catch (IOException e) { BatchCorePlugin.pluginLog().logError(e); } return false; }

Target:
boolean computeIsJarBatchArchive(File jarFile) { try { Indexer indexer = new Indexer(); Index index = JandexUtil.createJarIndex(jarFile, indexer); for (BatchArtifactType t: BatchArtifactType.values()) { String className = t.getClassName(); if(className != null && !index.getAllKnownSubclasses(DotName.createSimple(className)).isEmpty()) { return true; } className = t.getInterfaceName(); if(className != null && !index.getAllKnownImplementors(DotName.createSimple(className)).isEmpty()) { return true; } } } catch (IOException e) { BatchCorePlugin.pluginLog().logError(e); } return false; }
Source:
long getOsFreePhysicalMemorySize() { return getAggregatedFreeMemorySize(PHYSICAL_MEM_KEYS); }

Target:
long getOsFreePhysicalMemorySize() { return getAggregatedFreeMemorySize(MEM_AVAILABLE_KEYS); }
Source:
public void testBatchJobSubmitsAndRuns() throws Exception { createResources(); IBulkDataExportSvc.JobInfo jobDetails = myBulkDataExportSvc.submitJob(null, Sets.newHashSet("Patient", "Observation"), null, null); JobParametersBuilder paramBuilder = new JobParametersBuilder().addString("jobUUID", jobDetails.getJobId()); myBatchJobSubmitter.runJob(myBulkJob, paramBuilder.toJobParameters()); IBulkDataExportSvc.JobInfo jobInfo = awaitJobCompletion(jobDetails.getJobId()); assertThat(jobInfo.getStatus(), equalTo(BulkJobStatusEnum.COMPLETE)); }

Target:
public void testBatchJobSubmitsAndRuns() throws Exception { createResources(); IBulkDataExportSvc.JobInfo jobDetails = myBulkDataExportSvc.submitJob(null, Sets.newHashSet("Patient", "Observation"), null, null); BulkExportJobParametersBuilder paramBuilder = new BulkExportJobParametersBuilder() .setJobUUID(jobDetails.getJobId()) .setReadChunkSize(10L); JobExecution jobExecution = myBatchJobSubmitter.runJob(myBulkJob, paramBuilder.toJobParameters()); awaitJobCompletion(jobExecution); IBulkDataExportSvc.JobInfo jobInfo = myBulkDataExportSvc.getJobInfoOrThrowResourceNotFound(jobDetails.getJobId()); assertThat(jobInfo.getStatus(), equalTo(BulkJobStatusEnum.COMPLETE)); assertThat(jobInfo.getFiles().size(), equalTo(2)); }
Source:
public static String executeUrl(String httpMethod, String url, Properties httpHeaders, InputStream content, String contentType, int timeout, String proxyHost, Integer proxyPort, String proxyUser, String proxyPassword, String nonProxyHosts) throws IOException { ContentResponse response = executeUrlAndGetReponse(httpMethod, url, httpHeaders, content, contentType, timeout, proxyHost, proxyPort, proxyUser, proxyPassword, nonProxyHosts); String encoding = response.getEncoding() != null ? response.getEncoding().replaceAll("\"", "").trim() : "UTF-8"; String responseBody; try { responseBody = new String(response.getContent(), encoding); if (!responseBody.isEmpty()) { logger.trace(responseBody); } } catch (UnsupportedEncodingException e) { responseBody = null; } return responseBody; }

Target:
public static String executeUrl(String httpMethod, String url, Properties httpHeaders, InputStream content, String contentType, int timeout, String proxyHost, Integer proxyPort, String proxyUser, String proxyPassword, String nonProxyHosts) throws IOException { ContentResponse response = executeUrlAndGetReponse(httpMethod, url, httpHeaders, content, contentType, timeout, proxyHost, proxyPort, proxyUser, proxyPassword, nonProxyHosts); String encoding = response.getEncoding() != null ? response.getEncoding().replaceAll("\"", "").trim() : "UTF-8"; String responseBody; try { responseBody = new String(response.getContent(), encoding); } catch (UnsupportedEncodingException e) { responseBody = null; } return responseBody; }
Source:
public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { FittingOrgWordsMatchVoter fitOrgWordsMatchVoter = new FittingOrgWordsMatchVoter(ImmutableList.of(','), 2, 0.7f, 0.9f); fitOrgWordsMatchVoter.setMatchStrength(0.979f); FittingAffOrgSectionWordsMatchVoter fitAffOrgSectionWordsMatchVoter = new FittingAffOrgSectionWordsMatchVoter(ImmutableList.of(','), 1, 0.8f, 0.85f); fitAffOrgSectionWordsMatchVoter.setMatchStrength(1f); return ImmutableList.of( createNameCountryStrictMatchVoter(1f), createNameStrictCountryLooseMatchVoter(1f), createSectionedNameStrictCountryLooseMatchVoter(1f), createSectionedNameLevenshteinCountryLooseMatchVoter(1f), createSectionedShortNameStrictCountryLooseMatchVoter(1f), fitOrgWordsMatchVoter, fitAffOrgSectionWordsMatchVoter); }

Target:
public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { FittingOrgWordsMatchVoter fitOrgWordsMatchVoter = new FittingOrgWordsMatchVoter(ImmutableList.of(',', ';'), 2, 0.7f, 0.9f); fitOrgWordsMatchVoter.setMatchStrength(0.979f); FittingAffOrgSectionWordsMatchVoter fitAffOrgSectionWordsMatchVoter = new FittingAffOrgSectionWordsMatchVoter(ImmutableList.of(',', ';'), 1, 0.8f, 0.85f); fitAffOrgSectionWordsMatchVoter.setMatchStrength(1f); return ImmutableList.of( createNameCountryStrictMatchVoter(1f), createNameStrictCountryLooseMatchVoter(1f), createSectionedNameStrictCountryLooseMatchVoter(1f), createSectionedNameLevenshteinCountryLooseMatchVoter(1f), createSectionedShortNameStrictCountryLooseMatchVoter(1f), fitOrgWordsMatchVoter, fitAffOrgSectionWordsMatchVoter); }
Source:
public IBinder onBind(Intent intent) { this.audioPlayer = new SingleFileAudioPlayer( new OnCompletionListener(){ @Override public void onCompletion(MediaPlayer mp) { new BroadcastIntent(SingleFileAudioPlayer.ACTION_SONG_FINISHED).send(PlaylistService.this); } }); this.queue = new Playlist(); queue.add((new MediaStoreWrapper(this)).list().get(0)); return new PlaylistServiceBinder(); }

Target:
public IBinder onBind(Intent intent) { this.audioPlayer = new SingleFileAudioPlayer(this); this.mPlaylist = new Playlist(); registerReceivers(); return new PlaylistServiceBinder(); }
Source:
DefaultExtendedDnsCacheEntry(String hostname, InetAddress address) { this.hostname = hostname; this.address = address; cause = null; hostnameFromPtrRecord = null; }

Target:
DefaultExtendedDnsCacheEntry(String hostname, InetAddress address) { this.hostname = hostname; this.address = address; this.cause = null; this.hostnameFromPtrRecord = null; }
Source:
public Void call() throws IOException { String inputPaths = this.props.getProperty(CamusHourlySweeper.INPUT_PATHS); String outputPathStr = this.props.getProperty(CamusHourlySweeper.DEST_PATH); long destinationModTime = getDestinationModTime(this.fs, outputPathStr, true); Path outputPath = new Path(outputPathStr, "outlier"); fs.mkdirs(outputPath); for (String inputPathStr : inputPaths.split(",")) { Path inputPath = new Path(inputPathStr); long outlierMaxTimestamp = Long.MIN_VALUE; for (FileStatus status : fs.globStatus(new Path(inputPath, "*"), new HiddenFilter())) { if (status.getModificationTime() > destinationModTime) { if (outlierMaxTimestamp < status.getModificationTime()) { outlierMaxTimestamp = status.getModificationTime(); } LOG.info("copying outlier file " + status.getPath() + " to " + outputPath); FileUtil.copy(fs, status.getPath(), fs, outputPath, false, true, new Configuration()); fs.rename(status.getPath(), new Path(outputPath, status.getPath().getName())); } } if (outlierMaxTimestamp != Long.MIN_VALUE) { CamusHourlySweeper.createStateFileInFolder(fs, new Path(outputPathStr), outlierMaxTimestamp); } } return null; }

Target:
public Void call() throws IOException { String inputPaths = this.props.getProperty(CamusHourlySweeper.INPUT_PATHS); String outputPathStr = this.props.getProperty(CamusHourlySweeper.DEST_PATH); long destinationModTime = getDestinationModTime(this.fs, outputPathStr); Path outputPath = new Path(outputPathStr, "outlier"); fs.mkdirs(outputPath); for (String inputPathStr : inputPaths.split(",")) { Path inputPath = new Path(inputPathStr); long outlierMaxTimestamp = Long.MIN_VALUE; for (FileStatus status : fs.globStatus(new Path(inputPath, "*"), new HiddenFilter())) { if (status.getModificationTime() > destinationModTime) { if (outlierMaxTimestamp < status.getModificationTime()) { outlierMaxTimestamp = status.getModificationTime(); } LOG.info("copying outlier file " + status.getPath() + " to " + outputPath); FileUtil.copy(fs, status.getPath(), fs, outputPath, false, true, new Configuration()); fs.rename(status.getPath(), new Path(outputPath, status.getPath().getName())); } } if (outlierMaxTimestamp != Long.MIN_VALUE) { CamusHourlySweeper.createStateFileInFolder(fs, new Path(outputPathStr), outlierMaxTimestamp); } } return null; }
Source:
public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionManager functionManager) { Type type = boundVariables.getTypeVariable("E"); MethodHandle compareMethodHandle = functionManager.getScalarFunctionImplementation( functionManager.resolveOperator(operatorType, TypeSignatureProvider.fromTypes(ImmutableList.of(type, type)))).getMethodHandle(); return generateAggregation(type, compareMethodHandle); }

Target:
public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionManager functionManager) { Type type = boundVariables.getTypeVariable("E"); MethodHandle compareMethodHandle = functionManager.getScalarFunctionImplementation( functionManager.resolveOperator(operatorType, fromTypes(ImmutableList.of(type, type)))).getMethodHandle(); return generateAggregation(type, compareMethodHandle); }
Source:
InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] password, int maxMemoryLimitInKb) throws IOException { final byte propsByte = coder.properties[0]; final int dictSize = getDictionarySize(coder); if (dictSize > LZMAInputStream.DICT_SIZE_MAX) { throw new IOException("Dictionary larger than 4GiB maximum size used in " + archiveName); } else if ((dictSize / 1024) > maxMemoryLimitInKb) { throw new MemoryLimitException(dictSize / 1024, maxMemoryLimitInKb); } return new LZMAInputStream(in, uncompressedLength, propsByte, dictSize); }

Target:
InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] password, int maxMemoryLimitInKb) throws IOException { final byte propsByte = coder.properties[0]; final int dictSize = getDictionarySize(coder); if (dictSize > LZMAInputStream.DICT_SIZE_MAX) { throw new IOException("Dictionary larger than 4GiB maximum size used in " + archiveName); } final int memoryUsageInKb = LZMAInputStream.getMemoryUsage(dictSize, propsByte); if (memoryUsageInKb > maxMemoryLimitInKb) { throw new MemoryLimitException(memoryUsageInKb, maxMemoryLimitInKb); } return new LZMAInputStream(in, uncompressedLength, propsByte, dictSize); }
Source:
protected Void call() throws Exception { Objects.requireNonNull(version, "Version hasn't been set."); updateTitle(i18n.get("game.mapGeneration.downloadGenerator.title", version)); URL url = new URL(String.format(clientProperties.getMapGenerator().getMapGeneratorReleaseUrl(), version, version)); URLConnection urlConnection = url.openConnection(); int contentLength = urlConnection.getContentLength(); BufferedInputStream inputStream = new BufferedInputStream(urlConnection.getInputStream()); File targetFile = mapGeneratorService.getGeneratorExecutablePath().resolve(String.format(MapGeneratorService.getGENERATOR_EXECUTABLE_FILENAME(), version)).toFile(); BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(targetFile)); byte buffer[] = new byte[4096]; int totalBytesRead = 0; int bytesRead; while ((bytesRead = inputStream.read(buffer, 0, buffer.length)) != 0 && bytesRead != -1) { outputStream.write(buffer, 0, bytesRead); totalBytesRead += bytesRead; updateProgress(totalBytesRead, contentLength); } outputStream.close(); Files.setPosixFilePermissions(targetFile.toPath(), Sets.immutableEnumSet(PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_EXECUTE)); return null; }

Target:
protected Void call() throws Exception { Objects.requireNonNull(version, "Version hasn't been set."); updateTitle(i18n.get("game.mapGeneration.downloadGenerator.title", version)); URL url = new URL(String.format(clientProperties.getMapGenerator().getMapGeneratorReleaseUrl(), version)); URLConnection urlConnection = url.openConnection(); File targetFile = mapGeneratorService.getGeneratorExecutablePath().resolve(String.format(MapGeneratorService.getGENERATOR_EXECUTABLE_FILENAME(), version)).toFile(); Path tempFile = Files.createTempFile(targetFile.toPath().getParent(), "generator", null); ResourceLocks.acquireDownloadLock(); try (InputStream inputStream = url.openStream(); OutputStream outputStream = Files.newOutputStream(tempFile)) { ByteCopier.from(inputStream) .to(outputStream) .totalBytes(urlConnection.getContentLength()) .listener(this::updateProgress) .copy(); Files.move(tempFile, targetFile.toPath(), StandardCopyOption.REPLACE_EXISTING); } finally { ResourceLocks.freeDownloadLock(); try { Files.deleteIfExists(tempFile); } catch (IOException e) { logger.warn("Could not delete temporary file: " + tempFile.toAbsolutePath(), e); } } platformService.setUnixExecutableAndWritableBits(targetFile.toPath()); return null; }
Source:
public void channelCreated( Channel channel ) { throw new IllegalStateException( "A fatal error happened in this driver as this method should never be called. " + "Contact the driver developer." ); }

Target:
public void channelCreated( Channel channel ) { throw new IllegalStateException( "Untraceable channel created." ); }
Source:
public boolean doSynchronousPing() { MerlinLog.d("Pinging : " + hostAddress); try { int responseCode = responseCodeFetcher.from(hostAddress); MerlinLog.d("Got response : " + responseCode); } catch (RequestException e) { if (e.causedByIO()) { return false; } throw e; } return true; }

Target:
public boolean doSynchronousPing() { MerlinLog.d("Pinging : " + hostAddress); try { responseCodeFetcher.from(hostAddress); } catch (RequestException e) { if (e.causedByIO()) { return false; } throw e; } return true; }
Source:
public void writeToParcel(Parcel dest, int flags) { dest.writeValue(date); }

Target:
public void writeToParcel(Parcel dest, int flags) { dest.writeLong(date.getTime()); }
Source:
private void checkForOnlyFinalFields(DetailAST objBlockToken) { for (DetailAST ast = objBlockToken.getFirstChild(); ast != null; ast = ast.getNextSibling()) { if (TokenTypes.VARIABLE_DEF == ast.getType()) { final DetailAST modifiersToken = ast.findFirstToken(TokenTypes.MODIFIERS); if (!modifiersToken.branchContains(TokenTypes.FINAL) && !Utils.hasIllegalCombination(modifiersToken)) { log(modifiersToken, String.format(ERROR_MSG, ast.findFirstToken(TokenTypes.IDENT).getText(), objBlockToken.getPreviousSibling().getText())); } } } }

Target:
private void checkForOnlyFinalFields(DetailAST objBlockToken) { Optional<DetailAST> nonFinalFieldFound = TokenUtil.findFirstTokenByPredicate(objBlockToken, node -> TokenTypes.VARIABLE_DEF == node.getType() && !node.branchContains(TokenTypes.FINAL) && !Utils.hasIllegalCombination(node.findFirstToken(TokenTypes.MODIFIERS))); if (nonFinalFieldFound.isPresent()) { DetailAST field = nonFinalFieldFound.get().findFirstToken(TokenTypes.IDENT); log(field, String.format(ERROR_MSG, field.getText())); } }
Source:
Object[][] testOAData() { return new Object[][]{ new Object[]{new File("testdata/picard/sam/aligned_withoutOA.sam"), new File("testdata/picard/sam/aligned_withOA.sam")}, }; }

Target:
Object[][] testOAData() { return new Object[][]{ new Object[]{OA_TEST_DIR.resolve("aligned_withoutOA.sam").toFile(), OA_TEST_DIR.resolve("aligned_withOA.sam").toFile()}, }; }
Source:
public void testRowScannerStream() { List<ColumnScanner> rows = new ArrayList<>(); Set<ColumnValue> cv1 = new HashSet<>(); Set<ColumnValue> cv2 = new HashSet<>(); Bytes row1 = Bytes.of("555555555"); cv1.add(new ColumnValue(new Column("firstname"), Bytes.of("Chris"))); cv1.add(new ColumnValue(new Column("lastname"), Bytes.of("McTague"))); cv1.add(new ColumnValue(new Column("age"), Bytes.of("21"))); rows.add(new ColumnScannerImpl(row1, cv1)); Bytes row2 = Bytes.of("55234234"); cv2.add(new ColumnValue(new Column("firstname"), Bytes.of("Hulk"))); cv2.add(new ColumnValue(new Column("lastname"), Bytes.of("Hogan"))); cv2.add(new ColumnValue(new Column("age"), Bytes.of("60"))); rows.add(new ColumnScannerImpl(row2, cv2)); RowScannerImpl rsi = new RowScannerImpl(rows); Set<Person> people = rsi.stream().map(cs -> toPerson(cs)).collect(Collectors.toSet()); Set<Person> expected = new HashSet<>(); expected.add(new Person("Chris", "McTague", 21, 555555555)); expected.add(new Person("Hulk", "Hogan", 60, 55234234)); Assert.assertEquals(expected.hashCode(), people.hashCode()); Assert.assertEquals(expected.size(), people.size()); }

Target:
public void testRowScannerStream() { List<ColumnScanner> rows = new ArrayList<>(); Set<ColumnValue> cv1 = new HashSet<>(); Set<ColumnValue> cv2 = new HashSet<>(); Bytes row1 = Bytes.of("555555555"); cv1.add(new ColumnValue(new Column("firstname"), Bytes.of("Chris"))); cv1.add(new ColumnValue(new Column("lastname"), Bytes.of("McTague"))); cv1.add(new ColumnValue(new Column("age"), Bytes.of("21"))); rows.add(new ColumnScannerImpl(row1, cv1)); Bytes row2 = Bytes.of("55234234"); cv2.add(new ColumnValue(new Column("firstname"), Bytes.of("Hulk"))); cv2.add(new ColumnValue(new Column("lastname"), Bytes.of("Hogan"))); cv2.add(new ColumnValue(new Column("age"), Bytes.of("60"))); rows.add(new ColumnScannerImpl(row2, cv2)); RowScannerImpl rsi = new RowScannerImpl(rows); Set<Person> people = rsi.stream().map(cs -> toPerson(cs)).collect(Collectors.toSet()); Set<Person> expected = new HashSet<>(); expected.add(new Person("Chris", "McTague", 21, 555555555)); expected.add(new Person("Hulk", "Hogan", 60, 55234234)); Assert.assertEquals(expected, people); }
Source:
public List<TaskExecution> getLatestTaskExecutionsByTaskNames(String... taskNames) { throw new UnsupportedOperationException("Not implemented."); }

Target:
public List<TaskExecution> getLatestTaskExecutionsByTaskNames(String... taskNames) { Assert.notEmpty(taskNames, "At least 1 task name must be provided."); final List<String> taskNamesAsList = new ArrayList<>(); for (String taskName : taskNames) { if (StringUtils.hasText(taskName)) { taskNamesAsList.add(taskName); } } Assert.isTrue(taskNamesAsList.size() == taskNames.length, String.format("Task names must not contain any empty elements but %s of %s were empty or null.", taskNames.length - taskNamesAsList.size(), taskNames.length)); final Map<String, TaskExecution> tempTaskExecutions = new HashMap<>(); for (Map.Entry<Long, TaskExecution> taskExecutionMapEntry : this.taskExecutions.entrySet()) { if (!taskNamesAsList.contains(taskExecutionMapEntry.getValue().getTaskName())) { continue; } final TaskExecution tempTaskExecution = tempTaskExecutions.get(taskExecutionMapEntry.getValue().getTaskName()); if (tempTaskExecution == null || tempTaskExecution.getStartTime().before(taskExecutionMapEntry.getValue().getStartTime()) || ( tempTaskExecution.getStartTime().equals(taskExecutionMapEntry.getValue().getStartTime()) && tempTaskExecution.getExecutionId() < taskExecutionMapEntry.getValue().getExecutionId() ) ) { tempTaskExecutions.put(taskExecutionMapEntry.getValue().getTaskName(), taskExecutionMapEntry.getValue()); } } final List<TaskExecution> latestTaskExecutions = new ArrayList<>(tempTaskExecutions.values()); Collections.sort(latestTaskExecutions, new TaskExecutionComparator()); return latestTaskExecutions; }
Source:
protected boolean canDoAction() { boolean returnValue = true; if (isVmStatusProperForHotPlugNic(getVm().getstatus())) { setVdsId(getVm().getrun_on_vds().getValue()); returnValue = isHotPlugSupported() && isOSSupportingHotPlug(); } else { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); returnValue = false; } if (returnValue) { vmDevice = getVmDeviceDao().get(new VmDeviceId(getParameters().getNicId(), getParameters().getVmId())); if (vmDevice == null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.VM_INTERFACE_NOT_EXIST); } } return returnValue; }

Target:
protected boolean canDoAction() { boolean returnValue = true; if (isVmStatusProperForAttachDetach(getVm().getstatus())) { setVdsId(getVm().getrun_on_vds().getValue()); if (vmStatusDemandsHotPlugNic(getVm().getstatus())) { returnValue = isHotPlugSupported() && isOSSupportingHotPlug(); } } else { addCanDoActionMessage(VdcBllMessages.HOT_PLUG_NIC_VM_STATUS_ILLEGAL); returnValue = false; } if (returnValue) { vmDevice = getVmDeviceDao().get(new VmDeviceId(getParameters().getNicId(), getParameters().getVmId())); if (vmDevice == null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.VM_INTERFACE_NOT_EXIST); } } return returnValue; }
Source:
public String toString() { return prependIfDeerInstance("Title-matching Generator"); }

Target:
public String toString() { return name; }
Source:
private void assertIsLegalIndex(final int index) { int totalCount = itemCount(); Assert.isTrue(index < totalCount && index > 0, java.text.MessageFormat.format( "The index ({0}) is more than the number of items ({1}) in the list.", index, totalCount)); }

Target:
private void assertIsLegalIndex(final int index) { int totalCount = itemCount(); Assert.isTrue(index < totalCount && index >= 0, java.text.MessageFormat.format( "The index ({0}) is more than the number of items ({1}) in the list.", index, totalCount)); }
Source:
private DruidServer serverAddedOrUpdated(DruidServer server) { DruidServerHolder curr; DruidServerHolder newHolder; synchronized (servers) { curr = servers.get(server.getName()); newHolder = curr == null ? new DruidServerHolder(server) : curr.updatedHolder(server); servers.put(server.getName(), newHolder); } if (curr == null) { try { Future<?> future = newHolder.updateSegmentsListAsync(); future.get(config.getServerTimeout(), TimeUnit.MILLISECONDS); } catch (Throwable th) { log.error(th, "Failed to fetch segment list from %s , will be retried", server.getName()); } } return newHolder.druidServer; }

Target:
private DruidServer serverAddedOrUpdated(DruidServer server) { DruidServerHolder curr; DruidServerHolder newHolder; synchronized (servers) { curr = servers.get(server.getName()); newHolder = curr == null ? new DruidServerHolder(server) : curr.updatedHolder(server); servers.put(server.getName(), newHolder); } newHolder.updateSegmentsListAsync(); return newHolder.druidServer; }
Source:
public static Money of(CurrencyAmount currencyAmount) { Currency currency = currencyAmount.getCurrency(); BigDecimal roundedAmount = new BigDecimal(currencyAmount.getAmount()) .setScale(currency.getMinorUnitDigits(), BigDecimal.ROUND_HALF_EVEN); return new Money(currency, roundedAmount); }

Target:
public static Money of(CurrencyAmount currencyAmount) { Currency currency = currencyAmount.getCurrency(); BigDecimal roundedAmount = BigDecimal.valueOf(currencyAmount.getAmount()) .setScale(currency.getMinorUnitDigits(), BigDecimal.ROUND_HALF_UP); return new Money(currency, roundedAmount); }
Source:
public Factory<PaxosLearnerNetworkClient> learner() { return client -> { List<PaxosLearner> remoteLearners = TimelockPaxosLearnerAdapter .wrap(useCase(), remoteClients()) .apply(client); PaxosLearner localLearner = components().learner(client); LocalAndRemotes<PaxosLearner> allLearners = LocalAndRemotes.of(localLearner, remoteLearners); return new SingleLeaderLearnerNetworkClient( allLearners.local(), allLearners.remotes(), quorumSize(), allLearners.withSharedExecutor(sharedExecutor())); }; }

Target:
public Factory<PaxosLearnerNetworkClient> learner() { return client -> { List<PaxosLearner> remoteLearners = TimelockPaxosLearnerAdapter .wrap(useCase(), remoteClients()) .apply(client); PaxosLearner localLearner = components().learner(client); LocalAndRemotes<PaxosLearner> allLearners = LocalAndRemotes.of(localLearner, remoteLearners) .enhanceRemotes(remote -> metrics().instrument(PaxosLearner.class, remote, client)); SingleLeaderLearnerNetworkClient uninstrumentedLearner = new SingleLeaderLearnerNetworkClient( allLearners.local(), allLearners.remotes(), quorumSize(), allLearners.withSharedExecutor(sharedExecutor())); return metrics().instrument(PaxosLearnerNetworkClient.class, uninstrumentedLearner); }; }
Source:
private List<File> scanJarsInPluginsDirectory() { if (pluginsDir == null || !pluginsDir.exists()) { return Collections.emptyList(); } File[] matches = pluginsDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return (pathname.getName().endsWith(".jar") || pathname.getName() .endsWith(".jar.disabled")) && pathname.isFile(); } }); if (matches == null) { log.error("Cannot list " + pluginsDir.getAbsolutePath()); return Collections.emptyList(); } return Arrays.asList(matches); }

Target:
private List<File> scanJarsInPluginsDirectory() { if (pluginsDir == null || !pluginsDir.exists()) { return Collections.emptyList(); } File[] matches = pluginsDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { String n = pathname.getName(); return (n.endsWith(".jar") || n.endsWith(".jar.disabled")) && pathname.isFile(); } }); if (matches == null) { log.error("Cannot list " + pluginsDir.getAbsolutePath()); return Collections.emptyList(); } return Arrays.asList(matches); }
Source:
public MqttBrokerConnection(Protocol protocol, String host, @Nullable Integer port, boolean secure, @Nullable String clientId) { this(host, port, secure, clientId); this.protocol = protocol; }

Target:
public MqttBrokerConnection(Protocol protocol, String host, @Nullable Integer port, boolean secure, @Nullable String clientId) { this.protocol = protocol; this.host = host; this.secure = secure; String newClientID = clientId; if (newClientID == null) { newClientID = MqttClient.generateClientId(); } else if (newClientID.length() > 65535) { throw new IllegalArgumentException("Client ID cannot be longer than 65535 characters"); } if (port != null && (port <= 0 || port > 65535)) { throw new IllegalArgumentException("Port is not within a valid range"); } this.port = port != null ? port : (secure ? 8883 : 1883); this.clientId = newClientID; setReconnectStrategy(new PeriodicReconnectStrategy()); }
Source:
public Collection<TransferLeg> map(Map<Stop, Transfer> input, double walkSpeed) { List<TransferLeg> result = new ArrayList<>(); for (Map.Entry<Stop, Transfer> entry : input.entrySet()) { Stop stop = entry.getKey(); Transfer transfer = entry.getValue(); int duration = (int)Math.floor(transfer.getDistanceMeters() / walkSpeed); int stopIndex = transitLayer.getIndexByStop(stop); Transfer newTransfer = new Transfer(stopIndex, transfer.getDistanceMeters(), transfer.getCoordinates()); result.add(new TransferWithDuration(newTransfer, duration)); } return result; }

Target:
public Collection<TransferLeg> map(Map<Stop, Transfer> input, double walkSpeed) { List<TransferLeg> result = new ArrayList<>(); for (Map.Entry<Stop, Transfer> entry : input.entrySet()) { Stop stop = entry.getKey(); Transfer transfer = entry.getValue(); int stopIndex = transitLayer.getIndexByStop(stop); Transfer newTransfer = new Transfer(stopIndex, transfer.getDistanceMeters(), transfer.getCoordinates()); result.add(new TransferWithDuration(newTransfer, walkSpeed)); } return result; }
Source:
private void configureSingleUserMode() { bind(TokenValidator.class).to(org.eclipse.che.api.local.DummyTokenValidator.class); bind(MachineTokenProvider.class).to(MachineTokenProvider.EmptyMachineTokenProvider.class); bind(org.eclipse.che.api.workspace.server.stack.StackLoader.class); bind(DataSource.class).toProvider(org.eclipse.che.core.db.h2.H2DataSourceProvider.class); install(new org.eclipse.che.api.user.server.jpa.UserJpaModule()); install(new org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule()); bind(org.eclipse.che.api.user.server.CheUserCreator.class); bindConstant().annotatedWith(Names.named("che.agents.auth_enabled")).to(false); bindConstant() .annotatedWith(Names.named("db.jndi.datasource.name")) .to("java:/comp/env/jdbc/che-h2"); bindConstant() .annotatedWith(Names.named("machine.terminal_agent.run_command")) .to( "$HOME/che/terminal/che-websocket-terminal " + "-addr :4411 " + "-cmd ${SHELL_INTERPRETER} " + "-enable-activity-tracking"); bindConstant() .annotatedWith(Names.named("machine.exec_agent.run_command")) .to( "$HOME/che/exec-agent/che-exec-agent " + "-addr :4412 " + "-cmd ${SHELL_INTERPRETER} " + "-logs-dir $HOME/che/exec-agent/logs"); }

Target:
private void configureSingleUserMode() { bind(TokenValidator.class).to(org.eclipse.che.api.local.DummyTokenValidator.class); bind(MachineTokenProvider.class).to(MachineTokenProvider.EmptyMachineTokenProvider.class); bind(org.eclipse.che.api.workspace.server.stack.StackLoader.class); bind(DataSource.class).toProvider(org.eclipse.che.core.db.h2.H2DataSourceProvider.class); install(new org.eclipse.che.api.user.server.jpa.UserJpaModule()); install(new org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule()); bind(org.eclipse.che.api.user.server.CheUserCreator.class); bindConstant().annotatedWith(Names.named("che.agents.auth_enabled")).to(false); bindConstant() .annotatedWith(Names.named("db.jndi.datasource.name")) .to("java:/comp/env/jdbc/che-h2"); }
Source:
private List<JobForecastId> findForecastsToDelete(SearchResponse searchResponse) { List<JobForecastId> forecastsToDelete = new ArrayList<>(); SearchHits hits = searchResponse.getHits(); if (hits.getTotalHits() > MAX_FORECASTS) { LOGGER.info("More than forecasts were found. This run will only delete of them", MAX_FORECASTS, MAX_FORECASTS); } for (SearchHit hit : hits.getHits()) { String expiryTime = stringFieldValueOrNull(hit, ForecastRequestStats.EXPIRY_TIME.getPreferredName()); if (expiryTime == null) { LOGGER.warn("Forecast request stats document has a null field", hit.getId(), ForecastRequestStats.EXPIRY_TIME.getPreferredName()); continue; } long expiryMs = TimeUtils.parseToEpochMs(expiryTime); if (expiryMs < cutoffEpochMs) { JobForecastId idPair = new JobForecastId( stringFieldValueOrNull(hit, Job.ID.getPreferredName()), stringFieldValueOrNull(hit, Forecast.FORECAST_ID.getPreferredName())); if (idPair.hasNullValue() == false) { forecastsToDelete.add(idPair); } } } return forecastsToDelete; }

Target:
private List<JobForecastId> findForecastsToDelete(SearchResponse searchResponse) { List<JobForecastId> forecastsToDelete = new ArrayList<>(); SearchHits hits = searchResponse.getHits(); if (hits.getTotalHits() > MAX_FORECASTS) { LOGGER.info("More than forecasts were found. This run will only delete of them", MAX_FORECASTS, MAX_FORECASTS); } for (SearchHit hit : hits.getHits()) { DocumentField docField = hit.field(ForecastRequestStats.EXPIRY_TIME.getPreferredName()); if (docField == null) { LOGGER.warn("Forecast request stats document has a null field", hit.getId(), ForecastRequestStats.EXPIRY_TIME.getPreferredName()); continue; } Long expiryMs = parseDateField(docField.getValue()); if (expiryMs == null) { LOGGER.warn("Forecast request stats document date field cannot be parsed", hit.getId(), ForecastRequestStats.EXPIRY_TIME.getPreferredName()); continue; } if (expiryMs < cutoffEpochMs) { JobForecastId idPair = new JobForecastId( stringFieldValueOrNull(hit, Job.ID.getPreferredName()), stringFieldValueOrNull(hit, Forecast.FORECAST_ID.getPreferredName())); if (idPair.hasNullValue() == false) { forecastsToDelete.add(idPair); } } } return forecastsToDelete; }
Source:
public void addVmsToRun(List<Guid> vmIds) { final DateTime now = DateTime.getNow(); LinkedList<Pair<Guid, DateTime>> vmsToAdd = new LinkedList<>(); for (Guid vmId: vmIds) { vmsToAdd.add(new Pair<>(vmId, now)); } autoStartVmsToRun.addAll(vmsToAdd); }

Target:
public void addVmsToRun(List<Guid> vmIds) { LinkedList<AutoStartVmToRestart> vmsToAdd = new LinkedList<>(); for (Guid vmId: vmIds) { vmsToAdd.add(new AutoStartVmToRestart(vmId)); } autoStartVmsToRestart.addAll(vmsToAdd); }
Source:
public DataPropertyTemplateModel call() throws Exception { DataPropertyTemplateModel dptm = new DataPropertyTemplateModel(dp, subject, vreq, editing, populatedDataPropertyList); return dptm; }

Target:
public DataPropertyTemplateModel call() { return new DataPropertyTemplateModel(dp, subject, vreq, editing, populatedDataPropertyList); }
Source:
public void setInput(Object input) { String content= null; if (input instanceof String) { content= (String) input; } else if (input instanceof JavaSourceInformationInput) { content= ((JavaSourceInformationInput) input).getHoverInfo(); } setInformation(content); if (fShell != null && !fShell.isDisposed()) { Display display= fShell.getDisplay(); if (!display.isDisposed()) { display.asyncExec(new Runnable() { @Override public void run() { Object element= null; if (input instanceof JavaSourceInformationInput) { element= ((JavaSourceInformationInput) input).getJavaElement(); } else if (input instanceof String && ((String) input).contains(SimpleJavaSourceViewerConfiguration.MODULE)) { element= input; } updateViewerConfiguration(element); } }); } } }

Target:
public void setInput(Object input) { String content= null; if (input instanceof String) { content= (String) input; } else if (input instanceof JavaSourceInformationInput) { content= ((JavaSourceInformationInput) input).getHoverInfo(); } setInformation(content); if (fShell != null && !fShell.isDisposed()) { Display display= fShell.getDisplay(); if (!display.isDisposed()) { display.asyncExec(new Runnable() { @Override public void run() { IJavaElement javaElement= null; if (input instanceof JavaSourceInformationInput) { javaElement= ((JavaSourceInformationInput) input).getJavaElement(); } updateViewerConfiguration(javaElement); } }); } } }
Source:
public static boolean matches(Resource resource, List<String> queries) { if (resource == null) return false; if (queries == null || queries.size() == 0) return true; ResourceAttributes attributes = resource.getAttributes(); String path = resource.getPath() + resource.getName(); for (String s : queries) { int delim = s.indexOf("="); if (delim != -1) { String attrName = s.substring(0, delim); String expected = s.substring(delim + 1); if (attrName.equals(LinkFormat.LINK)) { if (expected.endsWith("*")) { if (!path.startsWith(expected.substring(0, expected.length() - 1))) return false; } else { if (!path.equals(expected)) return false; } } else if (attributes.containsAttribute(attrName)) { boolean matched = false; for (String actual : attributes.getAttributeValues(attrName)) { int prefixLength = expected.indexOf('*'); if (prefixLength >= 0 && prefixLength < actual.length()) { String shortened = expected.substring(0, prefixLength); actual = actual.substring(0, prefixLength); if (actual.equals(shortened)) { matched = true; } } else if (actual.equals(expected)) { matched = true; } } if (!matched) { return false; } } else if (!attributes.containsAttribute(attrName)) { return false; } } else { if (attributes.getAttributeValues(s).size() == 0) { return false; } } } return true; }

Target:
public static boolean matches(Resource resource, List<String> queries) { if (resource == null) return false; if (queries == null || queries.size() == 0) return true; ResourceAttributes attributes = resource.getAttributes(); String path = resource.getPath() + resource.getName(); for (String s : queries) { int delim = s.indexOf("="); if (delim != -1) { String attrName = s.substring(0, delim); String expected = s.substring(delim + 1); if (attrName.equals(LinkFormat.LINK)) { if (expected.endsWith("*")) { if (!path.startsWith(expected.substring(0, expected.length() - 1))) return false; } else { if (!path.equals(expected)) return false; } } else if (attributes.containsAttribute(attrName)) { boolean matched = false; for (String actual : attributes.getAttributeValues(attrName)) { int prefixLength = expected.indexOf('*'); if (prefixLength >= 0 && prefixLength < actual.length()) { String shortened = expected.substring(0, prefixLength); actual = actual.substring(0, prefixLength); if (actual.equals(shortened)) { matched = true; break; } } else if (actual.equals(expected)) { matched = true; break; } } if (!matched) { return false; } } else if (!attributes.containsAttribute(attrName)) { return false; } } else { if (attributes.getAttributeValues(s).size() == 0) { return false; } } } return true; }
Source:
public void visitConditionalExpression(ConditionalExpressionTree conditionalExpression) { checkNull(conditionalExpression.trueExpression()); checkNull(conditionalExpression.falseExpression()); super.visitConditionalExpression(conditionalExpression); }

Target:
public void visitConditionalExpression(ConditionalExpressionTree conditionalExpression) { if (conditionalExpression.symbolType().is(OPTIONAL)) { checkNull(conditionalExpression.trueExpression()); checkNull(conditionalExpression.falseExpression()); } super.visitConditionalExpression(conditionalExpression); }
Source:
public long getId() { return fId; }

Target:
public int getId() { return fId; }
Source:
public void typeBirthdate(String month, String day, String year) { waitForElementByElement(signupBirthdate); scrollAndClick((signupBirthdate)); waitForElementByElement(signupBirthMonth); scrollAndClick((signupBirthMonth)); signupBirthMonth.sendKeys(month); waitForElementByElement(signupBirthDay); signupBirthDay.click(); signupBirthDay.sendKeys(day); waitForElementByElement(signupBirthYear); signupBirthYear.click(); signupBirthYear.sendKeys(year); }

Target:
public MobileSignupPageObject typeBirthdate(String month, String day, String year) { waitForElementByElement(signupBirthdate); scrollAndClick((signupBirthdate)); waitForElementByElement(signupBirthMonth); scrollAndClick((signupBirthMonth)); signupBirthMonth.sendKeys(month); waitForElementByElement(signupBirthDay); signupBirthDay.click(); signupBirthDay.sendKeys(day); waitForElementByElement(signupBirthYear); signupBirthYear.click(); signupBirthYear.sendKeys(year); return this; }
Source:
private void wrapValue(final AssetRecord assetRecord, final String userValue, final String userType) { requireNonNull(assetRecord, message.assetRecordNonNull()); requireNonNull(userValue, message.valueNonNull()); requireNonNull(userType, message.typeNonNull()); final DataType dataType = DataType.getDataType(userType); TypedValue<?> value = null; try { if (INTEGER == dataType) { value = TypedValues.newIntegerValue(Integer.parseInt(userValue)); } if (BOOLEAN == dataType) { value = TypedValues.newBooleanValue(Boolean.parseBoolean(userValue)); } if (FLOAT == dataType) { value = TypedValues.newFloatValue(Byte.parseByte(userValue)); } if (DOUBLE == dataType) { value = TypedValues.newDoubleValue(Double.parseDouble(userValue)); } if (LONG == dataType) { value = TypedValues.newLongValue(Long.parseLong(userValue)); } if (STRING == dataType) { value = TypedValues.newStringValue(userValue); } } catch (final NumberFormatException nfe) { throw nfe; } assetRecord.setValue(value); }

Target:
private void wrapValue(final AssetRecord assetRecord, final String userValue, final String userType) { requireNonNull(assetRecord, message.assetRecordNonNull()); requireNonNull(userValue, message.valueNonNull()); requireNonNull(userType, message.typeNonNull()); final DataType dataType = DataType.getDataType(userType); TypedValue<?> value = null; try { if (INTEGER == dataType) { value = TypedValues.newIntegerValue(Integer.parseInt(userValue)); } if (BOOLEAN == dataType) { value = TypedValues.newBooleanValue(Boolean.parseBoolean(userValue)); } if (FLOAT == dataType) { value = TypedValues.newFloatValue(Float.parseFloat(userValue)); } if (DOUBLE == dataType) { value = TypedValues.newDoubleValue(Double.parseDouble(userValue)); } if (LONG == dataType) { value = TypedValues.newLongValue(Long.parseLong(userValue)); } if (STRING == dataType) { value = TypedValues.newStringValue(userValue); } } catch (final NumberFormatException nfe) { throw nfe; } assetRecord.setValue(value); }
Source:
public ApacheDirective getDirective() { ApacheDirectiveTree tree = resourceContext.getParentResourceComponent().parseFullConfiguration(); String resourceKey = resourceContext.getResourceKey(); int snmpIdx = getWwwServiceIndex(); if (snmpIdx < 1) { throw new IllegalStateException("Could not determine the index of the virtual host [" + resourceKey + "] in the runtime configuration. This is very strange."); } if (snmpIdx == 1) { return tree.getRootNode(); } final List<ApacheDirective> allVhosts = tree.search("/<VirtualHost"); int idx = allVhosts.size() - snmpIdx + 1; return allVhosts.get(idx); }

Target:
public ApacheDirective getDirective() { ApacheDirectiveTree tree = resourceContext.getParentResourceComponent().parseRuntimeConfiguration(true, true); String resourceKey = resourceContext.getResourceKey(); int snmpIdx = getWwwServiceIndex(); if (snmpIdx < 1) { throw new IllegalStateException("Could not determine the index of the virtual host [" + resourceKey + "] in the runtime configuration. This is very strange."); } if (snmpIdx == 1) { return tree.getRootNode(); } final List<ApacheDirective> allVhosts = tree.search("/<VirtualHost"); int idx = allVhosts.size() - snmpIdx + 1; return allVhosts.get(idx); }
Source:
public ProjectileSource getShooter() { if (projectileSource != null) { return this.projectileSource; } if (this.owner instanceof ProjectileSource) { return (ProjectileSource) this.owner; } return ProjectileSource.UNKNOWN; }

Target:
public ProjectileSource getShooter() { if (this.projectileSource != null) { return this.projectileSource; } if (this.owner instanceof ProjectileSource) { return (ProjectileSource) this.owner; } return ProjectileSource.UNKNOWN; }
Source:
Object invoke(InvocationContext ctx) throws Exception { if (isRequestContextActive()) { return ctx.proceed(); } else { Object dummyPayload = new Object(); try { requestContext.activate(); beanManager.fireEvent(dummyPayload, InitializedLiteral.REQUEST); return ctx.proceed(); } finally { requestContext.invalidate(); beanManager.fireEvent(dummyPayload, BeforeDestroyed.Literal.REQUEST); requestContext.deactivate(); beanManager.fireEvent(dummyPayload, DestroyedLiteral.REQUEST); } } }

Target:
Object invoke(InvocationContext ctx) throws Exception { if (isRequestContextActive()) { return ctx.proceed(); } else { Object dummyPayload = new Object(); try { requestContext.activate(); fastEventInit.fire(dummyPayload); return ctx.proceed(); } finally { requestContext.invalidate(); fastEventBeforeDestroyed.fire(dummyPayload); requestContext.deactivate(); fastEventDestroyed.fire(dummyPayload); } } }
Source:
public void setup() { TestVectorsLatency data = new TestVectorsLatency(6); TreeMapStore<TestInterval> latencyDataStore = new TreeMapStore<>(); for (TestInterval interval : data.getDataList()) { assertNotNull(interval); latencyDataStore.addElement(interval); } fData = latencyDataStore; fIntersecting = latencyDataStore; }

Target:
public void setup() { List<TestInterval> data = new ArrayList<>(); data.add(new TestInterval(5, 10)); data.add(new TestInterval(16, 18)); data.add(new TestInterval(30, 34)); TreeMapStore<TestInterval> treeMapStore = new TreeMapStore<>(); for (TestInterval interval : data) { assertNotNull(interval); treeMapStore.addElement(interval); } fData = treeMapStore; fIntersecting = treeMapStore; }
Source:
public <T> T unwrap(Class<T> iface) throws SQLException { if (!iface.isInstance(this)) { throw new SQLExceptionInfo.Builder(SQLExceptionCodeEnum.CLASS_NOT_UNWRAPPABLE) .setMessage(this.getClass().getName() + " not unwrappable from " + iface.getName()) .build().buildException(); } return (T)this; }

Target:
public <T> T unwrap(Class<T> iface) throws SQLException { if (!iface.isInstance(this)) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.CLASS_NOT_UNWRAPPABLE) .setMessage(this.getClass().getName() + " not unwrappable from " + iface.getName()) .build().buildException(); } return (T)this; }