auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DateTimeType(String zonedValue) { ZonedDateTime date = null; try { try { date = ZonedDateTime.parse(zonedValue, formatterTzMsRFC); } catch (DateTimeParseException tzMsRfcException) { try { date = ZonedDateTime.parse(zonedValue, formatterTzMs); } catch (DateTimeParseException tzMsException) { try { date = ZonedDateTime.parse(zonedValue, formatterTz); } catch (DateTimeParseException tzException) { try { date = ZonedDateTime.parse(zonedValue, formatter); } catch (DateTimeParseException regularFormatException) { date = ZonedDateTime.parse(zonedValue, formatterTzMsIso); } } } } } catch (DateTimeParseException invalidFormatException) { throw new IllegalArgumentException(zonedValue + " is not in a valid format.", invalidFormatException); } if (date != null) { zonedDateTime = ZonedDateTime.from(date); } }

Target:
public DateTimeType(String zonedValue) { ZonedDateTime date = null; try { try { date = ZonedDateTime.parse(zonedValue, formatterTzMsRFC); } catch (DateTimeParseException tzMsRfcException) { try { date = ZonedDateTime.parse(zonedValue, formatterTzMsIso); } catch (DateTimeParseException tzMsException) { try { date = ZonedDateTime.parse(zonedValue, formatterTz); } catch (DateTimeParseException tzException) { try { date = ZonedDateTime.parse(zonedValue, formatterTzMs); } catch (DateTimeParseException regularFormatException) { LocalDateTime localDateTime = LocalDateTime.parse(zonedValue, formatter); date = ZonedDateTime.of(localDateTime, ZoneId.systemDefault()); } } } } } catch (DateTimeParseException invalidFormatException) { throw new IllegalArgumentException(zonedValue + " is not in a valid format.", invalidFormatException); } if (date != null) { zonedDateTime = date; } }
Source:
public Query createQuery(NamedQueryDefinition namedQueryDefinition) { String queryString = namedQueryDefinition.getQueryString(); Query query = createQuery( queryString ); query.setComment( "named HQL query " + namedQueryDefinition.getName() ); query.setFlushMode( namedQueryDefinition.getFlushMode() ); return query; }

Target:
public Query createQuery(NamedQueryDefinition namedQueryDefinition) { String queryString = namedQueryDefinition.getQueryString(); Query query = createQuery( queryString ); query.setComment( "named HQL/JP-QL query " + namedQueryDefinition.getName() ); query.setFlushMode( namedQueryDefinition.getFlushMode() ); return query; }
Source:
public void testInvalidUser(AuthenticationFlowContext context, UserModel user) { if (user == null || user.getServiceAccountClientLink() != null) { dummyHash(context); context.getEvent().error(Errors.USER_NOT_FOUND); Response challengeResponse = challenge(context, getDefaultChallengeMessage(context)); context.failureChallenge(AuthenticationFlowError.INVALID_USER, challengeResponse); } }

Target:
public void testInvalidUser(AuthenticationFlowContext context, UserModel user) { if (user == null) { dummyHash(context); context.getEvent().error(Errors.USER_NOT_FOUND); Response challengeResponse = challenge(context, getDefaultChallengeMessage(context)); context.failureChallenge(AuthenticationFlowError.INVALID_USER, challengeResponse); } }
Source:
public static List<RegistryFileInfo> copyRegistryFiles() throws TskCoreException { List<AbstractFile> regFilesAbstract = findRegistryFiles(); List<RegistryFileInfo> regFilesLocal = new ArrayList<>(); String tmpDir = Case.getCurrentCase().getTempDirectory() + File.separator + "STIX"; File dir = new File(tmpDir); if (dir.exists() == false) { dir.mkdirs(); } long index = 1; for (AbstractFile regFile : regFilesAbstract) { String regFileName = regFile.getName(); String regFileNameLocal = tmpDir + File.separator + regFileName + "_" + index; File regFileNameLocalFile = new File(regFileNameLocal); try { if (regFile.getMetaFlagsAsString().contains("Allocated")) { ContentUtils.writeToFile(regFile, regFileNameLocalFile); regFilesLocal.add(new EvalRegistryObj().new RegistryFileInfo(regFile, regFileNameLocal)); } } catch (IOException ex) { logger.log(Level.WARNING, String.format("Error copying file '%s' (id=%d) into directory '%s'.", regFileName, regFile.getId(), regFileNameLocal), ex); throw new TskCoreException(ex.getLocalizedMessage()); } index++; } return regFilesLocal; }

Target:
public static List<RegistryFileInfo> copyRegistryFiles() throws TskCoreException { List<AbstractFile> regFilesAbstract = findRegistryFiles(); List<RegistryFileInfo> regFilesLocal = new ArrayList<>(); String tmpDir = Case.getCurrentCase().getTempDirectory() + File.separator + "STIX"; File dir = new File(tmpDir); if (dir.exists() == false) { dir.mkdirs(); } long index = 1; for (AbstractFile regFile : regFilesAbstract) { String regFileName = regFile.getName(); String regFileNameLocal = tmpDir + File.separator + regFileName + "_" + index; File regFileNameLocalFile = new File(regFileNameLocal); try { if (regFile.getMetaFlagsAsString().contains("Allocated")) { ContentUtils.writeToFile(regFile, regFileNameLocalFile); regFilesLocal.add(new EvalRegistryObj().new RegistryFileInfo(regFile, regFileNameLocal)); } } catch (IOException ex) { throw new TskCoreException(ex.getLocalizedMessage()); } index++; } return regFilesLocal; }
Source:
private boolean isAbsoluteUrl(String path) { return path.startsWith("http://") || path.startsWith("https://"); }

Target:
private boolean isAbsoluteUrl(String path) { String lowerCase = path.toLowerCase(); return lowerCase.startsWith("http://") || lowerCase.startsWith("https://"); }
Source:
public List<DataSampleDto> getData() { return Collections.unmodifiableList(data!=null?data:new ArrayList<>()); }

Target:
public List<DataSampleDto> getData() { return Collections.unmodifiableList(this.data!=null?this.data:new ArrayList<>()); }
Source:
private void createWithRuntime(){ ProjectExplorer pe = new ProjectExplorer(); pe.open(); createWebProject(WEB_PROJECT_NAME, sr.getRuntimeName(), false); pe.open(); pe.getProject(WEB_PROJECT_NAME).select(); new ContextMenuItem("Configure","Convert to Maven Project").select(); new DefaultShell("Create new POM"); new PushButton("Finish").click(); new WaitUntil(new ShellIsAvailable("Convert to Maven Dependencies"), TimePeriod.getCustom(2500)); new WaitUntil(new ControlIsEnabled(new PushButton("Finish")), TimePeriod.VERY_LONG); }

Target:
private void createWithRuntime(){ ProjectExplorer pe = new ProjectExplorer(); pe.open(); createWebProject(WEB_PROJECT_NAME, sr.getRuntimeName(), false); pe.open(); pe.getProject(WEB_PROJECT_NAME).select(); new ContextMenuItem("Configure","Convert to Maven Project").select(); new DefaultShell("Create new POM"); new PushButton("Finish").click(); new WaitUntil(new ShellIsAvailable("Convert to Maven Dependencies"), TimePeriod.VERY_LONG); new WaitUntil(new ControlIsEnabled(new PushButton("Finish")), TimePeriod.VERY_LONG); }
Source:
public OrcStruct transform(StructuredRecord input, Schema schema) { List<Schema.Field> fields = input.getSchema().getFields(); OrcStruct orcRecord = parseOrcSchema(input.getSchema()); for (int i = 0; i < fields.size(); i++) { Schema.Field field = fields.get(i); try { WritableComparable writable = convertToWritable(field, input); orcRecord.setFieldValue(fields.get(i).getName(), writable); } catch (UnsupportedTypeException e) { LOG.debug("{} is not a supported type", field.getName(), e); throw new IllegalArgumentException(String.format("%s is not a supported type", field.getName()), e); } } return orcRecord; }

Target:
public OrcStruct transform(StructuredRecord input, Schema schema) { List<Schema.Field> fields = input.getSchema().getFields(); OrcStruct orcRecord = parseOrcSchema(input.getSchema()); for (int i = 0; i < fields.size(); i++) { Schema.Field field = fields.get(i); try { WritableComparable writable = convertToWritable(field, input); orcRecord.setFieldValue(fields.get(i).getName(), writable); } catch (UnsupportedTypeException e) { throw new IllegalArgumentException(String.format("%s is not a supported type", field.getName()), e); } } return orcRecord; }
Source:
private List<Pair<Guid, Integer>> filter(final VM vm, final VDS... hosts) { return inClusterUpgradeWeightPolicyUnit.score(null, Arrays.asList(hosts), vm, null); }

Target:
private List<Pair<Guid, Integer>> filter(final VM vm, final VDS... hosts) { return inClusterUpgradeWeightPolicyUnit.score(new Cluster(), Arrays.asList(hosts), vm, null); }
Source:
private void updateRelevantVms() { List<VM> vms = getVmsDiskPluggedTo(); for (VM vm : vms) { if (vm.getStatus().isUpOrPaused() || vms.size() == 1) { try { VDSReturnValue ret = extendVmDiskSize(vm, getParameters().getNewSize()); if (!ret.getSucceeded()) { updateAuditLogFailedToUpdateVM(vm.getName()); } } catch (RuntimeException e) { if (log.isWarnEnabled()) { log.warnFormat("Failed to update VM '{0}' with the new volume size due to error: {1}." + "VM should be restarted to detect the new size.", vm.getName(), ExceptionUtils.getMessage(e)); } updateAuditLogFailedToUpdateVM(vm.getName()); } } } }

Target:
private void updateRelevantVms() { List<VM> vms = getVmsDiskPluggedTo(); for (VM vm : vms) { if (vm.getStatus().isUpOrPaused() || vms.size() == 1) { try { VDSReturnValue ret = extendVmDiskSize(vm, getParameters().getNewSize()); if (!ret.getSucceeded()) { updateAuditLogFailedToUpdateVM(vm.getName()); } } catch (VdcBLLException e) { log.warnFormat("Failed to update VM '{0}' with the new volume size due to error: {1}." + "VM should be restarted to detect the new size.", vm.getName(), ExceptionUtils.getMessage(e)); updateAuditLogFailedToUpdateVM(vm.getName()); } } } }
Source:
public SubordinateTransaction getImportedTransaction(Xid xid) throws XAException { if (xid == null) throw new IllegalArgumentException(); TransactionImpleHolder holder = _transactions.get(new SubordinateXidImple(xid)); if (holder == null) return null; SubordinateTransaction tx = holder.getImported(); if (tx == null) return null; try { if (tx.getStatus() == javax.transaction.Status.STATUS_ROLLEDBACK) { throw new XAException(XAException.XA_RBROLLBACK); } } catch (SystemException e) { e.printStackTrace(); throw new XAException(XAException.XA_RBROLLBACK); } if (!tx.activated()) { tx.recover(); return tx; } else return tx; }

Target:
public SubordinateTransaction getImportedTransaction(Xid xid) throws XAException { if (xid == null) throw new IllegalArgumentException(); AtomicReference<TransactionImple> holder = _transactions.get(new SubordinateXidImple(xid)); TransactionImple tx = holder == null ? null : holder.get(); if (tx == null) { return null; } try { if (tx.getStatus() == javax.transaction.Status.STATUS_ROLLEDBACK) { throw new XAException(XAException.XA_RBROLLBACK); } } catch (SystemException e) { e.printStackTrace(); throw new XAException(XAException.XA_RBROLLBACK); } if (!tx.activated()) { tx.recover(); return tx; } else return tx; }
Source:
public final boolean isEnabled() { boolean result = false; IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); if (page != null) { ISelection selection = page.getSelection(); if (selection instanceof IStructuredSelection) { result = true; final Iterator<?> it = ((IStructuredSelection) selection).iterator(); while (it.hasNext() && result) { Object o = it.next(); if (o instanceof IAbstractDiagramNodeEditPart) { IAbstractDiagramNodeEditPart diagramEditPart = (IAbstractDiagramNodeEditPart) o; View view = (View) diagramEditPart.getModel(); EObject element = view.getElement(); IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(element); if (permissionAuthority != null && !permissionAuthority.canEditInstance(element)) { result = false; break; } } else { result = false; break; } } } } return result; }

Target:
public final boolean isEnabled() { boolean result = false; IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); if (page != null && page.getSelection() instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) page.getSelection(); if (!selection.isEmpty()) { result = true; final Iterator<?> it = selection.iterator(); while (it.hasNext() && result) { Object o = it.next(); if (o instanceof IAbstractDiagramNodeEditPart) { IAbstractDiagramNodeEditPart diagramEditPart = (IAbstractDiagramNodeEditPart) o; View view = (View) diagramEditPart.getModel(); EObject element = view.getElement(); IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(element); if (permissionAuthority != null && !permissionAuthority.canEditInstance(element)) { result = false; } } else { result = false; } } } } return result; }
Source:
private Function<PollingContext<OperationResult>, Mono<SimpleResponse<AnalyzeOperationResult>>> fetchingOperation( Function<UUID, Mono<SimpleResponse<AnalyzeOperationResult>>> fetchingFunction) { return (pollingContext) -> { try { final UUID resultUid = UUID.fromString(pollingContext.getLatestResponse().getValue().getResultId()); return fetchingFunction.apply(resultUid); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }

Target:
private Function<PollingContext<OperationResult>, Mono<SimpleResponse<AnalyzeOperationResult>>> fetchingOperation( Function<UUID, Mono<SimpleResponse<AnalyzeOperationResult>>> fetchingFunction) { return pollingContext -> { try { final UUID resultUuid = UUID.fromString(pollingContext.getLatestResponse().getValue().getResultId()); return fetchingFunction.apply(resultUuid); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }
Source:
public ExtensionResponse executePreOutboundAction(final IExtensionRequest ier, List<RestcommExtensionGeneric> extensions) { ExtensionResponse response = new ExtensionResponse(); if (extensions != null && extensions.size() > 0) { for (RestcommExtensionGeneric extension : extensions) { if(logger.isInfoEnabled()) { logger.info( extension.getName()+" is enabled="+extension.isEnabled()); } if (extension.isEnabled()) { try { ExtensionResponse tempResponse = extension.preOutboundAction(ier); if (tempResponse != null) { response = tempResponse; if (!tempResponse.isAllowed()) { break; } } } catch (Exception e) { if (logger.isDebugEnabled()) { String msg = String.format("There was an exception while executing preInboundAction from extension %s, exception %s", extension.getName(), e); logger.debug(msg); } } } } } return response; }

Target:
public ExtensionResponse executePreOutboundAction(final IExtensionRequest ier, List<RestcommExtensionGeneric> extensions) { ExtensionResponse response = new ExtensionResponse(); if (extensions != null && extensions.size() > 0) { for (RestcommExtensionGeneric extension : extensions) { if(logger.isInfoEnabled()) { logger.info( extension.getName()+" is enabled="+extension.isEnabled()); } if (extension.isEnabled()) { try { ExtensionResponse tempResponse = extension.preOutboundAction(ier); if (tempResponse != null) { response = tempResponse; if (!tempResponse.isAllowed()) { break; } } } catch (Throwable t) { if (logger.isDebugEnabled()) { String msg = String.format("There was an exception while executing preInboundAction from extension %s, exception %s", extension.getName(), t); logger.debug(msg); } } } } } return response; }
Source:
public EPackage getPackage(String namespace, String loadedVersion) { if (namespace != null) { String mapTo = null; if (Version.parseVersion(loadedVersion).compareTo(ALREADY_MIGRATED_VERSION) < 0) { mapTo = VIEWPOINT_TO_SIRUS_0_9_NS_URI_MAPPINGS.get(namespace); } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M5_VERSION) < 0) { mapTo = SIRUS_0_9_TO_SIRUS_1_0_0_M5_NS_URI_MAPPINGS.get(namespace); } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M6_VERSION) < 0) { mapTo = SIRUS_1_0_0_M5_TO_SIRUS_1_0_0_M6_NS_URI_MAPPINGS.get(namespace); } if (mapTo != null) { EPackage found = EPackage.Registry.INSTANCE.getEPackage(mapTo); if (found != null) { return found; } } } return super.getPackage(namespace, loadedVersion); }

Target:
public EPackage getPackage(String namespace, String loadedVersion) { if (namespace != null) { String mapTo = null; if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_0_9_VERSION) < 0) { mapTo = FROM_VIEWPOINT_NS_URI_MAPPINGS.get(namespace); } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M5_VERSION) < 0) { mapTo = FROM_SIRIUS_0_9_NS_URI_MAPPINGS.get(namespace); } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M6_VERSION) < 0) { mapTo = FROM_SIRIUS_1_0_0_M5_NS_URI_MAPPINGS.get(namespace); } if (mapTo != null) { EPackage found = EPackage.Registry.INSTANCE.getEPackage(mapTo); if (found != null) { return found; } } } return super.getPackage(namespace, loadedVersion); }
Source:
protected String[] customCommandLineValidation() { List<String> errors = new ArrayList<>(); if (INTERLEAVE && SECOND_END_FASTQ != null) { errors.add("Cannot set INTERLEAVE to true and pass in a SECOND_END_FASTQ"); } if (UNPAIRED_FASTQ != null && SECOND_END_FASTQ == null) { errors.add("UNPAIRED_FASTQ may only be set when also emitting read1 and read2 fastqs (so SECOND_END_FASTQ must also be set)."); } if ((CLIPPING_ATTRIBUTE != null && CLIPPING_ACTION == null) || (CLIPPING_ATTRIBUTE == null && CLIPPING_ACTION != null)) { errors.add("Both or neither of CLIPPING_ATTRIBUTE and CLIPPING_ACTION should be set."); } if (CLIPPING_ACTION != null) { if (!CLIPPING_ACTION.equals("N") && !CLIPPING_ACTION.equals("X")) { try { Integer.parseInt(CLIPPING_ACTION); } catch (NumberFormatException nfe) { errors.add("CLIPPING ACTION must be one of: N, X, or an integer"); } } } if ((OUTPUT_PER_RG && OUTPUT_DIR == null) || ((!OUTPUT_PER_RG) && OUTPUT_DIR != null)) { errors.add("If OUTPUT_PER_RG is true, then OUTPUT_DIR should be set. If "); } if (OUTPUT_PER_RG) { if (RG_TAG == null) { errors.add("If OUTPUT_PER_RG is true, then RG_TAG should be set."); } else if (!(RG_TAG.equalsIgnoreCase("PU") || RG_TAG.equalsIgnoreCase("ID"))) { errors.add("RG_TAG must be: PU or ID"); } } return errors.isEmpty() ? super.customCommandLineValidation() : errors.toArray(new String[errors.size()]); }

Target:
protected String[] customCommandLineValidation() { List<String> errors = new ArrayList<>(); if (INTERLEAVE && SECOND_END_FASTQ != null) { errors.add("Cannot set INTERLEAVE to true and pass in a SECOND_END_FASTQ"); } if (UNPAIRED_FASTQ != null && SECOND_END_FASTQ == null) { errors.add("UNPAIRED_FASTQ may only be set when also emitting read1 and read2 fastqs (so SECOND_END_FASTQ must also be set)."); } if ((CLIPPING_ATTRIBUTE != null && CLIPPING_ACTION == null) || (CLIPPING_ATTRIBUTE == null && CLIPPING_ACTION != null)) { errors.add("Both or neither of CLIPPING_ATTRIBUTE and CLIPPING_ACTION should be set."); } if (CLIPPING_ACTION != null) { if (!CLIPPING_ACTION.equals(CLIP_TO_N) && !CLIPPING_ACTION.equals(CLIP_TRIM)) { try { Integer.parseInt(CLIPPING_ACTION); } catch (NumberFormatException nfe) { errors.add("CLIPPING ACTION must be one of: N, X, or an integer"); } } } if ((OUTPUT_PER_RG && OUTPUT_DIR == null) || ((!OUTPUT_PER_RG) && OUTPUT_DIR != null)) { errors.add("If OUTPUT_PER_RG is true, then OUTPUT_DIR should be set. If "); } if (OUTPUT_PER_RG) { if (RG_TAG == null) { errors.add("If OUTPUT_PER_RG is true, then RG_TAG should be set."); } else if (!(RG_TAG.equalsIgnoreCase("PU") || RG_TAG.equalsIgnoreCase("ID"))) { errors.add("RG_TAG must be: PU or ID"); } } return errors.isEmpty() ? super.customCommandLineValidation() : errors.toArray(new String[errors.size()]); }
Source:
V unwrap() throws ResultException; V unwrap(String message) throws ResultException; @SuppressWarnings("unchecked") <U> Result<U, E> then(final FunctionWithException<V, Result<U, E>> lambda); <U> Result<U, E> map(final FunctionWithException<V, U> lambda); <F> Result<V, F> mapErr(final FunctionWithException<E, F> lambda); Result<V, E> recover(FunctionWithException<E, V> recover); default V orElse(V value) { return getValue().orElse(value); }

Target:
V unwrap() throws ResultException; V unwrap(String message) throws ResultException; @SuppressWarnings("unchecked") <U> Result<U, E> flatMap(final FunctionWithException<V, Result<U, E>> lambda); <U> Result<U, E> map(final FunctionWithException<V, U> lambda); <F> Result<V, F> mapErr(final FunctionWithException<E, F> lambda); Result<V, E> recover(FunctionWithException<E, V> recover); default V orElse(V value) { return getValue().orElse(value); }
Source:
public void testClearNonEmptyCacheAccessException() throws Exception { final MockStore realStore = new MockStore(this.getTestStoreEntries()); this.store = spy(realStore); doThrow(new CacheAccessException("")).when(this.store).clear(); final Ehcache<String, String> ehcache = this.getEhcache(); assertThat(realStore.getMap().isEmpty(), is(false)); ehcache.clear(); verifyZeroInteractions(this.cacheLoader); verifyZeroInteractions(this.cacheWriter); verify(this.spiedResilienceStrategy).clearFailure(any(CacheAccessException.class)); }

Target:
public void testClearNonEmptyCacheAccessException() throws Exception { final FakeStore realStore = new FakeStore(this.getTestStoreEntries()); this.store = spy(realStore); doThrow(new CacheAccessException("")).when(this.store).clear(); final Ehcache<String, String> ehcache = this.getEhcache(); assertThat(realStore.getEntryMap().isEmpty(), is(false)); ehcache.clear(); verifyZeroInteractions(this.cacheLoader); verifyZeroInteractions(this.cacheWriter); verify(this.spiedResilienceStrategy).clearFailure(any(CacheAccessException.class)); }
Source:
private boolean isChunkValidForRender(RenderableChunk chunk) { if (!chunk.isReady()) { return false; } boolean surroundingChunksLoaded = worldProvider.getWorldViewAround(chunk.getPosition()) == null; if (surroundingChunksLoaded) { return false; } return true; }

Target:
private boolean isChunkValidForRender(RenderableChunk chunk) { return chunk.isReady() && areSurroundingChunksLoaded(chunk); }
Source:
public List<Throwable> getErrors() { return errors; }

Target:
public List<Throwable> getErrors() { return Collections.unmodifiableList(errors); }
Source:
public ChannelGroupType type() { final List<ChannelDefinition> channelDefinitions = channels.values().stream() .map(c -> new ChannelDefinition(c.channelID, c.channelTypeUID)).collect(Collectors.toList()); return ChannelGroupTypeBuilder.instance(channelGroupTypeUID, name()).withChannelDefinitions(channelDefinitions) .build(); }

Target:
public ChannelGroupType type() { final List<ChannelDefinition> channelDefinitions = channels.values().stream() .map(c -> new ChannelDefinitionBuilder(c.channelID, c.channelTypeUID).build()) .collect(Collectors.toList()); return ChannelGroupTypeBuilder.instance(channelGroupTypeUID, name()).withChannelDefinitions(channelDefinitions) .build(); }
Source:
public void start(ServiceProvider<Service> serviceProvider) { persistence = serviceProvider.getService(LocalPersistenceService.class); if (!serializers.containsKey(Serializable.class)) { serializers.put(Serializable.class, (Class) CompactPersistentJavaSerializer.class); } if (!serializers.containsKey(Long.class)) { serializers.put(Long.class, LongSerializer.class); } if (!serializers.containsKey(Integer.class)) { serializers.put(Integer.class, IntegerSerializer.class); } if (!serializers.containsKey(Float.class)) { serializers.put(Float.class, FloatSerializer.class); } if (!serializers.containsKey(Double.class)) { serializers.put(Double.class, DoubleSerializer.class); } if (!serializers.containsKey(Character.class)) { serializers.put(Character.class, CharSerializer.class); } if (!serializers.containsKey(String.class)) { serializers.put(String.class, StringSerializer.class); } }

Target:
public void start(ServiceProvider<Service> serviceProvider) { persistence = serviceProvider.getService(LocalPersistenceService.class); addDefaultSerializerIfNoneRegistered(serializers, Serializable.class, (Class) CompactPersistentJavaSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Long.class, LongSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Integer.class, IntegerSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Float.class, FloatSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Double.class, DoubleSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Character.class, CharSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, String.class, StringSerializer.class); }
Source:
public void writeData(ObjectDataOutput out) throws IOException { out.writeLong(version); out.writeLong(hits); out.writeLong(ttl); out.writeLong(creationTime); out.writeLong(lastAccessTime); out.writeLong(lastUpdateTime); out.writeLong(maxIdle); boolean statsEnabled = !(lastStoredTime == NOT_AVAILABLE && expirationTime == NOT_AVAILABLE); out.writeBoolean(statsEnabled); if (statsEnabled) { out.writeLong(lastStoredTime); out.writeLong(expirationTime); } }

Target:
public void writeData(ObjectDataOutput out) throws IOException { out.writeLong(version); out.writeLong(hits); out.writeLong(ttl); out.writeLong(creationTime); out.writeLong(lastAccessTime); out.writeLong(lastUpdateTime); boolean statsEnabled = !(lastStoredTime == NOT_AVAILABLE && expirationTime == NOT_AVAILABLE); out.writeBoolean(statsEnabled); if (statsEnabled) { out.writeLong(lastStoredTime); out.writeLong(expirationTime); } if (out.getVersion().isGreaterOrEqual(V3_11)) { out.writeLong(maxIdle); } }
Source:
private List<FeedbackQuestionTableRow> buildCopyQuestionsModalRows(List<FeedbackQuestionAttributes> copiableQuestions, InstructorAttributes instructor) { List<FeedbackQuestionTableRow> copyQuestionRows = new ArrayList<FeedbackQuestionTableRow>(); if (instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION)) { for (FeedbackQuestionAttributes question1 : copiableQuestions) { String courseId = question1.courseId; String fsName = question1.feedbackSessionName; String qnType = question1.getQuestionDetails().getQuestionTypeDisplayName(); String qnText = question1.getQuestionDetails().questionText; String qnId = question1.getId(); FeedbackQuestionTableRow row = new FeedbackQuestionTableRow(courseId, fsName, qnType, qnText, qnId); copyQuestionRows.add(row); } } return copyQuestionRows; }

Target:
private List<FeedbackQuestionTableRow> buildCopyQuestionsModalRows(List<FeedbackQuestionAttributes> copiableQuestions, InstructorAttributes instructor) { List<FeedbackQuestionTableRow> copyQuestionRows = new ArrayList<FeedbackQuestionTableRow>(); if (instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION)) { for (FeedbackQuestionAttributes question : copiableQuestions) { String courseId = question.courseId; String fsName = question.feedbackSessionName; String qnType = question.getQuestionDetails().getQuestionTypeDisplayName(); String qnText = question.getQuestionDetails().questionText; String qnId = question.getId(); FeedbackQuestionTableRow row = new FeedbackQuestionTableRow(courseId, fsName, qnType, qnText, qnId); copyQuestionRows.add(row); } } return copyQuestionRows; }
Source:
private ChildEventingList acquireChildEventingList( Object parentElement, DocumentView documentView) { ChildEventingList childEventingList = mCachedChildEventingList; if (childEventingList == null) { childEventingList = new ChildEventingList(); } childEventingList.acquire(parentElement, documentView); return childEventingList; }

Target:
private ChildEventingList acquireChildEventingList( Object parentElement, DocumentView documentView) { ChildEventingList childEventingList = mCachedChildEventingList; if (childEventingList == null) { childEventingList = new ChildEventingList(); } mCachedChildEventingList = null; childEventingList.acquire(parentElement, documentView); return childEventingList; }
Source:
public ExpressionRewriter(Expression<T> expression) { super(); this.expression = expression; }

Target:
public ExpressionRewriter(Expression<T> expression) { this.expression = expression; }
Source:
public NamedCounters(String[] initialCounterNames) { this.counters = Maps.newHashMap(); for (String initialCounterName : initialCounterNames) { this.counters.put(initialCounterName, 0L); } }

Target:
public NamedCounters(String[] initialCounterNames) { Preconditions.checkNotNull(initialCounterNames); this.counters = Maps.newHashMap(); for (String initialCounterName : initialCounterNames) { this.counters.put(initialCounterName, 0L); } }
Source:
public MachineTokenAccessFilter() { allowedMethods.putAll( "/workspace", asList("getByKey", "addProject", "updateProject", "deleteProject")); allowedMethods.putAll("/ssh", asList("getPair", "generatePair")); allowedMethods.put("/preferences", "find"); allowedMethods.put("/activity", "active"); }

Target:
public MachineTokenAccessFilter() { allowedMethodsByPath.putAll( "/workspace", asList("getByKey", "addProject", "updateProject", "deleteProject")); allowedMethodsByPath.putAll("/ssh", asList("getPair", "generatePair")); allowedMethodsByPath.putAll( "/factory", asList("getFactoryJson", "getFactory", "getFactoryByAttribute", "resolveFactory")); allowedMethodsByPath.put("/preferences", "find"); allowedMethodsByPath.put("/activity", "active"); }
Source:
public boolean setNamespaceRoutingData(String namespace, Map<String, List<String>> routingData) { synchronized (this) { if (!_routingDataWriterMap.containsKey(namespace)) { throw new IllegalArgumentException( "Failed to set routing data: Namespace " + namespace + " is not found!"); } boolean result = _routingDataWriterMap.get(namespace).setRoutingData(routingData); refreshRoutingData(namespace); return result; } }

Target:
public boolean setNamespaceRoutingData(String namespace, Map<String, List<String>> routingData) { if (!_routingDataWriterMap.containsKey(namespace)) { throw new IllegalArgumentException( "Failed to set routing data: Namespace " + namespace + " is not found!"); } synchronized (this) { boolean result = _routingDataWriterMap.get(namespace).setRoutingData(routingData); refreshRoutingData(namespace); return result; } }
Source:
private InputStream getInputStreamFromResource( String resource, ProgressCallback extractionCallback) throws GeoEntryExtractionException, GeoNamesRemoteDownloadException { if (!urlValidator.isValid(resource) && FilenameUtils.isExtension(resource, "zip")) { InputStream inputStream = getFileInputStream(resource); return unZipInputStream(resource, inputStream); } else if (!urlValidator.isValid(resource) && FilenameUtils.isExtension(resource, "txt")) { return getFileInputStream(resource); } else if (StringUtils.isNotBlank(resource)) { if (!StringUtils.isAlphanumeric(resource) && !urlValidator.isValid(resource)) { throw new GeoEntryExtractionException( String.format( "Unable to update the index. The file at %s is not a supported path.", resource)); } if (resource.equalsIgnoreCase("all")) { resource = "allCountries"; } else if (resource.matches("((?i)cities[0-9]+)")) { resource = resource.toLowerCase(); } else if (!resource.equalsIgnoreCase("allCountries") && !urlValidator.isValid(resource)) { resource = resource.toUpperCase(); } Response response = createConnection(resource); InputStream urlInputStream = getUrlInputStreamFromWebClient(); InputStream inputStream = getInputStreamFromUrl(resource, response, urlInputStream, extractionCallback); return unZipInputStream(resource, inputStream); } throw new GeoEntryExtractionException( "Unable to update the index. " + resource + " is not a .zip or .txt, or an invalid country code was entered."); }

Target:
private InputStream getInputStreamFromResource( String resource, ProgressCallback extractionCallback) throws GeoEntryExtractionException, GeoNamesRemoteDownloadException { boolean resourceIsValidUrl = URL_VALIDATOR.isValid(resource); if (!resourceIsValidUrl && FilenameUtils.isExtension(resource, "zip")) { InputStream inputStream = getFileInputStream(resource); return unZipInputStream(resource, inputStream); } else if (!resourceIsValidUrl && FilenameUtils.isExtension(resource, "txt")) { return getFileInputStream(resource); } else if (StringUtils.isNotBlank(resource)) { if (!StringUtils.isAlphanumeric(resource) && !resourceIsValidUrl) { throw new GeoEntryExtractionException( String.format( "Unable to update the index. %s is not a supported file path.", resource)); } if (resource.equalsIgnoreCase("all")) { resource = "allCountries"; } else if (resource.matches("((?i)cities[0-9]+)")) { resource = resource.toLowerCase(); } else if (!resource.equalsIgnoreCase("allCountries") && !resourceIsValidUrl) { resource = resource.toUpperCase(); } Response response = createConnection(resource); InputStream urlInputStream = getUrlInputStreamFromWebClient(); InputStream inputStream = getInputStreamFromUrl(resource, response, urlInputStream, extractionCallback); return unZipInputStream(resource, inputStream); } throw new GeoEntryExtractionException( "Unable to update the index. " + resource + " is not a .zip or .txt, or an invalid country code was entered."); }
Source:
public void whenChangingPINIfPINIsTooLongThrowAnException() { alarmSystem.changePIN(INVALID_PIN, TOO_LONG_PIN); }

Target:
public void whenChangingPINIfPINIsTooLongThrowAnException() { alarmSystem.changePIN(VALID_PIN, TOO_LONG_PIN); }
Source:
public static void flush(boolean expectRemoval, ControlledScatteredVersionManager... svms) { int[] regularCounters = new int[svms.length]; int[] removeCounters = new int[svms.length]; for (int i = 0; i < svms.length; ++i) { regularCounters[i] = svms[i].regularCounter.get(); removeCounters[i] = svms[i].removeCounter.get(); if (!svms[i].startFlush()) { regularCounters[i] = Integer.MIN_VALUE; removeCounters[i] = Integer.MIN_VALUE; } } for (;;) { boolean done = true; for (int i = 0; i < svms.length; ++i) { if (regularCounters[i] >= svms[i].regularCounter.get()) { log.tracef("SVM %d had %d regular invalidations, now has %d", i, regularCounters[i], svms[i].regularCounter.get()); done = false; } if (expectRemoval && removeCounters[i] >= svms[i].removeCounter.get()) { log.tracef("SVM %d had %d remove invalidations, now has %d", i, removeCounters[i], svms[i].removeCounter.get()); done = false; } } if (done) break; LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(10)); } }

Target:
public static void flush(boolean expectRemoval, ControlledScatteredVersionManager... svms) { int[] regularCounters = new int[svms.length]; int[] removeCounters = new int[svms.length]; for (int i = 0; i < svms.length; ++i) { regularCounters[i] = svms[i].regularCounter.get(); removeCounters[i] = svms[i].removeCounter.get(); if (!svms[i].startFlush()) { regularCounters[i] = Integer.MIN_VALUE; removeCounters[i] = Integer.MIN_VALUE; } } for (;;) { boolean done = true; for (int i = 0; i < svms.length; ++i) { int svmRegularCounters = svms[i].regularCounter.get(); int svmRemoveCounters = svms[i].removeCounter.get(); if (regularCounters[i] >= svmRegularCounters) { log.tracef("SVM %d had %d regular invalidations, now has %d", i, regularCounters[i], svmRegularCounters); done = false; } if (expectRemoval && removeCounters[i] >= svmRemoveCounters) { log.tracef("SVM %d had %d remove invalidations, now has %d", i, removeCounters[i], svmRemoveCounters); done = false; } } if (done) break; LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(10)); } }
Source:
public Map<String, IndexStats> getIndicesStats() { final Request request = new Request("GET", "/_stats"); final Map<String, Object> jsonMap = performLowLevelRequest(request); Map<String, IndexStats> indexStatsMap = new HashMap<>(); final Map<String, Object> indices = (Map<String, Object>)jsonMap.get("indices"); indices.forEach((key, value)-> { Map<String, Object> indexStats = (Map<String, Object>) ((Map<String, Object>) indices.get(key)).get("primaries"); int numOfDocs = (int) ((Map<String, Object>) indexStats.get("docs")) .get("count"); int sizeInBytes = (int) ((Map<String, Object>) indexStats.get("store")) .get("size_in_bytes"); indexStatsMap.put(key, new IndexStats(key, numOfDocs, sizeInBytes)); }); return indexStatsMap; }

Target:
public Map<String, IndexStats> getIndicesStats() { final Request request = new Request("GET", "/_stats"); final Map<String, Object> jsonMap = performLowLevelRequest(request); Map<String, IndexStats> indexStatsMap = new HashMap<>(); final Map<String, Object> indices = (Map<String, Object>)jsonMap.get("indices"); indices.forEach((key, value)-> { if (hasClusterPrefix(key)) { final Map<String, Object> indexStats = (Map<String, Object>) ((Map<String, Object>) indices.get(key)).get("primaries"); int numOfDocs = (int) ((Map<String, Object>) indexStats.get("docs")) .get("count"); int sizeInBytes = (int) ((Map<String, Object>) indexStats.get("store")) .get("size_in_bytes"); final String indexNameWithoutPrefix = removeClusterIdFromName(key); indexStatsMap.put(indexNameWithoutPrefix, new IndexStats(indexNameWithoutPrefix, numOfDocs, sizeInBytes)); } }); return indexStatsMap; }
Source:
public void shouldRegisterActionContribution() { assertNotNull(directoryTreeService); assertTrue(directoryTreeService.getDirectoryTrees().contains("anyNavigation")); ActionService actionService = (ActionService) Framework.getService(ActionManager.class); assertNotNull(actionService); Action action = actionService.getAction(DirectoryTreeDescriptor.ACTION_ID_PREFIX + "anyNavigation"); assertNotNull(action); }

Target:
public void shouldRegisterActionContribution() { assertNotNull(directoryTreeService); assertNotNull(actionService); assertTrue(directoryTreeService.getDirectoryTrees().contains("anyNavigation")); Action action = actionService.getAction(DirectoryTreeDescriptor.ACTION_ID_PREFIX + "anyNavigation"); assertNotNull(action); }
Source:
public Response getVendor(@PathParam(PurapPropertyConstants.VENDOR_NUMBER) String vendorNumber, @Context HttpHeaders headers) { try { HashMap<String, String> vendorCombinedPk = parseVendorNumber(vendorNumber); VendorDetail vendorDetail = getLookupDao().findObjectByMap(VendorDetail.class.newInstance(), vendorCombinedPk); if (vendorDetail == null) { return respondNotFound(); } String responseBody = gson.toJson(getVendorProperties(vendorDetail)); return Response.ok(responseBody).build(); } catch (BadRequestException ex) { return respondGetVendorBadRequest(); } catch (Exception ex) { LOG.error(ex); return respondInternalServerError(ex); } }

Target:
public Response getVendor(@PathParam(PurapPropertyConstants.VENDOR_NUMBER) String vendorNumber, @Context HttpHeaders headers) { try { HashMap<String, String> vendorCombinedPk = parseVendorNumber(vendorNumber); VendorDetail vendorDetail = getLookupDao().findObjectByMap(VendorDetail.class.newInstance(), vendorCombinedPk); if (ObjectUtils.isNull(vendorDetail)) { return respondNotFound(); } String responseBody = gson.toJson(getVendorProperties(vendorDetail)); return Response.ok(responseBody).build(); } catch (BadRequestException ex) { return respondGetVendorBadRequest(); } catch (Exception ex) { LOG.error(ex); return respondInternalServerError(ex); } }
Source:
protected IStructuredSelection getStructuredSelection(StructuredViewer viewer) throws ClassCastException { ISelection selection = viewer.getSelection(); if (selection instanceof IStructuredSelection) { return (IStructuredSelection) selection; } throw new ClassCastException("StructuredViewer should return an instance of IStructuredSelection from its getSelection() method."); }

Target:
protected IStructuredSelection getStructuredSelection(StructuredViewer viewer) throws ClassCastException { ISelection selection = viewer.getSelection(); if (selection instanceof IStructuredSelection) { return (IStructuredSelection) selection; } throw new ClassCastException(Messages.AbstractEEFWidgetLifecycleManager_invalidSelectionType); }
Source:
private static ValueMatcher makeDictionaryEncodedValueMatcherGeneric( final DimensionSelector selector, Predicate<String> predicate ) { final BitSet checkedIds = new BitSet(selector.getValueCardinality()); final BitSet matchingIds = new BitSet(selector.getValueCardinality()); final boolean matchNull = predicate.apply(null); return new ValueMatcher() { @Override public boolean matches() { final IndexedInts row = selector.getRow(); final int size = row.size(); if (size == 0) { return matchNull; } else { for (int i = 0; i < size; ++i) { final int id = row.get(i); final boolean matches; if (checkedIds.get(id)) { matches = matchingIds.get(id); } else { matches = predicate.apply(selector.lookupName(id)); checkedIds.set(id); matchingIds.set(id, matches); } if (matches) { return true; } } return false; } } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }

Target:
private static ValueMatcher makeDictionaryEncodedValueMatcherGeneric( final DimensionSelector selector, Predicate<String> predicate ) { final BitSet checkedIds = new BitSet(selector.getValueCardinality()); final BitSet matchingIds = new BitSet(selector.getValueCardinality()); final boolean matchNull = predicate.apply(null); return new ValueMatcher() { @Override public boolean matches() { final IndexedInts row = selector.getRow(); final int size = row.size(); if (size == 0) { return matchNull; } else { for (int i = 0; i < size; ++i) { final int id = row.get(i); final boolean matches; if (checkedIds.get(id)) { matches = matchingIds.get(id); } else { matches = predicate.apply(selector.lookupName(id)); checkedIds.set(id); if (matches) { matchingIds.set(id); } } if (matches) { return true; } } return false; } } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }
Source:
private Collection<MediaType> getAcceptedMediaTypes(Module module) { Collection<?> acceptedTypes = module.getComponent(MEDIA_TYPE_BEAN_NAME, Collection.class); if (CollectionUtils.isEmpty(acceptedTypes)) { return DEFAULT_ACCEPTED_MEDIA_TYPES; } else { Collection<MediaType> acceptedMediaTypes = new ArrayList<MediaType>(acceptedTypes.size()); for (Object acceptedType: acceptedTypes) { if (acceptedType instanceof String) { acceptedMediaTypes.add(MediaType.parseMediaType((String) acceptedType)); } } return Collections.unmodifiableCollection(acceptedMediaTypes); } }

Target:
private Collection<MediaType> getAcceptedMediaTypes(Module module) { Collection<?> acceptedTypes = module.getComponent(MEDIA_TYPE_BEAN_NAME, Collection.class); if (CollectionUtils.isEmpty(acceptedTypes)) { return DEFAULT_ACCEPTED_MEDIA_TYPES; } else { Collection<MediaType> acceptedMediaTypes = new ArrayList<MediaType>(acceptedTypes.size()); for (Object acceptedType: acceptedTypes) { if (acceptedType instanceof String) { acceptedMediaTypes.add(MediaType.parseMediaType((String) acceptedType)); } else if (acceptedType instanceof MediaType) { acceptedMediaTypes.add((MediaType) acceptedType); } } return Collections.unmodifiableCollection(acceptedMediaTypes); } }
Source:
public String resolve(String originalHost) { String currentHost = originalHost; if (isLocalOrIp(currentHost)) { return originalHost; } try { String targetHost = null; do { Attributes attrs = getDirContext().getAttributes(currentHost, new String[]{A_RECORD_TYPE, CNAME_RECORD_TYPE}); Attribute attr = attrs.get(A_RECORD_TYPE); if (attr != null) { targetHost = attr.get().toString(); } attr = attrs.get(CNAME_RECORD_TYPE); if (attr != null) { currentHost = attr.get().toString(); } else { targetHost = currentHost; } } while (targetHost == null); return targetHost; } catch (Exception e) { logger.warn("Cannot resolve eureka server address {}; returning original value {}", currentHost, originalHost, e); return originalHost; } }

Target:
public static String resolve(String originalHost) { String currentHost = originalHost; if (isLocalOrIp(currentHost)) { return originalHost; } try { String targetHost = null; do { Attributes attrs = getDirContext().getAttributes(currentHost, new String[]{A_RECORD_TYPE, CNAME_RECORD_TYPE}); Attribute attr = attrs.get(A_RECORD_TYPE); if (attr != null) { targetHost = attr.get().toString(); } attr = attrs.get(CNAME_RECORD_TYPE); if (attr != null) { currentHost = attr.get().toString(); } else { targetHost = currentHost; } } while (targetHost == null); return targetHost; } catch (NamingException e) { logger.warn("Cannot resolve eureka server address {}; returning original value {}", currentHost, originalHost, e); return originalHost; } }
Source:
private Object[][] validHeadersProvider() { return new Object[][] { {"token123", "token123"}, {"bearer token123", "token123"}, {"bearer token123", "token123"}, }; }

Target:
private Object[][] validHeadersProvider() { return new Object[][] { {"token123", "token123"}, {"bearer token123", "token123"}, {"Bearer token123", "token123"}, }; }
Source:
private Object handleJoinPoint(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, String methodName) throws Throwable { try { io.github.resilience4j.ratelimiter.RateLimiter.waitForPermission(rateLimiter); return proceedingJoinPoint.proceed(); } catch (Exception exception) { if (logger.isDebugEnabled()) { logger.debug("Invocation of method '" + methodName + "' failed!", exception); } throw exception; } }

Target:
private Object handleJoinPoint(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, String methodName) throws Throwable { if (logger.isDebugEnabled()) { logger.debug("Rate limiter invocation for method ", methodName); } return rateLimiter.executeCheckedSupplier(proceedingJoinPoint::proceed); }
Source:
private void runFafReplayFile(Path path) throws IOException { byte[] rawReplayBytes = replayFileReader.readRawReplayData(path); Path tempSupComReplayFile = preferencesService.getCacheDirectory().resolve(TEMP_SCFA_REPLAY_FILE_NAME); createDirectories(tempSupComReplayFile.getParent()); Files.copy(new ByteArrayInputStream(rawReplayBytes), tempSupComReplayFile, StandardCopyOption.REPLACE_EXISTING); LocalReplayInfo replayInfo = replayFileReader.parseMetaData(path); String gameType = replayInfo.getFeaturedMod(); Integer replayId = replayInfo.getUid(); Map<String, Integer> modVersions = replayInfo.getFeaturedModVersions(); String mapName = replayInfo.getMapname(); if (gameType.equals("coop")) mapName = parseCoopMapName(rawReplayBytes); Set<String> simMods = replayInfo.getSimMods() != null ? replayInfo.getSimMods().keySet() : emptySet(); Integer version = parseSupComVersion(rawReplayBytes); gameService.runWithReplay(tempSupComReplayFile, replayId, gameType, version, modVersions, simMods, mapName); }

Target:
private void runFafReplayFile(Path path) throws IOException { byte[] rawReplayBytes = replayFileReader.readRawReplayData(path); Path tempSupComReplayFile = preferencesService.getCacheDirectory().resolve(TEMP_SCFA_REPLAY_FILE_NAME); createDirectories(tempSupComReplayFile.getParent()); Files.copy(new ByteArrayInputStream(rawReplayBytes), tempSupComReplayFile, StandardCopyOption.REPLACE_EXISTING); LocalReplayInfo replayInfo = replayFileReader.parseMetaData(path); String gameType = replayInfo.getFeaturedMod(); Integer replayId = replayInfo.getUid(); Map<String, Integer> modVersions = replayInfo.getFeaturedModVersions(); String mapName = replayInfo.getMapname(); if (StringUtils.isEmptyOrNull(mapName)) { mapName = parseMapFolderName(rawReplayBytes); } Set<String> simMods = replayInfo.getSimMods() != null ? replayInfo.getSimMods().keySet() : emptySet(); Integer version = parseSupComVersion(rawReplayBytes); gameService.runWithReplay(tempSupComReplayFile, replayId, gameType, version, modVersions, simMods, mapName); }
Source:
private void readDecimal( int total, DecimalColumnVector c, int rowId) throws IOException { int left = total; c.precision = (short) type.asPrimitiveType().getDecimalMetadata().getPrecision(); c.scale = (short) type.asPrimitiveType().getDecimalMetadata().getScale(); while (left > 0) { consume(); readRepetitionAndDefinitionLevels(); if (definitionLevel >= maxDefLevel) { c.vector[rowId] = new HiveDecimalWritable(dataColumn.readBytes().getBytesUnsafe(), type.asPrimitiveType().getDecimalMetadata().getScale()); c.isNull[rowId] = false; c.isRepeating = c.isRepeating && (c.vector[0] == c.vector[rowId]); } else { c.isNull[rowId] = true; c.isRepeating = false; c.noNulls = false; } rowId++; left--; } }

Target:
private void readDecimal( int total, DecimalColumnVector c, int rowId) throws IOException { int left = total; c.precision = (short) type.asPrimitiveType().getDecimalMetadata().getPrecision(); c.scale = (short) type.asPrimitiveType().getDecimalMetadata().getScale(); while (left > 0) { readRepetitionAndDefinitionLevels(); if (definitionLevel >= maxDefLevel) { c.vector[rowId].set(dataColumn.readBytes().getBytesUnsafe(), c.scale); c.isNull[rowId] = false; c.isRepeating = c.isRepeating && (c.vector[0] == c.vector[rowId]); } else { c.isNull[rowId] = true; c.isRepeating = false; c.noNulls = false; } rowId++; left--; } }